Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl (http://www.velocityreviews.com/forums/f17-perl.html)
-   -   Q: What's wrong with this? (http://www.velocityreviews.com/forums/t24344-q-whats-wrong-with-this.html)

Troll 09-03-2003 12:38 PM

Q: What's wrong with this?
 
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 09-03-2003 02:09 PM

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" <abuse@microsoft.com> wrote in message
news:1hl5b.80244$bo1.73176@news-server.bigpond.net.au...
> 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.
>
>
>
>




Ga Mu 09-03-2003 04:20 PM

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


John Bokma 09-03-2003 04:31 PM

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/


Troll 09-03-2003 04:38 PM

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" <NgamuthO@SPcomcast.netAM> 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..?
>




John Bokma 09-03-2003 04:46 PM

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/


Troll 09-03-2003 05:04 PM

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" <postmaster@castleamber.com> wrote in message
news:3f561b4e$0$203$58c7af7e@news.kabelfoon.nl...
> 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 09-03-2003 05:15 PM

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/



All times are GMT. The time now is 10:13 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.