home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / perl / 6885 < prev    next >
Encoding:
Internet Message Format  |  1992-11-08  |  1.0 KB

  1. Path: sparky!uunet!ogicse!decwrl!netsys!news!netlabs!lwall
  2. From: lwall@netlabs.com (Larry Wall)
  3. Newsgroups: comp.lang.perl
  4. Subject: Re: Problems with multiple-splitting
  5. Message-ID: <1992Nov6.233214.24911@netlabs.com>
  6. Date: 6 Nov 92 23:32:14 GMT
  7. Article-I.D.: netlabs.1992Nov6.233214.24911
  8. References: <ELIAS.92Nov4165430@fitz.TC.Cornell.EDU>
  9. Sender: news@netlabs.com
  10. Distribution: comp.lang.perl
  11. Organization: NetLabs, Inc.
  12. Lines: 16
  13. Nntp-Posting-Host: scalpel.netlabs.com
  14.  
  15. In article <ELIAS.92Nov4165430@fitz.TC.Cornell.EDU> elias@fitz.TC.Cornell.EDU (Doug Elias) writes:
  16. : # This next one doesn't do jack, the variables are empty strings.
  17. : # Is there some reason why you can't split something you've just
  18. : # obtained from a split?
  19. : #
  20. :     ($year, $mon, $day) = split(".", $date);
  21.  
  22. That's being interpreted as
  23.  
  24.     ($year, $mon, $day) = split(/./, $date);
  25.  
  26. and the . is matching every character.  Backwhack it.  The first argument
  27. to split is always interpreted as a regular expression currently, except
  28. in the special case of ' '.
  29.  
  30. Larry
  31.