Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Learning Perl' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Learning Perl
Authored by: Anonymous on May 10, '01 06:39:11AM

Of course the point of the advanced rename (thank you) is that it lets you check before committing, but just to be perlsnickety, with 's/.jpeg/.jpg/' you would get:

hajjpeg ==> hajjpg

(because the . matches anything; use a backslash before the . to match just a period.)



[ Reply to This | # ]
Learning Perl
Authored by: robh on May 10, '01 07:09:55AM

You're right. There are various workarounds, if I was worried about mismatches I'd use 's/\.jpg$/.jpeg/'

I avoided the '\'; in my earlier example because the forum software here keeps eating escape characters after doing a preview of the comment. I hope they're intact here :-)



[ Reply to This | # ]