Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

MOPT-03 - identification, part 1

by mstone (Deacon)
on Dec 27, 2002 at 02:08 UTC ( #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";
  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";
  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) = "-------";
        print "\n";
  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?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2020-02-22 04:54 GMT
Find Nodes?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?

    Results (98 votes). Check out past polls.