in reply to Where to put self-made loop logic (separate module)?
Something like this?
And you then call your function as follows:package My::Cunning::Module; use Modern::Perl; use Exporter qw/import/; our @EXPORT_OK = qw/looper/; sub looper { #admire my cunningly crafted loop logic function ... } 1;
use Modern::Perl; use My::Cunning::Module qw/looper/; # somewhere in your program looper($data) or die 'It did not work';
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
My blog: Imperial Deltronics
|
---|
In Section
Seekers of Perl Wisdom