in reply to Re: Reading part of a file name
in thread Reading part of a file name

You have used the pattern /./ on which to split the string. '.' is a regular expression metacharacter which matches any single character (except the newline in multi-line matching) so your split isn't doing what you want. You should have escaped the metacharacter like this

my ($filename, $code_number) = split(/\./, $_, 2);

so that you are splitting on a literal full-stop.

Also, your

next if ( $_ eq '..' ); next if ( $_ eq '.' );

can be more neatly achieved by

next if /^\.\.?$/;

Cheers,

JohnGG