gelbukh has asked for the wisdom of the Perl Monks concerning the following question:
But getting this error: Global symbol "$N" requires explicit package name (did you forget to declare "my $N"?) at code.pl line 12. syntax error at code.pl line 14, near "say" Execution of code.pl aborted due to compilation errors. What do I do wrong?#!perl use strict; use warnings; use 5.020; my @Org = (9, 1,0); my $N= #Org; say "N = $N"; say @Org;
Sorry for a stupid question! But I want to learn: 've seen this kind of error many times in my programs -- probably I'm missing something very basic.
Thank you! :)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Strange compile error?
by marto (Cardinal) on Apr 29, 2024 at 16:38 UTC | |
by LanX (Saint) on Apr 29, 2024 at 17:27 UTC | |
Re: Strange compile error?
by LanX (Saint) on Apr 29, 2024 at 17:20 UTC | |
Re: Strange compile error?
by hippo (Archbishop) on Apr 29, 2024 at 17:27 UTC | |
Re: Strange compile error?
by kcott (Archbishop) on Apr 29, 2024 at 18:11 UTC | |
by afoken (Chancellor) on Apr 30, 2024 at 13:46 UTC | |
by LanX (Saint) on Apr 30, 2024 at 22:43 UTC | |
by LanX (Saint) on Apr 29, 2024 at 19:47 UTC | |
by kcott (Archbishop) on Apr 29, 2024 at 23:08 UTC | |
by LanX (Saint) on Apr 30, 2024 at 00:19 UTC | |
Re: Strange compile error?
by gelbukh (Initiate) on Apr 29, 2024 at 20:03 UTC | |
by LanX (Saint) on Apr 29, 2024 at 20:26 UTC | |
by hippo (Archbishop) on Apr 29, 2024 at 22:03 UTC | |
Re: Strange compile error?
by 1nickt (Canon) on Apr 29, 2024 at 16:41 UTC |