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

Re: mauve::reftype()

Thread Previous | Thread Next
Zsbán Ambrus
August 30, 2010 04:19
Re: mauve::reftype()
Message ID:
On Mon, Aug 30, 2010 at 12:51 PM, demerphq <> wrote:
> BIND, VSTRING and LVALUE lack an "example", and the others could have
> their "examples" reviewed.

The examples confuse me because C<< *STDOUT{IO} >> returns a reference
to IO, whereas C<< $code->() >> uses up a reference (it won't even
autovivify one).

Here are my suggestions.  All of these create a reference, and they
also try to imply which ones are really scalar refs even where that
complicates the code.

SCALAR (C<< \$x >>)

REF (C<< \($x = \1) >>)

LVALUE (C<< (&{sub { *x = \$_[0] }}(substr("",0)), \$x) >>)

VSTRING (C<< \($x = v1.0.0) >>)

GLOB (C<< \($x = *y) >>)

ARRAY (C<< \@x >>)

HASH (C<< \%x >>)

CODE (C<< \&x >>)

FORMAT (C<< (eval "format =\n.", *STDOUT{FORMAT}) >>)

IO (C<< *STDOUT{IO} >>)

BIND -- I don't know what these were or are

REGEX (C<< qr// >>)

UNKNOWN -- there should be no example


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