From: Shmuel Metz on
In <sKqdnZZvCsoCDGTWnZ2dnUVZ8qmdnZ2d(a)bt.com>, on 05/23/2010
at 09:35 PM, RedGrittyBrick <RedGrittyBrick(a)SpamWeary.invalid>
said:

>So far as I can see:

>Part of "the perl distribution" - No.

Yes.

>The rename/prename script

It's not a script. Look at perlfunc.

>is not listed at http://perldoc.perl.org/index-utilities.html

Because it's a built-in function and thus doesn't belong there. Look
at <http://perldoc.perl.org/index-functions.html> instead.

--
Shmuel (Seymour J.) Metz, SysProg and JOAT <http://patriot.net/~shmuel>

Unsolicited bulk E-mail subject to legal action. I reserve the
right to publicly post or ridicule any abusive E-mail. Reply to
domain Patriot dot net user shmuel+news to contact me. Do not
reply to spamtrap(a)library.lspace.org

From: Martijn Lievaart on
On Sun, 23 May 2010 18:39:12 -0700, Xho Jingleheimerschmidt wrote:

> Tad McClellan wrote:
>> James Egan <jegan473(a)comcast.net> wrote:
>>
>>> I'm trying to use the perl "rename" script to rename batches of files.
>>
>>
>> What is "the perl rename script"?
>>
>> I have never heard of it.
>
> I was quite surprised to find it on my Asus Linux machine, as I am used
> to 'rename' being a binary which does fixed string substitutions.


Clearly depends on your distro:

[martijn(a)cow ~]$ which rename
/usr/bin/rename
[martijn(a)cow ~]$ file $(which rename)
/usr/bin/rename: ELF 32-bit LSB executable, Intel 80386, version 1
(SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18,
stripped
[martijn(a)cow ~]$

M4
From: Peter J. Holzer on
On 2010-05-24 02:49, Shmuel Metz <spamtrap(a)library.lspace.org.invalid> wrote:
> In <sKqdnZZvCsoCDGTWnZ2dnUVZ8qmdnZ2d(a)bt.com>, on 05/23/2010
> at 09:35 PM, RedGrittyBrick <RedGrittyBrick(a)SpamWeary.invalid>
> said:
>
>>So far as I can see:
>
>>Part of "the perl distribution" - No.
>
> Yes.
>
>>The rename/prename script
>
> It's not a script. Look at perlfunc.

Yes, it is:

% file /usr/bin/rename
/usr/bin/rename: symbolic link to `/etc/alternatives/rename'
% file /etc/alternatives/rename
/etc/alternatives/rename: symbolic link to `/usr/bin/prename'
% file /usr/bin/prename
/usr/bin/prename: a /usr/bin/perl -w script text executable

So it is a script on Debian systems (as RedGrittyBrick wrote) and it is
part of the "perl" package:

% dpkg -S /usr/bin/prename
perl: /usr/bin/prename

Also as RedGrittyBrick wrote, it isn't part of the perl distribution,
but was added by Debian. I don't know why, but from the changelog I can
guess that perl 5.005 included rename as an example script, which was
included in the perl package, later replaced by an updated script, and
the updated is still provided by the perl package even though the
example script has been removed from the perl distribution.

hp

From: RedGrittyBrick on
On 24/05/2010 00:04, Ilya Zakharevich wrote:
> On 2010-05-23, RedGrittyBrick<RedGrittyBrick(a)SpamWeary.invalid> wrote:
>>>> What is "the perl rename script"?
>
>>>> I have never heard of it.
>
>>> It's part of the perl distribution, and is actually a symlink to prename:
>
>> So far as I can see:
>>
>> Part of "the perl distribution" - No.
>>
>> Part of Debian's "perl" package - Yes.
>>
>> The rename/prename script is not listed at
>> http://perldoc.perl.org/index-utilities.html which is part of "the
>> official documentation from the Perl distribution(s)".
>
> Some people know how to look, some do not:

This is true, I'm always happy to learn.

>
> K:\get-perl\perl>ls perl5.005_03/eg
> ADB client findtar myrup rmfrom sysvipc van
> README down g nih scan travesty who
> cgi dus muck relink server unuc wrapsuid
> changes findcp muck.man rename shmkill uudecode

On my PC there's no rename script with Activestate perl v5.10.0, not in
the eg subdirectory nor anywhere else in the directory where perl is
installed.

I can't find it on my elderly Linux server either (find / -name rename).
It has perl 5.8.0 from a RedHat RPM package.

Maybe rename was removed from perl's examples sometime after perl 5.005?


>
> Hope this helps,

Not as much as I initially thought it would, but thanks.

--
RGB
From: Ilya Zakharevich on
On 2010-05-24, RedGrittyBrick <RedGrittyBrick(a)spamweary.invalid> wrote:
>> Some people know how to look, some do not:
>
> This is true, I'm always happy to learn.

Unfortunately, there is nothing specific to learn in this example.
Just the luck of "being at the precise spot at the precise time"
(like some kinds of photography! Well, in photography, some people
repeat such luck again and again...)

>> K:\get-perl\perl>ls perl5.005_03/eg
>> ADB client findtar myrup rmfrom sysvipc van
>> README down g nih scan travesty who
>> cgi dus muck relink server unuc wrapsuid
>> changes findcp muck.man rename shmkill uudecode

> Maybe rename was removed from perl's examples sometime after perl 5.005?

Definitely. This is the latest version on my disk which still has it.

Hope this helps,
Ilya