⭐ in reply to How can I split a string into fixed-length parts, rather than on delimiters?
unpack is arguably more appropriate than a regex:
my $fname = '41084109.udp'; my( $v1, $v2 ) = unpack( 'a4 a4', $fname ); [download]