Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: what does "use of uninitialized value" really mean?

by moritz (Cardinal)
on Jul 13, 2013 at 12:50 UTC ( #1044148=note: print w/ replies, xml ) Need Help??


in reply to what does "use of uninitialized value" really mean?

It means that a an array item you access has the value undef. This can occur for example if you index below the end of the array, or access an element that you never assigned to, or if the value that you assigned to it was simply undef.

Inspite of this i do get my expected output correctly.

If you use undef as a string, it acts like the empty string. If you use it as a number, it acts like 0 (except that it warns in both cases). So there are quite a few cases where the program works as it should, even though it emits those warnings.

But in the general case, the warning might be a hint towards a programming error.


Comment on Re: what does "use of uninitialized value" really mean?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2014-10-31 16:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (221 votes), past polls