@+ magic variable

Rafael Garcia-Suarez rgarciasuarez at gmail.com
Thu Feb 15 13:37:33 GMT 2007


On 15/02/07, Paul Orrock <paulo at digitalcraftsmen.net> wrote:
> Hi,
>
> We're migrating some client code from 5.6.1 to 5.8.8 and the following
> line has been causing some problems.
>
> The incoming string has lots of @'s padded on the end (don't ask) and
> they need to strip them off.
>
> $str =~ s/@+$//;
>
> This works in 5.6.1 but not in 5.8.8. A bit of search discovers that @+
> is a magic variable in 5.8.8 so escaping the @ in the regex solves the
> problem.
>
> My question is when did the @+ magic variable come in ?

In 5.6.1. However in 5.8.0 array began to always interpolate in double
quoted strings. Did you have warnings on ?
BTW @- and @+ will stop being interpolated in regexps in 5.10.0. That
was, indeed, confusing.


More information about the london.pm mailing list