[Mastering-perl] The Big Final Push
Derek B. Smith
derekbellnersmith at yahoo.com
Fri Dec 15 14:37:48 EST 2006
--- brian d foy <brian.d.foy at gmail.com> wrote:
> I've started my last pass through the Mastering Perl
> text. It's time
> to get nitpicky :)
>
> I've printed everything I have so far and am making
> notes on paper.
> The change in medium is useful. It looks a lot
> different on paper. :)
>
> I've been moving things around in the Regex chapter,
> and I have a lot
> of notes on the benchmarking and debugging chapters
> which I'll commit
> soon. After that things should move pretty quickly
> so I can get this
> book done by the end of the year.
>
> I'm already committed to the next book, "Learning
> Perl 6", and I have
> to start working on that in January. I'm not
> thinking about that until
> I finish this one, though, so don't distract me jsut
> yet. :)
>
> --
Hello to all. : )
I was reading throught the advanced reg exp chapter
and regular expression references, you mistyped regexp
variable. I should should $regex not $regexp. See
below:
$ perl foo
(?-xism:(\S+) hacker)
I found a hacker of type Perl
I have a regex!
Reference type is
$ cat foo
my $string = "Just another Perl hacker,";
my $regex = qr/(\S+) hacker/;
print "$regex\n";
if( $string =~ m/$regex/ )
{
print "I found a hacker of type $1\n";
}
print "I have a regex!\n" if $regex->isa( 'Regexp' );
print "Reference type is ", ref( $regexp ), "\n";
ref( $regexp ) should read
ref ($regex )
$ perl foo
(?-xism:(\S+) hacker)
I found a hacker of type Perl
I have a regex!
Reference type is Regexp
I ran foo file on cygwin
$ uname -a
CYGWIN_NT-5.1 dubmdsmith10 1.5.21(0.156/4/2)
2006-07-30 14:21 i686 Cygwin
More information about the Mastering-perl
mailing list