Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Re: Re: Re: DBI execute() args in array format (or similar) possible?

by dws (Chancellor)
on Aug 13, 2002 at 04:36 UTC ( [id://189709]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: DBI execute() args in array format (or similar) possible?
in thread DBI execute() args in array format (or similar) possible?

Brother snafu, I fear you have stumbled onto a series of incantions that appear to work, but that you still do not understand the underlying problem. Consider:   eval {join(',', @args), return(@args)} has the same affect as   eval {return(@args)} since the join() has no side-effect. In turn, these have the same effect as     eval {@args} and   @args

The execute() method wants distinct arguments ie execute(arg1,arg2,arg3) vs execute(qw(arg1,arg2,arg3)) which is the same, of course, as execute(@args).

if @args hold (1,2,3), then

  • execute(1,2,3);
  • execute(qw(1 2 3));
  • execute(@args)
are equivalent, but
  • execute(qw(1,2,3));
is not equivalent, since qw(1,2,3) is an list that contains a single element. It's the whitespace that's significant in qw(), not the commas.

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: DBI execute() args in array format (or similar) possible?
by snafu (Chaplain) on Aug 14, 2002 at 17:08 UTC
    Oops! Don't you hate it when you put something in your writeup that is a typo? Note the change I made to my post prior to your reply. I fixed my typo.

    Now, I absolutely agree with your statements. This is why I am so baffled by the situation and get this...it works now using the simple execute(@args) but I swear on everything I know that I did *not* make any changes to the code with the exception of changing to '@args' from the join() statement. However, that works now. It is all very strange and indeed I bet that I will stumble across this little phenomenon again somewhere. Maybe it was the command line args I was using *shrug*. If you read my other posts you will see that @args was most certainly giving off the correct number of elements (I pasted a few outputs where I was trying to show that...they are numbered elements).

    Anyway, I sincerely appreciate all of your comments.

    _ _ _ _ _ _ _ _ _ _
    - Jim
    Insert clever comment here...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-16 19:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found