home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / perl / 5735 < prev    next >
Encoding:
Internet Message Format  |  1992-09-07  |  1.4 KB

  1. Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!usc!news!netlabs!lwall
  2. From: lwall@netlabs.com (Larry Wall)
  3. Newsgroups: comp.lang.perl
  4. Subject: Re: Bad label: _EVAL_
  5. Message-ID: <1992Sep4.172952.2766@netlabs.com>
  6. Date: 4 Sep 92 17:29:52 GMT
  7. References: <1992Sep3.082620.13684@sbil.co.uk> <JKT.92Sep3135937@seneca.SED.Provo.Novell.COM>
  8. Sender: news@netlabs.com
  9. Organization: NetLabs, Inc.
  10. Lines: 29
  11. Nntp-Posting-Host: scalpel.netlabs.com
  12.  
  13. In article <JKT.92Sep3135937@seneca.SED.Provo.Novell.COM> jkt@SED.Provo.Novell.COM (Jack Thomasson) writes:
  14. : >>>>> On 3 Sep 92 08:26:20 GMT, jim@spitws117.sbil.co.uk (James
  15. : >>>>> Gillespie) said:
  16. : James>     open (OUTPUT, "> $oldfile") || die "Couldn't open '$oldfile' for writing\n";
  17. : the old "how many single quotes was that, anyway?" bug.  try:
  18. : ... || die "could not open $oldfile for writing\n"; # avoid the problem
  19. : or
  20. : ... || die "couldn\'t open \'$oldfile\' for writing\n"; # escape the
  21. : problem
  22.  
  23. Well, er, actually, no.  You can put as many single quotes inside double
  24. quotes as you like.  Perl isn't like the shells--there's generally only
  25. one level of interpretation going on inside a quoted string.  I'm always
  26. vaguely amused when I see someone putting
  27.  
  28.     die "Can not snuffle quietly: $!"
  29.  
  30. because I know they're probably being superstitious.  I'd say
  31.  
  32.     die "Can't snuffle quietly: $!"
  33.  
  34. This is OK in Perl.  By design.
  35.  
  36. Larry
  37.