Q: What's wrong with this?

Discussion in 'Perl' started by Troll, Sep 3, 2003.

  1. Troll

    Troll Guest

    Hi,

    $ netstat -a | netstats.pl

    The above works on my Linux box. But if I try to run this on my Win2000 Pro
    then this statement fails:
    while (<STDIN>) {
    print "Inside the loop...";
    }

    and I only see this output:
    Before the loop...After the loop...

    Script contents:
    ************
    #!/perl/bin - w # this is my Win path
    print "Before the loop...";
    while (<STDIN>) {
    print "Inside the loop...";
    }
    print "After the loop...";


    Any comments would be appreciated. Thanks.
     
    Troll, Sep 3, 2003
    #1
    1. Advertising

  2. Troll

    Troll Guest

    Re: What's wrong with this?

    Never mind now - solved. Problem caused by associating perl.exe with .pl
    files in Windoze.

    If one runs
    $ netstat -a | c:\perl\bin\perl.exe netstats.pl
    the issue goes away.

    So what's the point of file associations I ask myself...



    "Troll" <> wrote in message
    news:1hl5b.80244$...
    > Hi,
    >
    > $ netstat -a | netstats.pl
    >
    > The above works on my Linux box. But if I try to run this on my Win2000

    Pro
    > then this statement fails:
    > while (<STDIN>) {
    > print "Inside the loop...";
    > }
    >
    > and I only see this output:
    > Before the loop...After the loop...
    >
    > Script contents:
    > ************
    > #!/perl/bin - w # this is my Win path
    > print "Before the loop...";
    > while (<STDIN>) {
    > print "Inside the loop...";
    > }
    > print "After the loop...";
    >
    >
    > Any comments would be appreciated. Thanks.
    >
    >
    >
    >
     
    Troll, Sep 3, 2003
    #2
    1. Advertising

  3. Troll

    Ga Mu Guest

    Re: What's wrong with this?

    Troll wrote:
    > Never mind now - solved. Problem caused by associating perl.exe with .pl
    > files in Windoze.
    >
    > If one runs
    > $ netstat -a | c:\perl\bin\perl.exe netstats.pl
    > the issue goes away.


    Since C:\perl\bin is probably in your path, you could probably just use

    $ netstat -a | perl netstats.pl

    > So what's the point of file associations I ask myself...


    The more important question is what is the point of using Microsoft
    O/Ses for anything other than surfing the web, reading email, and
    creating Word documents..?
     
    Ga Mu, Sep 3, 2003
    #3
  4. Troll

    John Bokma Guest

    Re: What's wrong with this?

    Ga Mu wrote:

    > Troll wrote:
    >
    >> Never mind now - solved. Problem caused by associating perl.exe with .pl
    >> files in Windoze.
    >>
    >> If one runs
    >> $ netstat -a | c:\perl\bin\perl.exe netstats.pl
    >> the issue goes away.

    >
    >
    > Since C:\perl\bin is probably in your path, you could probably just use
    >
    > $ netstat -a | perl netstats.pl
    >
    >> So what's the point of file associations I ask myself...

    >
    >
    > The more important question is what is the point of using Microsoft
    > O/Ses for anything other than surfing the web, reading email, and
    > creating Word documents..?


    Corel Xara version 2 to mention one :)

    Also on win2k I see TCP so the op should use /tcp/i to be safe.

    If he/she is lazy, do the netstat -a in the script. Or maybe there is a
    netstat module :)

    --
    Kind regards, feel free to mail: mail(at)johnbokma.com (or reply)
    virtual home: http://johnbokma.com/ ICQ: 218175426
    John web site hints: http://johnbokma.com/websitedesign/
     
    John Bokma, Sep 3, 2003
    #4
  5. Troll

    Troll Guest

    Re: What's wrong with this?

    True. ;)

    As for the reason:
    I have a 21" screen with Win2K whereas I have Linux on a laptop [and I hate
    swapping cables not to mention that I use the Win2K PC for posting to this
    NG and Google]. So it would have been easier for me to post code examples
    [to troubleshoot] from my Win2K PC as I have not mastered the art of NGs on
    Linux.

    I even have probs with secure sites, PSM and Mozilla so that says something
    about my Linux knowledge at this stage :(

    But in no way did I want to migrate to Perl on Windoze 4 ever...


    "Ga Mu" <> wrote in message
    news:6xo5b.343278$Ho3.49350@sccrnsc03...
    > Troll wrote:
    > > Never mind now - solved. Problem caused by associating perl.exe with .pl
    > > files in Windoze.
    > >
    > > If one runs
    > > $ netstat -a | c:\perl\bin\perl.exe netstats.pl
    > > the issue goes away.

    >
    > Since C:\perl\bin is probably in your path, you could probably just use
    >
    > $ netstat -a | perl netstats.pl
    >
    > > So what's the point of file associations I ask myself...

    >
    > The more important question is what is the point of using Microsoft
    > O/Ses for anything other than surfing the web, reading email, and
    > creating Word documents..?
    >
     
    Troll, Sep 3, 2003
    #5
  6. Troll

    John Bokma Guest

    Re: What's wrong with this?

    Troll wrote:

    > But in no way did I want to migrate to Perl on Windoze 4 ever...


    Why not? It is a great tool to use on Windows. If you use Cygwin
    (http://www.cygwin.com) with rxvt you are so cool :)

    Hey, I even used Perl (4!) on a RISC OS machine (Acorn Archimedes and
    Acorn Risc PC)

    Wish it was available on my ZX Spectrum back in those days.


    --
    Kind regards, feel free to mail: mail(at)johnbokma.com (or reply)
    virtual home: http://johnbokma.com/ ICQ: 218175426
    John web site hints: http://johnbokma.com/websitedesign/
     
    John Bokma, Sep 3, 2003
    #6
  7. Troll

    Troll Guest

    Re: What's wrong with this?

    :)

    I need to learn Linux/Unix [for Uni and myself].
    By migrating apps to Windoze this would sort of defeat that purpose :(

    I tried loading cygwin on one of my PCs some time ago but never got into
    it...not really sure why - had no real need for it back then I suppose.

    I recently decided to buy a separate box for Linux [as I had all sorts of
    dramas trying to get Solaris implemented mainly due to the lack of supported
    h/w] and this is a much neater solution. I have a dual boot laptop with RH9
    and W2K and it's perfect for my needs.

    Not to mention that RH9 could not recognise the Dell screen and it took me 2
    days of stress b4 I decided to load RH7 on it [which did recognise the
    display - go and figure] and upgraded to RH9 and voila!




    "John Bokma" <> wrote in message
    news:3f561b4e$0$203$...
    > Troll wrote:
    >
    > > But in no way did I want to migrate to Perl on Windoze 4 ever...

    >
    > Why not? It is a great tool to use on Windows. If you use Cygwin
    > (http://www.cygwin.com) with rxvt you are so cool :)
    >
    > Hey, I even used Perl (4!) on a RISC OS machine (Acorn Archimedes and
    > Acorn Risc PC)
    >
    > Wish it was available on my ZX Spectrum back in those days.
    >
    >
    > --
    > Kind regards, feel free to mail: mail(at)johnbokma.com (or reply)
    > virtual home: http://johnbokma.com/ ICQ: 218175426
    > John web site hints: http://johnbokma.com/websitedesign/
    >
     
    Troll, Sep 3, 2003
    #7
  8. Troll

    John Bokma Guest

    Re: What's wrong with this?

    Troll wrote:

    > :)
    >
    > I need to learn Linux/Unix [for Uni and myself].
    > By migrating apps to Windoze this would sort of defeat that purpose :(


    Nope, use cygwin. This makes most GNU tools available under Windows. Or
    make your computer dual boot. Or use VMWare.

    > I tried loading cygwin on one of my PCs some time ago but never got into
    > it...not really sure why - had no real need for it back then I suppose.
    >
    > I recently decided to buy a separate box for Linux [as I had all sorts of
    > dramas trying to get Solaris implemented mainly due to the lack of supported
    > h/w] and this is a much neater solution. I have a dual boot laptop with RH9
    > and W2K and it's perfect for my needs.


    I agree :). You can get a PC that can run GNU/Linux almost for free
    nowadays.

    --
    Kind regards, feel free to mail: mail(at)johnbokma.com (or reply)
    virtual home: http://johnbokma.com/ ICQ: 218175426
    John web site hints: http://johnbokma.com/websitedesign/
     
    John Bokma, Sep 3, 2003
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Salisha Khan
    Replies:
    1
    Views:
    11,704
    JohnFol
    Aug 1, 2003
  2. Replies:
    2
    Views:
    403
  3. Pial
    Replies:
    4
    Views:
    57,074
    Phatman
    Aug 27, 2010
  4. Paul Leventis

    Re: Quartus bug or wrong VHDL?

    Paul Leventis, Jun 24, 2003, in forum: VHDL
    Replies:
    0
    Views:
    2,514
    Paul Leventis
    Jun 24, 2003
  5. Matthew
    Replies:
    7
    Views:
    875
    Priscilla Walmsley
    Jan 7, 2005
Loading...

Share This Page