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

Re: Unable to INSERT dereferenced values into db

by Stevie-O (Friar)
on May 25, 2004 at 03:18 UTC ( #356106=note: print w/replies, xml ) Need Help??


in reply to Unable to INSERT dereferenced values into db

First: Actually, you ARE returning an array. Lists are only transient things that exist in expressions. If you can take a reference to it, it's an array.

With that out of the way: That's not how you access array elements, and I think that'll give you a warning about single-element array slicing. There are two ways you can do your array:

$sth->execute( $ref->[0], $ref->[1], $ref->[2], $ref->[3]) ;
or slightly easier
$sth->execute( @$ref );
Try those.
--Stevie-O
$"=$,,$_=q>|\p4<6 8p<M/_|<('=> .q>.<4-KI<l|2$<6%s!<qn#F<>;$, .=pack'N*',"@{[unpack'C*',$_] }"for split/</;$_=$,,y[A-Z a-z] {}cd;print lc

Replies are listed 'Best First'.
Re: Re: Unable to INSERT dereferenced values into db
by Mr. Muskrat (Canon) on May 25, 2004 at 11:59 UTC

    TMTTWTDI (There's More Than Two Ways To Do It), this is Perl after all.

    <pedantic>You forgot about $sth->execute($$ref[0], $$ref[1], $$ref[2], $$ref[3]); and what about ...</pedantic>

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://356106]
help
Chatterbox?
Discipulus go to his cell to bookmark this
[haukex]: Well to be honest I just did a super search for "every should know floating" ;-)
[Discipulus]: floating was the keyword and.. to use supersearch is plus sign not a (plus) sin

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2017-06-26 20:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (594 votes). Check out past polls.