http://qs1969.pair.com?node_id=305345


in reply to Using subroutine between scripts

You should definitely put it in a module. That's what code reuse is for; when you want to tweak the subs, you only have to do it once. @INC always include ., so you can put the module file in the same directory as the scripts themselves. If your scripts exist in many directories, then you could do use lib qw[ /module/dir /more/module/dir]; to tell perl to look in the correct directory.