Hello Monks! I've just started learning perl yesterday so this is probably newbie question. I'm trying to run the following basic code on Cygwin but it gives me errors.
#!C:\strawberry\perl\bin\perl use strict; use warnings; print "Array Sample \n" my @arrayone = ("String :","Hello","Number :",555); print "$arrayone[0] $arrayone[1]\n"; print "$arrayone[2] $arrayone[3] \n";
This is the error I get
syntax error at testarray.pl line 7, near "my " Global symbol "@arrayone" requires explicit package name at testarray. +pl line 7. Global symbol "@arrayone" requires explicit package name at testarray. +pl line 8. Global symbol "@arrayone" requires explicit package name at testarray. +pl line 8. Global symbol "@arrayone" requires explicit package name at testarray. +pl line 9. Global symbol "@arrayone" requires explicit package name at testarray. +pl line 9. Execution of testarray.pl aborted due to compilation errors.
This works perfectly on my friend's Ubuntu but don't know why am I getting this error on Cygwin.
Ubuntu Virtual OS is very very slow on my Windows 7 so had to go with Cygwin.
Please guide me through if this isn't correct section to post ! Thank you!
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |