The traditional approach to keeping an often-used function in a file is named a "module". You have already been shown the links to the modules and also links on how to install modules into a Perl.
Most likely, use lib will be enough, but a look at Yes, even you can use CPAN and/or local::lib won't hurt either.
In reply to Re^7: Can not use JSON module
by Corion
in thread Can not use JSON module
by tejD
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |