in reply to Re: Example of push
in thread Example of push

Expanding a bit on what robartes said, using a precompiled regular expression (qr//) might speed up the iterative loop. Because $_ is changing through each iteration of the loop:
$error=~/$_/
/$_/ must be re-compiled each time the value of $_ changes. Though this won't matter much in this instance, because of the relatively few number of iterations, a better way to do this would be to change the contents of @regex from:
my @regex=('\bcannot verify', '\bcorrupt file', '\bskipped', );
to:
my @regex=( qr/\bcannot verify/, qr/\bcorrupt file/, qr/\bskipped/, );
or even:
my @regex = map qr/$_/, ( '\bcannot verify', '\bcorrupt file', '\bskipped', );