Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sdd.hp.com!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: Is this a Bug? Keywords: perl bug Message-ID: <9836@jpl-devvax.JPL.NASA.GOV> Date: 5 Oct 90 18:10:42 GMT References: <9134@cg-atla.UUCP> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Distribution: na Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 20 In article <9134@cg-atla.UUCP> white@cg-atla.UUCP (Frank ) writes: : : I am using 'perl' PL18. Running the following script : causes "WORD WITH PARENS" to be printed. What's the difference? : ----------------- cut here ------------------------------------------- : #!/usr/local/bin/perl : : $_ = "This line contains a\nword beginning a line"; : if ( /^word/ ) { : print "WORD NO PARENS\n"; : } elsif ( /^(word)/ ) { : print "WORD WITH PARENS\n"; # I get this message !! : } This is documented behavior at patchlevel 18--the man page says you can't expect ^ to behave consistently in mid-string if $* isn't set. As of the next patch, ^ should never match in mid string unless $* is set. Larry