[Gllug] Changing case on filenames

Jackson, Harry HJackson at colt-telecom.com
Wed Mar 6 11:10:12 UTC 2002



> -----Original Message-----
> From: Chris Ball [mailto:chris at void.printf.net]
> 
> #!perl -w
> opendir(DIR, "/path/to/dir");
> @files = readdir(DIR);
> 
> foreach $file (@files) {
>     rename($file, (lc $file));
> }

It does but only if you are in the directory with the files. Can someone
tell me why this is as I cannot figure out why you have to be in the same
directory if you have already opened it in the script or am I doing
something wrong.


*************************************************************************************
COLT Telecommunications
Registered in England No. 2452736
Registered Office: Bishopsgate Court, 4 Norton Folgate, London E1 6DQ
Tel. 020 7390 3900

This message is subject to and does not create or vary any contractual
relationship between COLT Telecommunications, its subsidiaries or 
affiliates ("COLT") and you. Internet communications are not secure
and therefore COLT does not accept legal responsibility for the
contents of this message.  Any view or opinions expressed are those of
the author. The message is intended for the addressee only and its
contents and any attached files are strictly confidential. If you have
received it in error, please telephone the number above. Thank you.
*************************************************************************************


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list