Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: How do you add .RTF to a file

by young_david (Friar)
on Jun 05, 2003 at 14:30 UTC ( #263343=note: print w/replies, xml ) Need Help??


in reply to How do you add .RTF to a file

If you wanted to do pattern matching:

my $oldfile = 'file1'; my $newfile =~ s/$/.rtf/; # Search for the end of a string and # replace it with the extension

Replies are listed 'Best First'.
Re: Re: How do you add .RTF to a file
by young_david (Friar) on Jun 05, 2003 at 14:41 UTC
    UPDATE: Sorry, I just realized I made a mistake, should have written like this:
    my $file = 'file1'; $file =~ s/$/.rtf/; # $file will now contain the .rtf extension

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://263343]
help
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2023-02-02 17:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (20 votes). Check out past polls.

    Notices?