This is very confusing to new users so I do not believe it would hurt to have some more information for those looking to learn more about Linux and how it works. Thank you @haertig, your response has helped me, I needed the reminder today.
An alternative way to get rename to work, in spite of the perl strict subs messaqe would be to use the 's' option with rename command as follows. (For this example, lets assume you want to rename IMGP to B. I agree with @haertig that what the original poster was trying to do was unclear, perhaps rename IMGP.B to just IMGP, who knows.) Either single quotes (') or double quotes (") are required for the command to work.
rename 's/IMGP/B/' IMGP
The above assumes the user has correct file and subdirectory access to effect change to the file in question. Running an 'ls -alF' will show you the rights for the subdirectory (folder) in question and the file 'B' which the above file changed from 'IMGP' if the above command ran successfully.
I too ran into this with the current Ubuntu...made a mental note to verify which version of the 'rename' perl script/command was being used by the Linux distro I am on at a given time. Unfortunately neither -V or -v option revealed any version information, instead I received an 'Unknown option:' message, in spite of the help showing:
Usage: rename [-v] [-n] [-f] perlexpr [filenames]
Made me curious to which 'rename' script/command was being accessed when 'rename -v' did not provide a version number as expected. Here is how you can do that, regardless of which Linux distro you are using.
From a Command Prompt/Terminal Window, do the following:
sudo -i ~ Become root/superuser 'sudo -i' and enter the [sudo] password.
cd / ~ Go to the root directory 'cd /' (use a 'pwd' command to verify your current directory)
find . -name rename ~ run 'find . -name rename' or 'find . -name "*rename*"' (do not include the single quotes) to determine where the replace script/command exists on your current Linux system. Make sure you include the minus sign (-) before the 'name' parameter, no spaces between - and name or you will not get what you want to see, but instead get almost everything on your hard drive.
For my current Ubuntu version, Ubuntu 10.04.1 LTS, (lsb_release -d) whose root is Debian, squeeze/sid, (cat /etc/debian_version) I found the following:
root@zareason-breeze:/# pwd
/
root@zareason-breeze:/# find . -name rename
./var/lib/dpkg/alternatives/rename
./etc/alternatives/rename
./usr/bin/rename
Next I checked my PATH using the 'env' command to determine which of those 'rename' scripts/commands was encountered first.
root@zareason-breeze:/# env
.
.
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
Based on this information I know that I am encountering the 'replace' script/command in location /usr/bin before any of the others listed. (Being mindful that I was root/superuser (sudo) here, I checked the path for my user account as well and it was the same. Had anyone placed a 'rename' script in any of the following:
/usr/local/sbin
/usr/local/bin
/usr/sbin
that 'rename' script/command would have run before the 'rename' command in /usr/bin. Something a rootkit might do with other scripts/commands so that you would not know it was there. FYI.
An alternative way is to use the 'which' script/command to see which one (rename) is accessed, however the reader should be aware that I have experienced cases where 'which' did not work, probably because the command/script I was looking for was not in my PATH, thus the method above with 'find' and 'env' will always find what you are looking for, especially if you become root(superuser/sudo/su) and search from the root directory (/). (Windows users might be familiar with their Root directory for their 'C' drive being C:/>, similar concept, though not exactly identical as you have D:/> and perhaps more. In Linux every drive, subdirectory, folder is mounted from the root directory of /...many users find this concept confusing at first.)
root@zareason-breeze:/# which rename
/usr/bin/rename
I plan to use Arch, CentOS, Fedora, Gentoo, Knoppix, Slackware, TinyCore, in addition to Debian (Ubuntu/Mint)...remember there are well over 26 different Linux root distros, its just that Debian and Red Hat are the two most commonly used, at least for servers, based on the statistics I have seen. For instance the root Linux distro for Ubuntu is Debian. The root distro for Linux Mint is Ubuntu. The root distro for CentOS is Redhat, just as Fedora's root distro is Redhat. Do not let my usage of 'root' with respects to parent - child relationships among distros confuse you compared to sudo (root/superuser) access. They are different.
To see the root distro for the Linux you are currently using, use this Graphic:
http://upload.wikimedia.org/wikipedi...a/Gldt1009.svg.
Two Unix/Linux distros not shown on that graphic that I use (or plan too) are 'BSD' and 'busybox' (busybox Linux is used for DD-WRT and many other embedded devices, smart handhelds, etc...). Many people forget that Gnu is not Linux and Linux is built with/on top of Gnu. FYI. Personally I started with Sun, Solaris, Redhat and Mandrake back in the late 1990s, but that is another story.
I hope that the information and commands used to get that information that I have provided here will help other Linux users learn a little more about the version of Linux they are currently using. One thing is for sure, when I searched for 'strict subs' related to Linux, this post was among the top search results listed.
As for today, 2011, 5 years after the posting of this question on LinuxQuestions, whose information is still valid today, I believe adding additional information is "relevant" as the google search I performed listed this forum post in the top two listed. I certainly needed the reminder. So many people will should find the additional command and related information relevant as well.
The more I learn, I realize there is so much more to learn! That is a very good thing!