Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: how to make this perl code run

by kennethk (Abbot)
on May 16, 2013 at 14:42 UTC ( #1033845=note: print w/replies, xml ) Need Help??


in reply to how to make this perl code run

Sure, no problem. I'll give you the hint that it involves Exporter and some command-line flags. So is this homework or an interview?

Update: Well, since moritz put in a great solution, mine is

running perl -MJunk junk.pl on the command-line with
package Junk; require Exporter; our @ISA = 'Exporter'; our @EXPORT = qw|hi hello hola|; sub hi { "hi"; } sub hello { "hello"; } sub hola { "hola"; } 1;
in Junk.pm. moritz's feels more in the spirit of the question.

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Replies are listed 'Best First'.
Re^2: how to make this perl code run
by choroba (Chancellor) on May 16, 2013 at 15:08 UTC
    Your solution is similar to mine, in fact I started with a similar code, but then I reduced it to a point where Exporter is not needed.
    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
      I would argue that your code modifies the first 5 lines, whereas mine actually executes them.

      #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1033845]
help
Chatterbox?
[Your Mother]: :P
[Lady_Aleena]: Your Mother, it is a good thing I am no on Windows.
[Lady_Aleena]: s/no/not/;
[Lady_Aleena]: My blasted web host will not put perl 5.22 in /usr/bin/perl, it is in /usr/local/cpanel/ 3rdparty/bin/perl
Lady_Aleena has been banging her head against this wall for years now with no success on breaking the wall.

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2017-04-28 06:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (519 votes). Check out past polls.