in reply to Strange compile error?

Others already told you how to do right...

... But you asked:

> What do I do wrong?

Point is, that # "normally" starts a comment, and you wrote

my $N= #Org; say "N = $N";

So what the compiler effectively sees is a multiline statement, semantically equal to

my $N= say "N = $N";

The declaration my $N at the beginning only takes effect after this statement, i.e. behind the semicolon.

Hence, the second $N is undeclared.

Hope the error messages are clearer now. :)

Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery