home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / perl / 5901 < prev    next >
Encoding:
Internet Message Format  |  1992-09-13  |  941 b 

  1. Path: sparky!uunet!convex!darwin.sura.net!Sirius.dfn.de!fauern!Germany.EU.net!mcsun!sunic!dkuug!iesd!iesd.auc.dk!krab
  2. From: krab@iesd.auc.dk (Kresten Krab Thorup)
  3. Newsgroups: comp.lang.perl
  4. Subject: Filenames containing spaces
  5. Message-ID: <KRAB.92Sep13153712@xiv.iesd.auc.dk>
  6. Date: 13 Sep 92 14:37:12 GMT
  7. Sender: news@iesd.auc.dk (UseNet News)
  8. Distribution: comp
  9. Organization: Mathematics and Computer Science, Aalborg University
  10. Lines: 16
  11.  
  12. I have found some problems using filenames with spaces in either end
  13. of the name, It can, however be solved, by inserting `./' in the
  14. beginning, and `\0' int the end.  Like this
  15.  
  16.   $filename = ' strange file name ';
  17.   open(FILE, "./$filename\0");
  18.  
  19. If you dont do it like this, Perl will remove the spaces in both ends,
  20. and try to open the file:
  21.  
  22.     'strange file name'
  23.  
  24. I don't know if Perl is supposed to work like this (of cause, it was
  25. programmed to it) but is this the intention - Larry?
  26.  
  27. /Kresten
  28.