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

Optional binding

Thread Next
From:
Luke Palmer
Date:
March 6, 2005 01:11
Subject:
Optional binding
Message ID:
20050306091309.GA19939@navi.cx
What is output:

    sub foo($x, ?$y, *@z) {
        say "x = $x; y = $y; z = @z[]";
    }

    my @a = (1,2,3);
    foo($x, @a);

Thanks,
Luke

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