By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,180 Members | 2,053 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,180 IT Pros & Developers. It's quick & easy.

how to use this require_ok($file);

P: 28
Hai!


In Perl manual i found :
require_ok($file);
but what is this file( what file & is any extension needed). i got require_ok($module);

Please give some examples.
Jan 22 '07 #1
Share this Question
Share on Google+
4 Replies


KevinADC
Expert 2.5K+
P: 4,059
require_ok() is a function but not a core perl function, $file is a scalar, presumably the name of a file, that is being passed to the function. If you are asking how to "require" a moule in a perl script that is not the way to do it.

http://perldoc.perl.org/functions/require.html
Jan 22 '07 #2

P: 28
but what i need is regarding the automated test ing in Perl. It is the Perl funtion which is inbuilt. you can find in "man perldoc Test::More" (i.e, manual pages of Perl).

It would be great if you can give some information.
Thank you.
Jan 22 '07 #3

miller
Expert 100+
P: 1,089
http://perldoc.perl.org/Test/More.html

require_ok is simply a test to determine if a module or file can be can be require'd. This is often the first test done by cpan module authors.
Jan 22 '07 #4

KevinADC
Expert 2.5K+
P: 4,059
Test::More is a module, it may very well have a require_ok() function. I don't know anything about that module myself or how to use it.
Jan 22 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.