Path: utzoo!attcan!uunet!mcsun!mcvax!hp4nl!mhres!jv From: jv@mh.nl (Johan Vromans) Newsgroups: comp.sources.bugs Subject: RE match problem in Perl 2.0 pl 18 Message-ID: Date: 24 Aug 89 22:37:06 GMT Sender: jv@mhres.mh.nl Organization: Multihouse Gouda, the Netherlands Lines: 28 Perl version: $Header: perly.c,v 2.0.1.10 88/11/22 01:14:58 lwall Locked $ Patch level: 18 Using a regular expression in a match pattern seems to destroy the usability of the "$`" (dollar-leftquote) variable: $a = "abcdefghi"; printf "\$` = %s, \$' = %s\n", $`, $' if $a =~ /def/; printf "\$` = %s, \$' = %s\n", $`, $' if $a =~ /d.f/; printf "\$` = %s, \$' = %s\n", $`, $' if $a =~ /^abc/; printf "\$` = %s, \$' = %s\n", $`, $' if $a =~ /ghi$/; produces: $` = abc, $' = ghi $` = , $' = ghi <== $` should be "abc" $` = , $' = defghi <== could be correct... $` = , $' = <== $` should be "abcdef" -- johan -- Johan Vromans jv@mh.nl via internet backbones Multihouse Automatisering bv uucp: ..!{mcvax,hp4nl}!mh.nl!jv Doesburgweg 7, 2803 PL Gouda, The Netherlands phone/fax: +31 1820 62944/62500 ------------------------ "Arms are made for hugging" -------------------------