While not exactly a Perl answer, my suggestion would be just to use the SQL command line to do a SELECT on the table(s) that you want, and send the output (suitably field and line-terminated) to an output file. Then just use scp or ftp to grab that output file.
--t. alex
Life is short: get busy!
| [reply] |
You could easily make use of the Net::Telnet->recv() subroutine here, it allows you to specify how many bytes you'd like to receive at a time like so:
$tel->recv($buffer, 512);
Would retrieve 512 bytes from the $tel object into the $buffer scalar.
If you were simply retrieving the data for storage, it'd be pretty simple to write something like this:
open(OUTPUT, '>output.file');
while($tel->recv($buffer, 512)) { print OUTPUT $buffer; }
close OUTPUT;
However, you noted that you'll be further editing the data before you're done with it, and also I get the sense that memory seems to be a primary concern in the issue.
One solution to this would be to use IO::File to create a temporary file to store the data in until you're done editing it:
my $output = IO::File->new_tmpfile();
while($tel->recv($buffer, 512)) { $output->print($buffer); }
Now, all of the output from your telnet session has been stored in the $output temporary file which you can use for further parsing and editing.
| [reply] [d/l] [select] |