in reply to max string len

This fails to print out the entire file... I managed to exclude perl:dbi from the problem.
open(SQL, "$filepath") || die "Cannot open file $filepath: $!"; @lines =<SQL>; for($ii=0; $ii < @lines; $ii++) { $command_str = $command_str . $lines[$ii]; } print $command_str; print "\n";

Replies are listed 'Best First'.
Re^2: max string len
by cowboy (Friar) on Feb 04, 2005 at 23:23 UTC
    Seeing your example here, I imagine you want something like this:
    my $command_str = join('', <SQL>); printf("%s\n", $command_str);
Re^2: max string len
by Errto (Vicar) on Feb 05, 2005 at 00:28 UTC
    Using concatenation like that is a very inefficient way to build a string. cowboy's suggestion is fine, or you could also replace everything from @lines = <SQL> on down with
    { local $/; $command_str = <SQL>; }
    and don't bother with @lines.
Re^2: max string len
by Animator (Hermit) on Feb 05, 2005 at 15:41 UTC
    Maybe your DATA in the file has carraige returns in it.

    Try removing them? or try replacing all carriage returns

    And another suggestion, maybe you can tell what exactly isn't showing. You said 'fails to print out the entire file' then how much data is it printing?