truthseeker66 has asked for the wisdom of the Perl Monks concerning the following question:
When I run this script I keep getting an compilation error. How can I trouble shoot? Thank you for help
#!/usr/bin/perl use strict; use warnings; @array = qw(one two three four five six seven eight nine ten); print "The original array contains - @array \n"; @sorted = sort {$a <=> $b} @array; print "The sorted array contains @sorted \n";
C:\JPARK\JPERL>test.pl Possible unintended interpolation of @array in string at C:\JPARK\JPERL\test.pl line 6. Possible unintended interpolation of @sorted in string at C:\JPARK\JPERL\test.pl line 9. Global symbol "@array" requires explicit package name at C:\JPARK\JPERL\test.pl line 5.. . . .
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Compilation error
by moritz (Cardinal) on Oct 09, 2012 at 16:11 UTC | |
by truthseeker66 (Novice) on Oct 09, 2012 at 16:30 UTC | |
by toolic (Bishop) on Oct 09, 2012 at 16:41 UTC | |
by truthseeker66 (Novice) on Oct 09, 2012 at 16:46 UTC | |
by kcott (Archbishop) on Oct 09, 2012 at 21:09 UTC | |
by Marshall (Canon) on Oct 09, 2012 at 21:11 UTC | |
|
Re: Compilation error
by Fletch (Bishop) on Oct 09, 2012 at 16:10 UTC | |
|
Re: Compilation error
by marquezc329 (Scribe) on Oct 09, 2012 at 18:18 UTC |