Jay Savage schreef:
> Dr.Ruud:
>>> Christopher Spears:
#print $regexp;
>>
>> Make that
>> print qr/$regexp/;
>
> Not sure where your headed with this.
My headed? :)
It was an alternative for the commented "debug" line.
> First, OP wants to print the input back to the user.
And I pre
On 8/23/07, Jay Savage <[EMAIL PROTECTED]> wrote:
> That means the regex is actually being compiled twice. It probably
> doesn't, though, make sense to compile the regex before entering the
> loop, so perhaps something like:
Make that *does* make sense.
-- j
--
On 8/21/07, Dr.Ruud <[EMAIL PROTECTED]> wrote:
> Jeff Pang schreef:
> > Christopher Spears:
>
> >> print "Enter regular expression: ";
> >> chomp(my $regexp = );
> >
> > $regexp = quotemeta($regexp);
>
> Since it specifically asks for a regular expression, I would definitely
> not do quotemeta().
>
Jeff Pang schreef:
> Christopher Spears:
>> print "Enter regular expression: ";
>> chomp(my $regexp = );
>
> $regexp = quotemeta($regexp);
Since it specifically asks for a regular expression, I would definitely
not do quotemeta().
>> #print $regexp;
Make that
print qr/$regexp/;
--
Affijn,
On Aug 20, 11:28 pm, [EMAIL PROTECTED] (Christopher Spears) wrote:
> I'm working on the second exercise of the second
> chapter. I'm supposed to write a program that asks
> the user to type a regular expression. The program
> then uses the regular expression to try to find a
> match in the direct
Christopher Spears wrote:
Hi!
I'm trying to get back into Perl again by working
through Intermediate Perl. Unfortunately, the Perl
part of my brain has atrophied!
I'm working on the second exercise of the second
chapter. I'm supposed to write a program that asks
the user to type a regular
-Original Message-
>From: Christopher Spears <[EMAIL PROTECTED]>
>Sent: Aug 21, 2007 11:28 AM
>To: beginners@perl.org
>Subject: entering regular expressions from the keyboard
>
>Hi!
>
>I'm trying to get back into Perl again by working
>through Intermediate Perl. Unfortunately, the Perl
>