Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^4: Use of uninitialised value... but it is defined ?!

by Eily (Monsignor)
on Mar 02, 2016 at 08:28 UTC ( [id://1156625]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Use of uninitialised value... but it is defined ?!
in thread Use of uninitialised value... but it is defined ?!

Not really, you can set a variable's value with arbitrary code, so it's rather consistent of perl to never run it. For example if you had :

my $first = 1; my @second = grep { ($_+1) % 2 } map { $_ ** 3 } 1..12; my %third = some_function();
Perl could easily apply the first assignment during compilation, you would kind of expect the second to be run at run time, and the third assignment might either fail or yield the wrong data depending on whether a definition and redefinition of some_function have been seen at that point.

But perl knowing about the structure of the code (eg. lexicals in a given scope) at compile time is kind of the point.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1156625]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-25 09:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found