in reply to A useful use of goto

Sorry, I don't understand your need for localization.

Please explain if you want your DSL handlers to disappear why don't you simply use a temporary namespace which you destroy afterwards?

You're already adding a package to $cfg_str, just call it TMP_CONFIG1234!

If you're still afraid you can still delete all references to this package from main's stash afterwards...

Replies are listed 'Best First'.
Re^2: A useful use of goto
by Corion (Patriarch) on Apr 11, 2010 at 21:35 UTC

    Yes, sticking everything into a temporary namespace would have worked too, that approach did not occur to me at all.

      You don't even need a temporary namespace, just call it something like __PACKAGE__::Config and you can reuse it on demand.

      Anyway thank you, the pattern of using goto for a scopeless loop is worth to be mentioned! 8)