skyler has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks,
I don't know how to add an extension to a file that doesn't have one. I tried pattern matching but it doesn't do anything. Do you have any ideas?
For example:
"file1" needs to change to "file1.rtf"
$newfile =~ s/\^$/.rtf/;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How do you add .RTF to a file
by hmerrill (Friar) on Jun 05, 2003 at 13:54 UTC | |
Re: How do you add .RTF to a file
by hardburn (Abbot) on Jun 05, 2003 at 13:51 UTC | |
Re: How do you add .RTF to a file
by arthas (Hermit) on Jun 05, 2003 at 14:32 UTC | |
Re: How do you add .RTF to a file
by RollyGuy (Chaplain) on Jun 05, 2003 at 13:53 UTC | |
Re: How do you add .RTF to a file
by Missing Words (Scribe) on Jun 05, 2003 at 14:47 UTC | |
by Missing Words (Scribe) on Jun 05, 2003 at 14:50 UTC | |
Re: How do you add .RTF to a file
by jonnyfolk (Vicar) on Jun 05, 2003 at 14:00 UTC | |
Re: How do you add .RTF to a file
by young_david (Friar) on Jun 05, 2003 at 14:30 UTC | |
by young_david (Friar) on Jun 05, 2003 at 14:41 UTC |
Back to
Seekers of Perl Wisdom