Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^3: Defining a sub within a sub: OK?

by jwkrahn (Abbot)
on Oct 14, 2009 at 22:12 UTC ( [id://801224]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Defining a sub within a sub: OK?
in thread Defining a sub within a sub: OK?

Subroutine names are package variables and therefore not "globally scoped".    Only certain Perl variables fit the definition of "globally scoped".

the sub level1 is defined within an explicit scope, not within a code block.

Basic BLOCKs

Replies are listed 'Best First'.
Re^4: Defining a sub within a sub: OK?
by AnomalousMonk (Archbishop) on Oct 14, 2009 at 22:50 UTC
    What I meant by 'globally scoped' was 'accessible from any point of execution within the program', and package variables do fit this definition.

    I agree with jwkrahn's point about the 'code block' (as defined in the referenced discussion of blocks). What I thought was meant was a 'code block' of the sort associated with sort and other such built-ins, e.g.,
        my @sorted = sort { $a <=> $b } @unsorted;

    (Hang on, I may be experiencing a 'lobe block' ... )

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://801224]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (7)
As of 2024-04-23 10:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found