Hi Gary,

On Wednesday 15 December 2010 13:30:00 Gary Stainburn wrote:
> Isn't it typical.  Been working on this since yesterday, but as soon as I
> post the question I find the answer·
> 
> I've changed
> 
> foreach my $line (<STDIN>) {
> 
> to
> 
> while  (<STDIN>) {
>   my $line=$_;
> 

Why are you doing this instead of:

[code]
while (my $line = <STDIN>)
{
}
[/code]

I should also note that normall <ARGV> (shortened as <>) is preferable to 
<STDIN>. See:

http://perl-begin.org/tutorials/bad-elements/

Regards,

        Shlomi Fish

> and now it works perfectly.
> 

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
List of Portability Libraries - http://shlom.in/port-libs

Chuck Norris can make the statement "This statement is false" a true one.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to