home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / perl / 7776 < prev    next >
Encoding:
Text File  |  1993-01-12  |  2.2 KB  |  56 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!csus.edu!netcom.com!jfh
  3. From: jfh@netcom.com (Jack Hamilton)
  4. Subject: Re: How to run a Perl under DOS?
  5. Message-ID: <1993Jan12.170523.9871@netcom.com>
  6. Organization: Netcom - Online Communication Services (408 241-9760 guest)
  7. References: <1272@alsys1.aecom.yu.edu> <1993Jan11.062312.323@netcom.com> <1278@alsys1.aecom.yu.edu>
  8. Date: Tue, 12 Jan 1993 17:05:23 GMT
  9. Lines: 45
  10.  
  11. In article <1278@alsys1.aecom.yu.edu> manaster@yu1.yu.edu (Chaim Manaster) writes:
  12. >In article <1993Jan11.062312.323@netcom.com> jfh@netcom.com (Jack Hamilton) writes:
  13. >>>>>>1  >>    @rem = '                   
  14. >>>>>>2  >>    some dos batch commands
  15. >>>>>>3  >>    PERL -S %0.BAT %1 %2 %3 (etc)
  16. >>>>>>4  >>    GOTO ENDOFPERL
  17. >>>>>>5  >>    ';
  18. >>>>>>6  >>    # your perl script here
  19. >>>>>>7  >>    __END__
  20. >>>>>>8  >>    :ENDOFPERL
  21. >>>>>>9  >>    some more DOS if you need it
  22. >>>>>>10 >>    rem Drop through end of Batch file
  23. >>>
  24. >What I don't see is where either the single quotes or double quotes
  25. >you refer to, come from. The only quotes in the script above,
  26. >enclosing lines 1-5 (single quote) are used by perl once it has
  27. >already been invoked and for all practile purposes thrown away.
  28.  
  29. Right.
  30.  
  31. >Teh line seen by the perl line as seen by the DOS processor has NO
  32. >quotes (of either kind) at all. So the last three or four lines of
  33. >your reply above still confuse me.
  34.  
  35. Perhaps I was misunderstanding your question. 
  36.  
  37. >My original question was meant to be, if (for example) lastname was
  38. >replaced by Henry$lastname would perl expand the $lastname part of
  39. >the parameter, and would DOS either choke or expand it as well?
  40.  
  41. If you have a PC, why don't you just try it yourself?  It may be a better
  42. way to learn.  Try both kinds of quote marks.
  43.  
  44. >And
  45. >if you wanted to prevent expansion by either DOS or perl what would
  46. >you do?
  47.  
  48. Perl won't expand inside single quotes.  I'm not sure how I'd escape a
  49. percent sign in DOS because I've never needed or wanted to do so, and my
  50. DOS manual is all the way on the other side of the room.  
  51.  
  52. -- 
  53.  
  54. -----------------------------------------------------------------------
  55. Jack Hamilton   jfh@netcom.com   P. O. Box 281107   SF, CA   94128-1107
  56.