#perl pattern matching example, reference sub-pattern outside regex $n
$_ = 'The room was full of boxes and bins.';
/([a-z]oxes) and (bins)\./;
#the whole matched pattern
print $&;
#the matched pattern by 1st () 
print "\n";
print $1;
print "\n";
#the pattern matched by 2nd ()
print $2;
