Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
Problems? Is your data what you think it is?
 
PerlMonks  

A2P or not 2P

by bitman (Sexton)
on Mar 28, 2002 at 10:53 UTC ( #154921=perlquestion: print w/ replies, xml ) Need Help??
bitman has asked for the wisdom of the Perl Monks concerning the following question:

I converted an Awk to Perl and this line : inok = getline was converted to : $inok = ($_ = &Getline0(),$getline_ok); This appears to be the same as $_ = &Getline0; $inok = $getline_ok; or am I missing some hidden meaning?

Comment on A2P or not 2P
Re: A2P or not 2P
by Juerd (Abbot) on Mar 28, 2002 at 10:57 UTC

    $inok = ($_ = &Getline0(),$getline_ok); This appears to be the same as $_ = &Getline0; $inok = $getline_ok; or am I missing some hidden meaning?

    Your assumption is correct.

    In scalar context, a list with parens evaluates to the last element.

    U28geW91IGNhbiBhbGwgcm90MTMgY
    W5kIHBhY2soKS4gQnV0IGRvIHlvdS
    ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
    geW91IHNlZSBpdD8gIC0tIEp1ZXJk
    

Re: A2P or not 2P
by jmcnamara (Monsignor) on Mar 28, 2002 at 13:26 UTC

    You are right the two statements are equivalent.

    It may seem a little obfuscated but I guess the intention was to replace awk's "var = getline" with a single statement.

    --
    John.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2014-04-20 07:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls