develooper Front page | perl.perl5.porters | Postings from July 2013

[perl #116773] Documentation of $ in perlre

Thread Previous | Thread Next
From:
Karl Williamson via RT
Date:
July 25, 2013 01:41
Subject:
[perl #116773] Documentation of $ in perlre
Message ID:
rt-3.6.HEAD-2552-1374716465-301.116773-15-0@perl.org
On Sat Feb 16 15:48:43 2013, jkeenan wrote:
> On Fri Feb 15 05:45:39 2013, rob.dixon@gmx.com wrote:
> > 
> > 
> > This is a bug report for perl from rob.dixon@gmx.com,
> > generated with the help of perlbug 1.39 running under perl 5.16.2.
> > 
> > 
> > -----------------------------------------------------------------
> > 
> > I have been working with a regular expression that uses `$` with the
> > `/m` modifier, and have relaised that I was misunderstanding how `$`
> > works. The problem is the line
> > 
> >      $        Match the end of the line (or before newline at the end)
> > 
> > The way I read that is that `$` matches both before and after a
> > newline, 
> 
> While I can see that there might be some fuzziness about the concept of
> 'line', I honestly can't see where you came by the idea that '$' would
> match *after* a newline.
> 
> > whereas what this actually means is
> > 
> >     Match the end of the _string_ (or before a newline at the end of
> > the
> > _string_)
> > 
> > This makes no difference without the `/m` modifier, but with it I was
> > expecting `$` to match twice for each line. After all that is what the
> > documentation says!
> > 
> > A _line_ is something very specific, and it is fair to think of it as
> > a thing that is terminated by a newline character. Because regular
> > expressions allow for multi-line strings I feel this should be
> > changed.
> > 
> > 
> 
> Could you provide some examples of lines (strings?) where you
> experienced this confusion?
> 
> Thank you very much.
> Jim Keenan

The OP hasn't replied in almost 6 months to your request.  Is there
anything wrong with just adding 'the string' as he suggested?
-- 
Karl Williamson

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=116773

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About