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
    you can override the $_ for the subrouting by declaring it with 'local'. This may make things easier in the future for you.
Re^2: Why is this incorrect?
by kettle (Beadle) on Mar 17, 2006 at 07:08 UTC
    I guess I should look this up, but why should '&' not be used in function calls? thanks for the other advice!