$ cat myscript.pl
#!/usr/bin/perl -w
use strict;
...
use lib('.');
use MyModule;
...
my $thingy = new MyModule ( 'thing2' );
print "yeah!\n" if $thingy->is_thing();
print "boo!\n" unless $thingy->is_thing();
####
$ cat MyModule.pm
package MyModule;
use strict;
my @things = (
'thing1' ,
'thing2' ,
'thing3' ,
);
sub is_thing {
my $self = shift;
my $t = $self->{'thing'};
return grep /^$t$/, $things;
}
...
1;
####
#use lib('.');
#use MyModule;
####
$ cat myscript.pl MyModule.pm > newscript.pl
$ ./newscript.pl
$ boo!