Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Replacing a list with one variable

by hdb (Prior)
on Nov 21, 2013 at 10:14 UTC ( #1063707=note: print w/ replies, xml ) Need Help??


in reply to Replacing a list with one variable

It seems that the IDs parameter requires a reference to an array so you need to split your string $bookIDList into an array, the brackets will then turn that into a reference:

my $bookIDList = "abc,ghj,zxc,bnm,qwe,rty,iop,sdf,ert"; my $param = { IDs => [ split /,/, $bookIDList ], sort => "AUTHOR", maxResults => 100 };

or you build a list in the first place and feed a reference to that list:

my @bookIDList = ( "abc", "ghj", "zxc", "bnm", "qwe", "rty", "iop", "s +df", "ert" ); my $param = { IDs => \@bookIDList, sort => "AUTHOR", maxResults => 100 };


Comment on Re: Replacing a list with one variable
Select or Download Code
Re^2: Replacing a list with one variable
by Anonymous Monk on Nov 21, 2013 at 10:25 UTC

    Brilliant, that worked.
    Thank you

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2015-07-03 22:10 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 (57 votes), past polls