in reply to spaces in filenames

Two observations (potential problems):

  1. How about brackets around your utime arguments, to prevent the boolean OR operator from binding your error handling (die) to your third argument? I'd change || to or.
  2. Your second substitution regex squishes the last two characters in the filename if the last character is whitespace. Is this what you wanted?

Jon

Replies are listed 'Best First'.
Re: Re: spaces in filenames
by ironpaw (Novice) on Feb 03, 2003 at 04:36 UTC
    brackets around the argument you mean like this? and for changing || to or.
    (utime $access, access, "/staff/cyp/share/shared/cr/Server Replacement + Schedule.doc" or die print "couldn not set utime for \n");
    I'll give it a go but I'm not sure thats what you ment. My perl code is poor as I steal bits of my other also badly written scripts that worked ;) I have a little trouble understanding comments at this stage but that helps with the learning so thanks.

      Well, you changed || to or so you're partially there, but I was suggesting brackets around your arguments, not around the whole call to utime(), like so:

      utime($access, $access, "/some/path/Some File.doc") or {...};

      Jon

      Update: I just saw too that you have die print ... and the print is unnecessary.