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

Quickcheck of context of index expressions

Thread Next
From:
Autrijus Tang
Date:
April 25, 2005 12:34
Subject:
Quickcheck of context of index expressions
Message ID:
20050425193344.GA62148@aut.dyndns.org
Another quick check on expression context for indexed expressions.
Please sanity-check the return value of want() below:

    @x[0] = want();   # scalar context
    @x[want()] = $_;  # scalar context
    @x[want()] = @_;  # scalar context
    @x[0,] = want();  # list context
    @x[want(),] = $_; # list context
    @x[want(),] = @_; # list context
    $_ = @x[want()];  # scalar context
    @_ = @x[want()];  # list context

Thanks,
/Autrijus/

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