in reply to Regex 'If Not Match'

if($reference !~ m/38[0-9]{8}[A-Z]{3}/){ ... }
You may want to read perlre.