Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: dripping wet rank perl newbie ?:

by Wookie (Beadle)
on Jul 23, 2001 at 13:14 UTC ( [id://98942]=note: print w/replies, xml ) Need Help??


in reply to How to make a module which exports a function, takes a list and returns a list?

If you're having trouble with module logic - there is a pretty straight forward way to import subs without making it a module.

If you create a file containing your sub-routine (say called mysub.pl) something like:
#!/usr/bin/perl -w sub my_sub { code..... } 1;
Then in your program simply:

require mysub.pl;

that will include that sub in that program for you.

I don't know whether this is the most efficent way to do it - and you do lose the ability to hide variables etc. - but it is probably worth a try :).
game(Wookie,opponent) eq 'Wookie' ? undef $problem : remove_limbs(arms,opponent);

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2025-03-18 04:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When you first encountered Perl, which feature amazed you the most?










    Results (56 votes). Check out past polls.