develooper Front page | perl.perl5.porters | Postings from June 2001

Re: [ID 20010612.001] out of memory during regex compilation

Thread Previous | Thread Next
From:
Ronald J Kimball
Date:
June 12, 2001 07:07
Subject:
Re: [ID 20010612.001] out of memory during regex compilation
Message ID:
20010612100752.G16865@linguist.thayer.dartmouth.edu
On Tue, Jun 12, 2001 at 01:14:15PM +0100, Mike Guy wrote:
> Robin Barker <rmb1@cise.npl.co.uk> wrote
> > You probably want to replace @@ by \@\@,
> > as (I think) @@ will include array @.
> 
> No, actually.    "Punctuation" arrays aren't interpolated in doublequotish
> strings.     A fact that doesn't seem to be documented.
> 
> In fact, how arrays interpolate isn't documented at all (except
> implicitly in the description of $" in perlvar).

> --- ./pod/perlop.pod.orig	Sun May  6 15:24:51 2001
> +++ ./pod/perlop.pod	Tue Jun 12 13:10:01 2001

> @@ -733,6 +735,15 @@
>  and although they often accept just C<"\012">, they seldom tolerate just
>  C<"\015">.  If you get in the habit of using C<"\n"> for networking,
>  you may be burned some day.
> +
> +Subscripted variables such as C<$a[3]> or C<$href->{key}[0]> are also
> +interpolated, as are array and hash slices.    But method calls
> +such as C<$obj->meth> are not interpolated.
> +
> +Interpolating an array or slice interpolates the elements in order,
> +separated by the value of C<$">, so is equivalent to interpolating
> +C<join $", @array>.    "Punctuation" arrays such C<@+> are not
> +interpolated.

s/such/such as/;


However, a little earlier in the doc, around line 695, is the sentence:

  For constructs that do interpolate, variables beginning with "C<$>"
  or "C<@>" are interpolated, as are the following escape sequences.


And there's also this bit, just after your new text:

>  You cannot include a literal C<$> or C<@> within a C<\Q> sequence. 
>  An unescaped C<$> or C<@> interpolates the corresponding variable, 


The section on interpolation may be a bit disorganized right now.

Ronald

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About