Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Autovivification not working?

by MZSanford (Curate)
on Dec 20, 2001 at 14:47 UTC ( [id://133445]=note: print w/replies, xml ) Need Help??


in reply to Autovivification not working?

I believe this message is cause by the warning's pragma (-w), to alert you to the printing of an undefined value, not the returning of one. To test this thoery, i used the following :
#!/usr/bin/perl -wl use strict; my $hashref = { foo => { bar => 'xyzzy' } }; sub name_me { # Note: there is no $hashref->{foo}{foo} return \ $hashref->{foo}{foo}; } $a = name_me(); print $a; print $$a; print ${ name_me() }

This, on my machine, prints the following :
SCALAR(0x184068) Use of uninitialized value in print at bar.pl line 15. Use of uninitialized value in print at bar.pl line 17.

$ perl -e 'do() || ! do() ;' Undefined subroutine &main::try

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (1)
As of 2024-04-24 15:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found