Hi gang, I'm trying to automate some google analytics stuff here. For this request:
$req = $analytics->new_request( realtime => "true", ids => "ga:12345678", dimensions =>"rt:country,rt:city,rt:pagePath, rt:latitude, rt:longitude", metrics =>"rt:activeUsers", filters =>"rt:country==England", );
I'm using a database query to determine what the request parameters should be for this query. The multi line result set looks like

 select * from query_builder where query_no = 14; Result set of the query looks like
Record 1 realtime => "true", Record 2 ids => "ga:12345678", Record 3 dimensions =>"rt:country,rt:city,rt:pagePath,rt:latitude,rt:l +ongitude", Record 4 metrics =>"rt:activeUsers", Record 5 filters =>"rt:country==England",
Or to show it another way:
realtime => "true", ids => "ga:12345678", dimensions =>"rt:country,rt:city,rt:pagePath,rt:latitude,rt:longitude" +, metrics =>"rt:activeUsers", filters =>"rt:country==England",
So. If I created a string along the lines of
$qry_str = 'realtime => "true", ids => "ga:12345678", dimensions =>"rt:country,rt:city,rt:pagePath,rt:latitude,rt:longitude +", metrics =>"rt:activeUsers", filters =>"rt:country==England",';
(in reality it's
while ( @row = $sth->fetchrow_array() ) { $qry_str .= $row[0]; }
)
How can I do a
$req = $analytics->new_request( $qry_str );
Any thoughts?

In reply to Passing API params via string by Laurielounge

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.