my $string = 'this is a test /test123?'; my ($before,$after) = split qr!/!, $string; chop $after; warn $after;