in reply to Simple line regex again

I think it would work if the regex was matching, but it's not.
what's the observed behavior?

At a glance, i suspect that your first capture should be (\w+) instead of a single character.

Also, you _must_ check if the pattern matched or not ..
$line =~ m/ ... /i or next; $line =~ m/ ... /i or die "line '$line' failed to match"; $line =~ m/ ... /i or do { # log it somewhere next; };

Probably also want to -d $1 || mkdir $1; to make sure the directory exists.