Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

A2P or not 2P

by bitman (Beadle)
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?

Replies are listed 'Best First'.
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?
[ambrus]: 1nickg: obviously the gamers don't know. but anyway, I need the whole room backlit, because watching a monitor in a dark room (like many people do) is tiring for my eyes, even more so than doing it in a lit room.
[1nickt]: ambrus I agree. I suspect one's eyes are always trying to adjust across the boundary between very bright and very dark ... like a camera's autofocus struggling to choose the target.

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (12)
As of 2017-03-27 14:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (320 votes). Check out past polls.