- or download this
# Rejected possibility one:
substr( $string, 0, length( $string ) / 2 ) =~ m/pattern/;
...
# Rejected possibility two:
my $half = length( $string ) / 2;
$string =~ m/pattern.{$half}/s;
- or download this
use strict; # Because you should.
use warnings; # Because you want to.
...
0000012300
0000001230
0000000123
- or download this
1230000000 matched.
0123000000 matched.
...
0000012300 didn't match.
0000001230 didn't match.
0000000123 didn't match.
- or download this
use strict;
use warnings;
...
0000012300
0000001230
0000000123