develooper Front page | perl.perl5.porters | Postings from November 2007

Re: [perl #46987] OO-call failures, autoviv-functions & testing their existence

Thread Previous | Thread Next
From:
Dr.Ruud
Date:
November 1, 2007 14:13
Subject:
Re: [perl #46987] OO-call failures, autoviv-functions & testing their existence
Message ID:
20071101211326.24522.qmail@lists.develooper.com
Linda W schreef:

>      I would prefer Perl, continue to strive to be the (*usually*)
> user-friendly language that it is, and try to do what the user
> might have really been intending before throwing a fatal error.

What do you think that "return \%data{@keys}" means? It pretty much
looks to me like the user wants to return a reference to a hash slice.
To make it sort of work, you could write it like I show below, but that
involves copying, which might not be what the user wanted:

    my %tmp;
    @tmp{@keys} = @data{@keys};
    return \%tmp;

-- 
Affijn, Ruud

"Gewoon is een tijger."


Thread Previous | 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