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

Re^4: package vs module? (zentara package/module tutorial)

by Anonymous Monk
on Mar 27, 2014 at 11:19 UTC ( [id://1079904]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl --
    use strict; use warnings;
    ZenTara::hello();
    ...
    package ZenTara;
    sub hello { print "\nHello\n"; }
    sub ZenTara::goodbye  { print "\nGoodbye\n" }
    
  2. or download this
    package ZenTara;
    use strict; use warnings;
    sub hello { print "\nHello\n"; }
    sub ZenTara::goodbye  { print "\nGoodbye\n" }
    1; ## return true
    
  3. or download this
    #!/usr/bin/perl --
    use strict; use warnings;
    use ZenTara;
    ...
    ZenTara::hello();
    ZenTara::goodbye();
    exit( 0 );
    
  4. or download this
    #!/usr/bin/perl --
    use strict; use warnings;
    use ZenTaraE;
    hello();
    ZenTaraE->new( name => "Bob" )->goodbye();
    exit( 0 );
    
  5. or download this
    package ZenTaraE;
    use strict; use warnings;
    require Exporter;
    ...
        print "\nGoodbye $name\n"
    }
    1; ## return true
    
  6. or download this
    #!/usr/bin/perl --
    
    BEGIN {
    ...
    ZenTaraEI->new( name => "Bob" )->goodbye();
    exit( 0 );
    exit( 0 );
    
  7. or download this
    
    $ perl zen-pack.pl
    ...
    Goodbye Bob
    
    $
    

Log In?
Username:
Password:

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

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

    No recent polls found