On Mar 22, John W. Krahn ([EMAIL PROTECTED]) typed:

> $ perl -e'
> my @files = qw[ filename.jpg.pgp filename.2.jpg.pgp file....._.jpg.pgp ];
> for my $file ( @files ) {
>     print "$file --> ";
>     $file =~ s/\.(?=.*\.)/_/g;
>     print "$file\n";
>     }
> '
> filename.jpg.pgp --> filename_jpg.pgp
> filename.2.jpg.pgp --> filename_2_jpg.pgp
> file....._.jpg.pgp --> file_______jpg.pgp




On Mar 22, Tom Phoenix ([EMAIL PROTECTED]) typed:

> There are many ways to do this; here's the first one I thought of,
> using a lookahead assertion to see that there's another dot remaining:
>
>     s/\.(?=.*\.)/_/gs




Thanks a lot Tom and John!  Works.  :)





Thanks
 Birl

Please do not CC me responses to my own posts.
I'll read the responses on the list.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to