[Mastering-perl] Some hints on several chapters...

mailinglisten at renee-baecker.de mailinglisten at renee-baecker.de
Wed Sep 20 09:28:01 EDT 2006


Hi,

in Chapter "Advanced RegEx", you write:

my $regex  = "(\S+) hacker";
my $string = "Just another Perl hacker,";

if( $string =~ m/$regex/ )
    {
    print "I found a hacker of type $1\n";
    }

With warnings, perl complains about the \S:

~/entwicklung 303> perl mastering_perl.pl
Unrecognized escape \S passed through at mastering_perl.pl line 6.

You should use single quotes in that example.

In your final thougts, you link to Rexexp::English that - I assume -
should be Regexp::English. You should also mention the
YAPE::Regex::Explain - a very helpful module to understand what RegEx
do.



A good thing to mention in the Context-chapter is Contextual::Return to
enhance context sensitive behavior.


Kind regards,
ReneeB




More information about the Mastering-perl mailing list