We don't bite newbies here... much | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Thanks for the replies, everyone. ++ to all. I now see that you Can declare variables in a line like this my ($a, $b, $c) = split; but Only if you use the variables so declared within that block. So my original solution was correct (declare everything up front) but not for the reason I was confused about.
Thanks especially to fletch for this gem of elightenment: On an unrelated note, using undef rather than a junk variable is better practice if you don't need one of the return values from split (or wrap the split in parens and subscript it to pull out what you want, e.g. ( $foo, $bar ) = ( split( /:/ ) )[1,4]). I'll go read some more tutorials now. Thanks again. NovMonk In reply to Re: using strict
by NovMonk
|
|