Now the guys have explained why your code is failing, you might also consider using:
my $shop = m/.{8}(\d{4})/ ? $1 : '0000';
or if you have an aversion to the ternary operator
my $shop = '0000'; $shop = $1 if $AResp =~ /.{8}(\d{4})/;
In reply to Re: checking substring for numbers
by BrowserUk
in thread checking substring for numbers
by dwatson06
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |