Ovid has asked for the wisdom of the Perl Monks concerning the following question:
Unfortunately, the above code keeps giving me the following error:#!/usr/bin/perl -w use strict; my $myvar = 'Tom said "hi," and Sally replied "get lost, Ovid is more +my style."'; use Benchmark; timethese(100000, { Greedy => '$myvar =~ /"(.*)"/', Lazy => '$myvar =~ /"(.*?)"/', Negated => '$myvar =~ /"[^"]*"/' });
I've tried swapping out the single quotes, the double quotes, and even tried running the debugger on it (yeah, I know that must do wonders for timing your code). I've also read up on a fair amount of documentation for this, all to no avail! HelpUse of uninitialized value at (eval 2) line 1.
Thanks in advance for any advice!
Cheers,
Ovid
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Help using Benchmark.pm
by autark (Friar) on Jul 12, 2000 at 23:02 UTC | |
|
Re: Help using Benchmark.pm
by btrott (Parson) on Jul 12, 2000 at 22:59 UTC | |
|
RE: Help using Benchmark.pm
by Adam (Vicar) on Jul 12, 2000 at 22:53 UTC | |
|
RE: Help using Benchmark.pm
by Ovid (Cardinal) on Jul 12, 2000 at 23:14 UTC |