Using your code: my $digit_width = 4; # This isnt necessarily true every time my $min = 1; my $max = 12; my $prefix = "test_"; my $ext = ".txt"; while ( my $file = readdir DIR ) { next unless ( $file =~ /^ $prefix (\d{$digit_width}) $ext $/x ); if ( $1 >= $min and $1 <= $max ) { # we have a match... now now we want to create the new file na +me # Whatever $SetName was so if $SetName = "Chapter \1" which me +ans # The new file name for the program to modify in the directory + is # to "Chapter 01.txt" for the 1st chapter file which wouldve b +een # Test_001.txt in the directory it searched in. I will then # have the code rename the file. } }
In reply to Re^2: Help with my rookie logic
by rookie_monk
in thread Help with my rookie logic
by rookie_monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |