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

Re: Best way to call DBI query

by MZSanford (Curate)
on Mar 14, 2002 at 14:43 UTC ( #151681=note: print w/ replies, xml ) Need Help??


in reply to Best way to call DBI query

I believe this is because shift() is diffrent than shift. Calling shift() i believe forces shift to be called with no arguments, rather than with @_ as is done when called without parens.

Reference : Programming Perl, 3rd Edition -- Chapter 6 -- Page 218


from the frivolous to the serious


Comment on Re: Best way to call DBI query
Select or Download Code
Replies are listed 'Best First'.
Re: Re: Best way to call DBI query
by strat (Canon) on Mar 14, 2002 at 14:52 UTC
    >I believe this is because shift() is diffrent than shift. Calling shift() i believe forces shift to be called with no arguments, rather than with @_ as is done when called without parens.

    If you are right, why does the following work correctly:

    sub AnySub { my @list = @{ shift() }; # automatic dereferencing list ...

    Best regards,
    perl -le "s==*F=e=>y~\*martinF~stronat~=>s~[^\w]~~g=>chop,print"

      In that case, i stand (well, sit actually), corrected. Was worth a shot.
      As a side comment, i assume something is assigning a database handle to the $self object, and that $self has a param() method which returns that value. You probably shoud be checking defined($dbh) to make sure the Database connection was successful, and that nothing has gone wrong to this point.
      from the frivolous to the serious

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (17)
As of 2015-07-31 17:57 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 (279 votes), past polls