Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: junior application developer

by lloder174 (Novice)
on Apr 29, 2009 at 22:06 UTC ( [id://760992]=note: print w/replies, xml ) Need Help??


in reply to Re: junior application developer
in thread code file refactoring to use English module as per PBP

Thanks, johngg. This unfortunately does not help because of my wanting to avoid the command line and I also want to adhere to Perl Best Practices, (PBP)! I have changed the $INPUT_RECORD_SEPARATOR to undefined on purpose so that I may slurp in an entire file at a time, because this code is a small part of a script and this is more efficient than rewriting the file a line at a time. If you'll notice, I am using the English module within this code and I originally used ${^MATCH}, (which requires the /p expression modifier), instead of $1 but it also did not work! Help still needed! P.S. My apologies for a mistakenly created subject line which does not really help!

Replies are listed 'Best First'.
Re^3: junior application developer
by whakka (Hermit) on Apr 30, 2009 at 01:52 UTC
    You shouldn't need to use PBP for one-liners - that defeats the point. And if you're so worried about it, shouldn't you also be using strict and warnings? In that case, you would see the compilation error

    Bareword "no_match_vars" not allowed while "strict subs" in use at ...

    promptly fix it with use English qw( -no_match_vars ) and be on your merry way. :)

    Update - added the qw (thanks moritz).

Re^3: junior application developer
by AnomalousMonk (Archbishop) on Apr 29, 2009 at 23:06 UTC
    junior application developer
    lloder174: You can go back and Update the title of your post (making a note that you have done so), and you can at the same time fix the problem that your code does not have a valid  </code> end tag, which renders it almost unreadable.

    johngg: I believe the  //p regex modifier is new with 5.10: see p in perlre.

      Thank you for that pointer, I'm still mostly using 5.8.x on Solaris boxes so I hadn't encountered it before. I wish that O'Reilly would do an update of the Camel book for 5.10!

      Cheers,

      JohnGG

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-03-19 07:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found