Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

MOPT-03 - identification, part 1

by mstone (Deacon)
on Dec 27, 2002 at 02:08 UTC ( [id://222451]=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        If we apply operation X to a variable of type Y, 
        we get a variable of type Z.
    
  2. or download this
        X(Y) : Z
    
  3. or download this
        $GLOBAL  = "static";
        $LOCAL   = "dynamic";
    ...
        }
        
        global_scope();
    
  4. or download this
        global scope:        static,dynamic,lexical 
        evaluation context:  static,dynamic,lexical
    
  5. or download this
        sub local_scope {
            local ($LOCAL) = "-------";
    ...
        print "\n";
        print "but outside local_scope(), we still have:\n";
        show_evaluation_context();
    
  6. or download this
        local scope:         static,-------,lexical 
        evaluation context:  static,-------,lexical 
        
        but outside local_scope(), we still have:
        evaluation context:  static,dynamic,lexical
    
  7. or download this
        sub lexical_scope {
            my ($LEXICAL) = "-------";
    ...
        local_override();
        print "\n";
        lexical_scope();
    
  8. or download this
        lexical scope:       static,dynamic,------- 
        evaluation context:  static,dynamic,DYNAMICALLY RE-BOUND VALUE 
        
        lexical scope:       static,dynamic,------- 
        evaluation context:  static,dynamic,lexical
    
  9. or download this
        package Foo;
        
    ...
        print $Foo::VAR1, "\n";
        print $VAR1, "\n";
        print $VAR2, "\n";
    
  10. or download this
        VAR1 in package 'Foo'.
        VAR1 in package 'main'.
        VAR2 in package 'main'.
    
  11. or download this
        my $total = 0;
        for $i (1..10) {
            $total += $i;
        }
        print $total, "\n";
    
  12. or download this
        sub sum_of {
            my ($item, @list) = @_;
            return ((defined $item) ? $item + sum_of (@list) : 0);
        }
        print sum_of (1..10), "\n";
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://222451]
Front-paged by TStanley
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-19 20:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found