Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: How should I read print .. if .. and ?

by higle (Chaplain)
on Aug 19, 2002 at 19:11 UTC ( [id://191286]=note: print w/replies, xml ) Need Help??


in reply to How should I read print .. if .. and ?

Basically, it's Perl shorthand for this:
if ($rows++ and $lsep) { print $fh $lsep; }
Meaning, if the two conditions are true, print $fh and $lsep print $lsep to filehandle $fh.

  higle

Update: Doh! Wasn't paying attention at all ($fh should have tipped me that it was a filehandle :c\). Thanks for the correction, RMGir!

Replies are listed 'Best First'.
Re: Re: How should I read print .. if .. and ?
by RMGir (Prior) on Aug 19, 2002 at 19:14 UTC
    ...print $fh and $lsep.

    Close. It means print $lsep to the file pointed to by filehandle $fh.

    Printing $fh and $lsep would be:

    print $fh, $lsep; # note the comma!

    --
    Mike

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (1)
As of 2024-04-25 01:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found