> 
> Hello,
> 
> I would like to swap the file name only and not the extension or the
> content. 
> 
> Example:
> There are two file : 1.jpg and 3.jpg 
> output = 1.jpg becomes 3.jpg and 3.jpg becomes 1.jpg
> 
> OR
> 
> 1.jpg and 3.gif
> output  = 1.jpg becomes 3.jpg and 3.gif becomes 1.gif
> here we are changing the name only and not the extension.
> 
> Inside my program I don't know either files extension, but they will
be only
> "jpg or gif"
> 
> Any help...
> 
> 
> 

Scrap the shelling out to 'mv' use Perl's builtin 'rename' instead...

perldoc -f rename

http://danconia.org



-- 
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