🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sources.bugs
Article #113

RE match problem in Perl 2.0 pl 18

#113
From: Johan Vromans
Date: Thu, 24 Aug 1989 22:37
28 lines
1259 bytes
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" -------------------------
Technical Details
Message-ID: <JV.89Aug24163706@mhres.mh.nl>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcsun!mcvax!hp4nl!mhres!jv

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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: <JV.89Aug24163706@mhres.mh.nl>
Date: 24 Aug 89 22:37:06 GMT
Sender: jv@mhres.mh.nl
Organization: Multihouse Gouda, the Netherlands
Lines: 28