develooper Front page | perl.perl6.language | Postings from June 2001

Re: 1 until defined(getvalue()); return $^d;

Thread Previous | Thread Next
From:
David L. Nicol
Date:
June 6, 2001 17:25
Subject:
Re: 1 until defined(getvalue()); return $^d;
Message ID:
3B1EC8FF.E080A80E@kasey.umkc.edu
Simon Cozens wrote:

> Please don't try defending "it" or "$^d" in terms of efficiency;
> any variable that Perl has to keep track of magically takes a
> performance hit. Remember $`, $', and $&?

No, this datum is already known by defined() and exists() all I
am suggesting is a name for the Perl API name for it.  Well, it
isn't currently in 5.6.1's

bool
Perl_hv_exists(pTHX_ HV *hv, const char *key, U32 klen)

function (contrary to what John Porter said) but adding it,
as extended defined/exists that Only Gets Called When It
Immediately And Obviously Precedes Use Of The Magic Variable,

would save the later lookups.

This is a "Little thing that can just be thrown in" and is nothing
more than that.

Making $', $`, and $& lexically scoped too could solve their
performance hit issues too.  They're convenient.


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