On Thursday 31 January 2002 22:03, Bryan C. Warnock wrote:
....junk. Too tired, I missed the point entirely.
> On Thursday 31 January 2002 21:03, Dave Storrs wrote:
> > Just a thought...the following would be *really* cool:
> >
> > my $pi = Pi::Generate;
> >
> > # Check the first 200 characters only; halt w/success if NO match
> > print "There's a letter in here!\n" if ($pi =~ /[a-z]/h200t);
>
> print "There's a letter in here!\n" if ($pi !~ /^.{0,199}?[a-z]/);
print "There's a letter in here!\n" if (substr($pi, 0, 200) !~ /[a-z]/);
>
> > # Check the first 200 characters only; halt w/failure if NO match
> > print "There's a letter in here!\n" if ($pi =~ /[a-z]/h200f);
>
> print "There's a letter in here!\n" if ($pi =~ /^.{0,199}?[a-z]/);
print "There's a letter in here!\n" if (substr($pi, 0, 200) =~ /[a-z]/);
>
> > This would be useful for cases where you might be dealing with
> > infinite data, or when you are only going to need to use the first
> > section of a string.
>
> substr, maybe?
I said it, but didn't do it. (My first examples weren't extensible past a
single letter.)
--
Bryan C. Warnock
[EMAIL PROTECTED]