in reply to Global Symbol issue while using arrays

Since you are using 5.10.1, you can replace the three lines
use 5.10.1; use strict; use warnings;
with Modern::Perl like this:
#!/usr/bin/perl use Modern::Perl; my(@wt) = (1,2,3,4); print $wt[2], "\n";

Replies are listed 'Best First'.
Re^2: Global Symbol issue while using arrays
by prasaduco (Initiate) on Jun 07, 2011 at 06:46 UTC

    Hi Khen, thanks for the reply. I did what you told me and I got this:

    C:\strawberry\perl\programs>perl pArraym.plx Can't locate Modern/Perl.pm in @INC (@INC contains: C:/strawberry/perl +/lib C:/st rawberry/perl/site/lib C:\strawberry\perl\vendor\lib .) at pArraym.plx + line 4. BEGIN failed--compilation aborted at pArraym.plx line 4.
      diagnostics/splain
      Can't locate Modern/Perl.pm in @INC (@INC contains: C:/strawberry/perl +/lib C:/strawberry/perl/site/lib C:\strawberry\perl\vendor\lib .) a +t pArraym.plx line 4 (#1) (F) You said to do (or require, or use) a file that couldn't be found. Perl looks for the file in all the locations mentioned in @ +INC, unless the file name included the full path to the file. Perhaps +you need to set the PERL5LIB or PERL5OPT environment variable to say w +here the extra library is, or maybe the script needs to add the library + name to @INC. Or maybe you just misspelled the name of the file. See perlfunc/require and lib. BEGIN failed--compilation aborted at pArraym.plx line 4 (#2) (F) An untrapped exception was raised while executing a BEGIN subroutine. Compilation stops immediately and the interpreter is exited.
      Maybe you wish to install Modern::Perl, or ignore Khen1950fx and stick with what you have.