Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Autovivification of scalars in sub calls

by japhy (Canon)
on Dec 08, 2005 at 01:14 UTC ( [id://515099]=note: print w/replies, xml ) Need Help??


in reply to Autovivification of scalars in sub calls

Um, qw( @$x ) is not a "builtin function". It's the single quoted string '@$x'.

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart

Replies are listed 'Best First'.
Re^2: Autovivification of scalars in sub calls
by friedo (Prior) on Dec 08, 2005 at 01:38 UTC
    True, although an example with print demonstrates the behavior to which tlm was referring:

    perl -Mstrict -le 'my $x; print @$x' Can't use an undefined value as an ARRAY reference at -e line 1. perl -Mstrict -le 'my $x; sub { }->( @$x ); print @$x' (No error generated)

Log In?
Username:
Password:

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

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

    No recent polls found