in reply to Re^7: Which internal DSL are there in Perl? (Domain Specific Languages - Part 1)
in thread Which internal DSL are there in Perl? (Domain Specific Languages - Part 1)

I don't think so. Yes, it's a partial quote, but what I left off (end of surrounding block etc.) doesn't change much. When a package begins, the previous package ends. As I understand it, at end of enclosing block, the package ends, and you are in package main.
Update: I was completely wrong, see below...
  • Comment on Re^8: Which internal DSL are there in Perl? (Domain Specific Languages - Part 1)
  • Download Code

Replies are listed 'Best First'.
Re^9: Which internal DSL are there in Perl? (Domain Specific Languages - Part 1)
by shmem (Chancellor) on Aug 04, 2017 at 16:49 UTC
    As I understand it, at end of enclosing block, the package ends, and you are in package main.

    No. You are back in the package you came from:

    package Foo { print "(1) package " . __PACKAGE__ . $/; package Bar { print "(2) package " . __PACKAGE__ . $/; } print "(3) package " . __PACKAGE__ . $/; } print "(4) package " . __PACKAGE__ . $/; __END__ (1) package Foo (2) package Bar (3) package Foo (4) package main
    perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
      That's what I deserve for posting before testing :-/