巫妖王
巫妖王

Reputation: 425

CGI/Perl "use" function

use API;
use Database;
use Routines;
use Encode qw/encode decode/;
use CGI;
use CGI::Carp;
use File::Basename;
  1. how can i know where those module come from?
  2. what kind of doc should i download to see implementation of those function inside these modules?

Thank you in advance, guys. lol

Upvotes: 2

Views: 120

Answers (1)

mu is too short
mu is too short

Reputation: 434685

You can use perldoc -m to see the package's content:

$ perldoc -m CGI
package CGI;
require 5.004;
use Carp 'croak';
...

Or the -l switch to see where the package is:

$ perldoc -l CGI
/System/Library/Perl/5.10.0/CGI.pm

You can also find all the source at CPAN. Just looking at a single file in isolation generally isn't that fruitful, you'll want to look at all the files in the distribution as a coherent whole.

You'll probably want to familiarize yourself with the other things that perldoc can do:

http://perldoc.perl.org/perldoc.html

Upvotes: 6

Related Questions