--- Ron Newman <[EMAIL PROTECTED]> wrote:
>
> I don't know if either of these really address the performance issue,
> but ...
>
> > $REC="";
> > $REC=<CXIBIO>;
>
> the first assignment serves no purpose since you are immediately
> overwriting it.
agreed, but its effect would be minuscule.
>
> > # Contruct Host Response String
> > $RECIN="$RECIN"."$REC";
>
> Would the Perl compiler generate better code for
>
> $RECIN .= $REC
I think both of these will end up doing many malloc() and string copies as you
add to the end of the concatenated string, which will indeed be very slow.
How about...
my @t = ();
EP0000: while (1) {
$REC=<CXIBIO>;
# Bypass ALL Returned Records until "Beginning of Data Sequence"
if ( $REC =~ m/[EMAIL PROTECTED]/) { next EP0000; }
# Exit if Last Record Signal
if ( $REC =~ m/^0999/) { last EP0000; }
push @t, $REC;
}
$RECIN = join('', @t);
print "$RECIN\n";
close(CXIBIO);
HTH
-Simon
>
> ?
>
> _______________________________________________
> Boston-pm mailing list
> [EMAIL PROTECTED]
> http://mail.pm.org/mailman/listinfo/boston-pm
_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm