Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Using ternary operator as lvalue in push

by Roy Johnson (Monsignor)
on Jul 31, 2007 at 16:39 UTC ( [id://629865]=note: print w/replies, xml ) Need Help??


in reply to Using ternary operator as lvalue in push

push is effectively prototyped, so it needs to see that array sigil on its first operand.

Caution: Contents may have been coded under pressure.

Replies are listed 'Best First'.
Re^2: Using ternary operator as lvalue in push
by ikegami (Patriarch) on Jul 31, 2007 at 16:50 UTC
    Is it done this way to allow the prototype to be checked at compile time?
    >perl -c -e"sub t(\@) { @{$_[0]} = '!' } t($c?@a:@b); print @b; Type of arg 1 to main::t must be array (not null operation) at -e line + 1, near "@b)" -e had compilation errors.

Log In?
Username:
Password:

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

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

    No recent polls found