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

Re: On bad habits

by trammell (Priest)
on Jun 21, 2005 at 14:33 UTC ( #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? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (None)
    As of 2021-10-21 03:03 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      My first memorable Perl project was:







      Results (82 votes). Check out past polls.

      Notices?