-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Kathy,
I'm not sure exactly what problem you are having. When I ran your code below (after putting a semi-colon after `my $where`), I got the result of `where = 4` which is the index of the letter N in the $dateTime string. What is it you are expecting to see? Steve kathyjjja wrote: > Hello everyone, > > I am trying to add the date to a file name. I finally got rename to work, but > now I am having problems with indexing the date string. Index works fine on > any other string, but for some reason it is not seeing the characters in > date. Here is the code: > > my $where > my $dateTime = localtime; > print "dateTime = $dateTime\n"; > # dateTime looks like this: Fri Nov 11 14:59:49 2005 > $where= index($dateTime, "N"); > print "where = $where\n"; > > index() cannot find anything in the $dateTime string. I am thinking that this > data is actually stored in another format and when you ask for it to be > printed, it formats it nicely for you automatically. If that is true, how can > I get a date as a string that I can manipulate? > > Thanks, > Kathy > > > --------------------------------- > Yahoo! FareChase - Search multiple travel sites in one click. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFDdPy7C4cakfkZLXQRAn6jAJwN1sAzhJWyjOA5nWCMo2r7B39vdQCdEynO P4hPaK2WUkdKCYRW+vdHNws= =ni5O -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>