home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / perl / 7942 < prev    next >
Encoding:
Text File  |  1993-01-22  |  1.2 KB  |  33 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!gatech!paladin.american.edu!howland.reston.ans.net!spool.mu.edu!uwm.edu!cs.utexas.edu!convex!convex!tchrist
  3. From: Tom Christiansen <tchrist@convex.COM>
  4. Subject: Re: Problem with m//
  5. Originator: tchrist@pixel.convex.com
  6. Sender: usenet@news.eng.convex.com (news access account)
  7. Message-ID: <1993Jan22.135043.21623@news.eng.convex.com>
  8. Date: Fri, 22 Jan 1993 13:50:43 GMT
  9. Reply-To: tchrist@pixel.convex.COM (Tom Christiansen)
  10. References: <KHERA.93Jan20130300@thneed.cs.duke.edu>
  11. Nntp-Posting-Host: pixel.convex.com
  12. Organization: Convex Computer Corporation, Colorado Springs, CO
  13. X-Disclaimer: This message was written by a user at CONVEX Computer
  14.               Corp. The opinions expressed are those of the user and
  15.               not necessarily those of CONVEX.
  16. Lines: 15
  17.  
  18. If you're doing a pattern match but don't want and patterns, as in 
  19.  
  20.     $p =~ s/(\W)/\\$1/g;
  21.     $os =~ /$p/;
  22.  
  23. Then perhaps it makes more sense to simply use index() instead:
  24.  
  25.     if (index($os, $p, >= $[) { }
  26.  
  27. --tom
  28. -- 
  29.     Tom Christiansen      tchrist@convex.com      convex!tchrist
  30.  
  31. Perle, plesaunte to prynces paye/ To clanly clos in golde so clere,
  32. Oute of oryent, I hardyly saye/ Ne proued I neuer her precios pere.
  33.