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

Re: Odd file rename

by lhoward (Vicar)
on Jun 14, 2000 at 16:27 UTC ( #18079=note: print w/replies, xml ) Need Help??


in reply to Odd file rename

Just use a regular expression to modify the first character.
my $oldfilename='Testfile'; my $newfilename=$oldfilename; $newfilename=~s/^./B/; # # another option instead of the regular expression would # be to assign to a substr... This will probably be slightly # faster # # substr($newfilename,0,1)='B'; # link $oldfilename, $newfilename or die "link error $!"; unlink $oldfilename or die "unlink error $!";
note the "link/unlink" that I do will not work under NT

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2021-05-11 00:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (111 votes). Check out past polls.

    Notices?