Q: What's wrong with this?

T

Troll

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.
 
T

Troll

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...
 
G

Ga Mu

Troll said:
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..?
 
J

John Bokma

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

$ netstat -a | perl netstats.pl



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 :)
 
T

Troll

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...
 
J

John Bokma

Troll said:
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.
 
T

Troll

:)

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!
 
J

John Bokma

Troll said:
:)

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top