Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: On bad habits

by trammell (Priest)
on Jun 21, 2005 at 14:33 UTC ( [id://468691]=note: print w/replies, xml ) Need Help??


in reply to On bad habits

These days I find myself using the "-l" perl option a lot, and I rarely need to put explicit "\n"'s in my code (maybe for printf). A nice bit of laziness/DWIMery. Perhaps that would help you break your habit.

Update: Thanks, !1, I didn't know that, but it makes abundant sense. I suppose I've never run into it before because I don't use a lot of modules that have their own file IO.

Replies are listed 'Best First'.
Re^2: On bad habits
by !1 (Hermit) on Jun 21, 2005 at 16:10 UTC

    Use it only if you aren't using modules which are expected to manipulate files. I learned this the hard way when I wrote a throwaway script that used Archive::Zip and couldn't figure out why it wouldn't create a valid zip.

Re^2: On bad habits
by DrHyde (Prior) on Jun 22, 2005 at 07:35 UTC
    How does use of -l affect modules which aren't expecting it? The docs indicate that they will double-space anything they print.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-25 23:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found