develooper Front page | perl.perl6.language | Postings from July 2005

$arrayref.ref?

Thread Next
From:
Ingo Blechschmidt
Date:
July 30, 2005 05:16
Subject:
$arrayref.ref?
Message ID:
dcfr09$qhv$1@sea.gmane.org
Hi,

http://use.perl.org/~autrijus/journal/25337:
> deref is now 0-level; $x = 3; $y = \$x; $y++. # now an exception

    my $arrayref = [1,2,3];

    say $arrayref.ref;            # Ref or Array?
    say $arrayref.isa("Ref");     # true or false?
    say $arrayref.isa("Array");   # false or true?

    say +$arrayref;               # 3 or error?
    say $arrayref + 1;            # 4 or error?


--Ingo

-- 
Linux, the choice of a GNU | Black holes result when God divides the
generation on a dual AMD   | universe by zero.  
Athlon!                    |


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