develooper Front page | perl.perl5.porters | Postings from May 2013

Re: [perl #118091] Split gv_fetchpvn_flags into smaller functions

Thread Previous
From:
Leon Timmermans
Date:
May 23, 2013 15:21
Subject:
Re: [perl #118091] Split gv_fetchpvn_flags into smaller functions
Message ID:
CAHhgV8g3s_p9UOyD2ec1zUYHOvKE0vayNdB2wKO_qyWfUZx1qQ@mail.gmail.com
On Tue, May 21, 2013 at 5:23 PM, Brian Fraser <perlbug-followup@perl.org> wrote:
> [Please describe your issue here]
>
> https://github.com/Hugmeir/utf8mess/commits/split_gv_fetchpvn_flags
>
> That branch splits gv_fetchpvn_flags() into four helper functions:
> parse_gv_stash_name, which parses the name passed in to find a glob name
> and optionally a stash, find_default_stash, which, if the previous function
> didn't find a stash or some flags were passed in, looks for a suitable stash
> for the new glob, magicalize_gv, which adds magic to a newly-created glob,
> and
> maybe_multimagic_gv, which checks if an already-existing glob needs a
> different
> king of magic, ala *! needing to be magicalized for $! and %!.
> ...I'm not confident the names are all that descriptive, so feel free to
> suggest alternatives for those.
>
> The branch also adds some comments to make better sense of how it
> all works.  They are nowhere near comprehensive and need a second
> pair of eyes for correctness, but I think that anything that clarifies
> gv_fetchpvn_flags is a good step forward.

It looks ok to me. I really like having this split out properly, it
was somewhere on my todo list too, but somewhat low.

Leon

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About