Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^6: Scope of $/

by NetWallah (Canon)
on May 26, 2016 at 05:51 UTC ( [id://1164159]=note: print w/replies, xml ) Need Help??


in reply to Re^5: Scope of $/
in thread Scope of $/

Actually, the OP's code:
while(<>){
DOES use the $/="\n\n\n".

My suggestion for the enclosing block is not strictly necessary for the posted code, but I think it is in good style, and enables protection in the event the program grows.

        This is not an optical illusion, it just looks like one.

Replies are listed 'Best First'.
Re^7: Scope of $/
by Laurent_R (Canon) on May 26, 2016 at 08:52 UTC
    ++. Not strictly necessary for the posted code, but certainly necessary in the real code in view of the original question about the redefinition of $/ affecting other parts of the program (including apparently other modules). So it is most probably more than just good style, it is very likely to be absolutely needed for avoiding side effects.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-18 22:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found