How do I include functions from another file in my

2020-01-25 05:13发布

This seems like a really simple question but somehow my Google-Fu failed me.

What's the syntax for including functions from other files in Perl? I'm looking for something like C's #include "blah.h"

I saw the option for using Perl modules, but that seems like it'll require a not-insignificant rewrite of my current code.

标签: perl include
8条回答
Viruses.
2楼-- · 2020-01-25 05:45

Also, do 'file.pl'; will work, but modules are the better solution.

查看更多
贪生不怕死
3楼-- · 2020-01-25 05:50

What are you looking for is 'require file.pl', but what you should be looking at is 'use module'.

查看更多
登录 后发表回答