Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: How to access a variable inside subroutine?

by jcb (Parson)
on Sep 05, 2020 at 19:44 UTC ( [id://11121385]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
      our $add;
      say $add;
    }
    
  2. or download this
    package Acme::Sample::Counter;
    
    ...
      my $self = shift;
      return $$self;
    }
    
  3. or download this
    my $counter = new Acme::Sample::Counter ();
    $counter->count;      # add 1
    $counter->count(10);  # add 10
    say $counter->read;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2024-04-18 12:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found