@+ magic variable
essuu at ourshack.com
Thu Feb 15 16:38:15 GMT 2007
On Thu, 15 Feb 2007, Luis Motta Campos wrote:
> On Feb 15, 2007, at 4:22 PM, Simon Wilcox wrote:
> > Note that @+ is a special variable according to perlvar.
> But it will get interpolated into the regex even if it's not,
> there is a "variable name" in front of it, no? I mean, it doesn't
> matter if @+ is special variable or common variable, it will get
> interpolated into the regex anyway, no?
That's my understanding. The main difference being that it doesn't need to
be explicitly declared with my when using strict.
It's specialness not withstanding, it's the fact that 5.6.1 behaves
differently to 5.8.x that was of interest. In 5.6.1, /@+$/ appears to
match 1 or more literal @'s, when we wouldn't expect it to.
perlvar in 5.6.1 is identical on the subject of @+ to that in 5.8.4 so I
would expect the same behaviour.
It's all strange.
More information about the london.pm