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

Re^2: Perl Modules

by jamroll (Beadle)
on Jun 20, 2017 at 17:43 UTC ( #1193162=note: print w/replies, xml ) Need Help??


in reply to Re: Perl Modules
in thread Perl Modules

oh yes. i am using exporter, don't get me wrong there. always.

Replies are listed 'Best First'.
Re^3: Perl Modules
by hippo (Chancellor) on Jun 20, 2017 at 22:16 UTC

    Well, here's an SSCCE showing chained packages, one of which is an Exporter, the other not. Compare and contrast.

    #!/usr/bin/env perl use strict; use warnings; package pm::security; use Exporter; our @ISA = ('Exporter'); our @EXPORT = ('banned'); sub banned { print "Banned: @_\n"; } 1; package user; pm::security->import; # If in separate files, "use pm::security;" will + do. sub do_stuff { # We call banned without its package prepended because banned is # exported by package pm::security banned (@_); } 1; package main; # If in separate files, "use user;" here # We call do_stuff with its package prepended because do_stuff is not # exported by package user. user::do_stuff ('foo', 'bar');

    If your packages behave differently then you'll have to provide a similar SSCCE displaying the precise problem in order for others to help you get to the bottom of it.

      neat. i will pay attention to this SSCCE document from now as best i can.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2021-06-15 11:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (70 votes). Check out past polls.

    Notices?