snowrider has asked for the wisdom of the Perl Monks concerning the following question:
fellow monks,
i am currently tring to learn perl so im attempting to
do the exercises from the tutorials. here is the code.
for reasons unknow to me i keep getting these errors#!/opt/perl5/bin/perl -w use strict; while($line=<> and $line ne ".\n"){ push @lines,$line; } foreach(reverse @lines){ print; }
does anyone know why this program will not work correctly snowriderGlobal symbol "$line" requires explicit package name at day1_test.1.pl + line 5. Global symbol "$line" requires explicit package name at day1_test.1.pl + line 5. Global symbol "@lines" requires explicit package name at day1_test.1.p +l line 6. Global symbol "$line" requires explicit package name at day1_test.1.pl + line 6. Global symbol "@lines" requires explicit package name at day1_test.1.p +l line 8. Execution of day1_test.1.pl aborted due to compilation errors.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: strict
by arturo (Vicar) on Feb 02, 2001 at 01:30 UTC | |
by snowrider (Pilgrim) on Feb 02, 2001 at 01:42 UTC | |
by arturo (Vicar) on Feb 02, 2001 at 01:47 UTC | |
by snowrider (Pilgrim) on Feb 02, 2001 at 01:52 UTC | |
Re: strict
by athomason (Curate) on Feb 02, 2001 at 01:34 UTC | |
by snowrider (Pilgrim) on Feb 02, 2001 at 01:49 UTC | |
Re: strict
by isotope (Deacon) on Feb 02, 2001 at 06:20 UTC | |
Re: strict
by dsb (Chaplain) on Feb 02, 2001 at 01:44 UTC | |
by snowrider (Pilgrim) on Feb 02, 2001 at 01:56 UTC |
Back to
Seekers of Perl Wisdom