in reply to Re^2: create an anonymous hash using "map" (BEGIN block References)
in thread create an anonymous hash using "map"

The practical uses of BEGIN and END in Perl may be more apparent when you consider how these were first used in awk. Perl of course took that idea and ran with it. As a Perl programmer, understanding this part of awk helped, especially with one-liners.
  • Comment on Re^3: create an anonymous hash using "map" (BEGIN block References)
  • Download Code

Replies are listed 'Best First'.
Re^4: create an anonymous hash using "map" (BEGIN block References)
by LanX (Saint) on Apr 29, 2025 at 21:17 UTC
    I'm not an expert in awk's BEGIN, but I suppose that's despite the name more accurately described as an INIT block in Perl.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery