Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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 perusing the Monastery: (3)
As of 2014-09-20 21:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (163 votes), past polls