in reply to Why is this incorrect?
$_ is a global.
Beside that to get the first parameter you passed to your subs you should use
my $line = lc $_[0]; # and $another_line = $_[0];
as it is the first element in the @_ array, which contains all arguments to the sub.
Beside that you should not use $ in sub names, you should not use & in function calls and you should use warnings.
Cheers, Flo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Why is this incorrect?
by zer (Deacon) on Mar 17, 2006 at 05:09 UTC | |
|
Re^2: Why is this incorrect?
by kettle (Beadle) on Mar 17, 2006 at 07:08 UTC | |
by rafl (Friar) on Mar 17, 2006 at 12:52 UTC |