Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

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.


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.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://154921]
Approved by root
[Eily]: nope, Nodelet Settings doesn't let you move the XP Nodelet, CSS might
[marinersk]: That would mitigate the distraction/jangle issue, but then the information wouldn't be easy to find when it is populated. Plus, I don't currently see a way to move it, but I'm not done poking around on that point yet.
[marinersk]: Ah, you beat me to it.

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2017-05-29 14:11 GMT
Find Nodes?
    Voting Booth?