Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

(proposed)Scoping tutorial

by arturo (Vicar)
on Dec 19, 2000 at 22:48 UTC ( [id://47446]=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    
    ...
    }
    
    terminate("arturo"); # prints "the boss has canned arturo's sorry butt
    +"
    
  2. or download this
    #!/usr/bin/perl -w
    
    ...
    
    $Robert = "the boss";
    print "\$Robert = $Robert\n";
    
  3. or download this
    #!/usr/bin/perl -w
    
    ...
    
    $main::Robert = "the boss";
    print "\$main::Robert = $main::Robert\n";
    
  4. or download this
    #!/usr/bin/perl -w
    
    ...
    
    print "Here at work, 'Robert' is $Robert, but over at the pool hall, '
    +Robert'
    is $PoolHall::Robert\n";
    
  5. or download this
    #!/usr/bin/perl -w
    
    ...
    print "\$foo: $foo\n"; # prints "Hey!" -- the my variable's still in s
    +cope
    # if we hadn't made that declaration above, this would be an error: th
    +e
    # interpreter would tell us that Bar::foo has not been defined.
    
  6. or download this
    #!/usr/bin/perl -w
    
    ...
    sub showfoo {
        print "\$foo: $foo\n";
    }
    

Log In?
Username:
Password:

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

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

    No recent polls found