If $sourcefile =~ /.../ does not match then $1 will contain whatever the last successful match captured. This is a bug in your program. You must test the result of the match for success and only then use $1 otherwise bail or use a sane default.
my $newfile = ( $sourcefile =~ /...(...).../i ? $1 : 'somedefault' );
In reply to Re: Insecure dependency error and $ENV{'PATH'}
by diotalevi
in thread Insecure dependency error and $ENV{'PATH'}
by bradcathey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |