Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: DBI Style Inquiry

by clueless newbie (Hermit)
on Jun 27, 2013 at 11:41 UTC ( #1040992=note: print w/ replies, xml ) Need Help??


in reply to DBI Style Inquiry

To quote "Perl Best Practices" - "Subroutines always receive their arguments in the @_ array. But accessing them via $_[0],$_1, etc. directly is almost always a Very Bad Idea." See page 178

Conway goes on to say "Moreover, it's easy to forget that each element of @_ is an alias for the original argument; that changing $_[0] changes the variable containing that argument."

So please unpack "@_" and "chomp" the copy. Who knows the calling code might need the trailing "$/"!


Comment on Re: DBI Style Inquiry
Re^2: DBI Style Inquiry
by perlfan (Curate) on Jun 27, 2013 at 14:03 UTC
    It would behoove the OP to get this book and use it hand in hand with Perl::Critic; In combination with Perl::Tidy, he may keep his OCD in check. Once he forms his own ways and opinions, he can start to customize both.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2015-07-02 03:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (27 votes), past polls