develooper Front page | perl.perl5.porters | Postings from August 2010

Re: mauve::reftype()

Thread Previous | Thread Next
August 30, 2010 08:04
Re: mauve::reftype()
Message ID:
On 30 August 2010 17:01, demerphq <> wrote:
> On 30 August 2010 16:46, Zsbán Ambrus <> wrote:
>> Though I don't really understand how that works.  What do you even get
>> if you dereference a regexp with ${...}, and how can you use that
>> value?
> You should get a string. Its basically a special form of SCALAR.

And now i have checked...

And one does indeed get the string form of the pattern, if one dereferences.

$ ./perl -le'my $r=qr/xyz/; print $$r'

basically "$qr" and $$qr are the same thing.

$ ./perl -le'my $r=qr/xyz/; print $r'

Essentially a REGEXP is a special case of a blessed string.


perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About