Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Regex To Remove File Extension

by grep (Monsignor)
on Dec 10, 2008 at 21:09 UTC ( #729507=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    index.html
    foo.pl
    CGI.pm
    video.mpeg
    foo.pl~
    
  2. or download this
    .foo
    .bar
    
  3. or download this
    my @names = qw/ index.html foo.pl CGI.pm video.mpeg foo.pl~ .bash_hist
    +ory .bash_rc /;
    foreach my $string ( @names ) {
    ...
        $string =~ s/(.+)\.[^.]+$/$1/;
        print "$string\n";
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2014-10-21 00:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (94 votes), past polls