in reply to How to download data from a table in Sybase and save the data in text file format using Perl?

Well, if you are just saving to a text file, why do you have those header() function calls at the beginning? Is it for a web page?

That said, I would definitely change this:

$str = $ctr .= $tb .= $total .= $tb .= $sensible .= $tb .= $model .= $ +nl;

to this:

$str=join($tb,$ctr,$total,$sensible,$model).$nl;

Or you could get rid of the possibly unnecessary variables and do this:

$str=join("\t",$ctr,$total,$sensible,$model)."\n";
  • Comment on Re: How to download data from a table in Sybase and save the data in text file format using Perl?
  • Select or Download Code

Replies are listed 'Best First'.
Re: Re: How to download data from a table in Sybase and save the data in text file format using Perl?
by rcsyee (Initiate) on Jun 11, 2001 at 06:24 UTC
    actually the header function is sth i saw in PHP...like this:
    if ($viewreport == "Download") { header( "Content-type: application/x-something" ); header( "Content-Disposition: attachment; filename=$type.txt" ); header( "Content-Description: PHP3 Generated Data" );
    these codes will cause the WIN98 Save As window pops out and i will be able to save the downloaded data as text files..but how can i do this using Perl? }