in reply to Re: Daft Regexp
in thread Daft Regexp

Yup that's it
i was regexping the path with file, not the file then adding on the path so
my ($newname) =$handle."\\".$entries[$i]; $newname =~ s/^([a-z])/\u$1/g; rename ($handle."\\".$entries[$i], $newname);

becomes
my ($newname) =$entries[$i]; $newname =~ s/^([a-z])/\u$1/g; rename ($handle."\\".$entries[$i], $handle."\\".$newname);

cheers for that, it's always simple things that mess up the most!

Replies are listed 'Best First'.
Re^3: Daft Regexp
by Aristotle (Chancellor) on Aug 05, 2003 at 17:46 UTC
    What about what Cody Pendant carefully hinted at?
    my $newname = ucfirst $entries[$i]; rename ($handle."\\".$entries[$i], $handle."\\".$newname);

    Makeshifts last the longest.

      erm i had a look in the o'reily book, and didn't see a reference to ucfirst, and becuase i'm doing a couple of other substitutions too, prefered to find why my effort didn't work, byt the looks of it, his code work wook too though! but would have had the samne stumbling block as mine ended up having..
      cheers
      ant