in reply to Re^2: Any idea what this does
in thread Any idea what this does
I would probably do this:
, even though your for&if does the same thing as my if&grep.my $has_unprintable_re = qr{ [^[:print:]] }x; if ( grep { /$has_unprintable_re/ } @{$memoryfile}[0,1] ) { LogMess( 'Error: Binary input data detected', 1 ); return -1; }
My first reading of your code made me say "Hmmm, it could print the error twice... {Re-reading} Oh, wait, the LogMess and the return are in the same statement, and the return will (of course) exit the loop."
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Any idea what this does
by blazar (Canon) on May 29, 2007 at 16:13 UTC |