You might want to reconsider the substitutions that operate on $full_path. As they are now, ANY occurance of 'sub' or 'srt' in $full_path will be replaced with 'txt', not just the file extension (which I assume you are trying to do). If you want to replace only the extension, you could do something like:
$full_path =~ s/sub$/txt/i;
Alternatively, you could use the File::Basename and/or File::Spec modules to perform the path/filename operations for you (i.e., split off the suffix and create a path/filename for the new file).
In reply to Re: reading text from afile
by bobf
in thread reading text from afile
by fadingjava
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |