Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Re: grepmail not 5.8.0 safe?

by ph0enix (Friar)
on Jul 31, 2002 at 12:38 UTC ( [id://186481]=note: print w/replies, xml ) Need Help??


in reply to Re: grepmail not 5.8.0 safe?
in thread grepmail not 5.8.0 safe?

When invoking this version of grepmail with perl 5.8.0 all output start with:

Useless (?g) - use /g modifier in regex; marked by <-- HERE in m/(?mg +<-- HERE x)^(From\s.*\d:\d\d:\d\d\s\d{4}| From\s.*\d:\d\d:\d\d\s\d{4}\s[+-]\d{ +4}| From\s.*\d:\d\d\s.*\w{2,3}\s\d{4})$/ + at ./grepmail.orig line 163.

You can use following diff which reduces number of failing test to 55:)

diff grepmail.orig grepmail 161c161 < while($READ_BUFFER =~ m/(?mgx)^(From\s.*\d:\d\d:\d\d\s\d{4}| --- > while($READ_BUFFER =~ m/(?mx)^(From\s.*\d:\d\d:\d\d\s\d{4}|

Replies are listed 'Best First'.
Re: Re: Re: grepmail not 5.8.0 safe?
by RMGir (Prior) on Jul 31, 2002 at 12:45 UTC
    Interesting... Did you add the /g to the close of the match, too?

    That while doesn't look like it will work without it...

    $ perl -e'$_="abcabcdabc";while(/(?g)(a[^a]+)/){print "$1\n"}' abc abcd abc
    Cool, with 5.6.1, ?g did "the right thing".

    I guess it was disallowed as a local modifier in 5.8.0 because it doesn't make sense to apply it to just part of the regex?
    --
    Mike

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://186481]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-03-29 13:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found