Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

I'm not really trying to print, I was just using that as an example. I apologize for not being specific enough. My code is below and I'm basically opening a file and storing it into an array. I then take the first column and query our Quickbase database to return the primary key, then I map that primary key to @data and import back into Quickbase.

The problem is I can only do the gen_results_table call for a 100 stores at a time, so I have to run that gen_results_table statement once for every 100 stores.

#!/usr/bin/perl require 'c:/';#REF Perl SDK use LWP; my $url = ""; my $ua = LWP::UserAgent->new(); $ua->proxy(['http'],''); $ua->credentials($netloc, $realm, $uname, $pass); my $response = $ua->get($url); open (FILE, ">C:\\snow.txt") || die "Can't open Snow.txt $!\n"; print FILE $response->content; close(FILE); open (FILE, "<C:\\snow.txt") || die "Can't open Snow.txt $!\n"; my $column=0; while ($line = <FILE>){ chomp($line); push @data, [split /\t/,$line]; } close(FILE); @column = map {$$_[0]} @data; shift(@column); $stores = join( ' OR ',@column); my $qdb = HTTP::QuickBase->new(); $qdb->proxy(''); $qdb->url_prefix(""); $qdb->authenticate("MyUserName","MyPass"); $qdb->apptoken('bj6azdybdeg8akbcu5ggabfdedsi'); my $recid=$qdb->gen_results_table("babvce7n4",{query=>"{'6'.EX.$stores +}",clist=>"3",options=>"csv"}); my @recids = split /\n|\r\n/,$recid; my $i = 0; @data = map{unshift(@{$_},$recids[$i++]);$_} @data; $a = join( "\n", map {join(',',@{$_})} @data); my $import = $qdb->import_from_csv("bhabcde7f",$a," +.","1");

Keep in mind I am new to Perl

In reply to Re^2: While Loops by Anonymous Monk
in thread While Loops by Anonymous Monk

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others avoiding work at the Monastery: (7)
    As of 2015-11-30 11:41 GMT
    Find Nodes?
      Voting Booth?

      What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

      Results (769 votes), past polls