in reply to Re^2: how do I "initialize" $_
in thread how do I "initialize" $_
I guess as another point, with strict; and warnings; active, when reading from the predefined DATA file handle, you will get a warning if you don't have the while (defined (my $line =<DATA>)){} syntax, that is because a line with just "0" could evaluate to "false". On "real file handles" the action is a bit different - Perl is very good at "doing what I meant" and the defined() is implicit. Perl is a huge language and abounds with little fine differences.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: how do I "initialize" $_
by haukex (Archbishop) on Oct 13, 2018 at 08:47 UTC | |
by Marshall (Canon) on Nov 01, 2018 at 06:57 UTC | |
|
Re^4: how do I "initialize" $_ (updated)
by AnomalousMonk (Archbishop) on Oct 13, 2018 at 02:10 UTC | |
by Marshall (Canon) on Oct 13, 2018 at 04:21 UTC | |
by AnomalousMonk (Archbishop) on Oct 13, 2018 at 06:21 UTC | |
by Marshall (Canon) on Oct 13, 2018 at 09:51 UTC |