If you cannot read the documentation, the module might not have any (in rare cases): $ perldoc Module::Name If you can read the documentation the module is most likely installed. If you do not have that module, you can do the same thing with File::Find which is part of the standard library: use File::Find įollow_skip => join "\n", you simply need to check quickly to see if a module is available, you can check for its documentation. If you want a list of all of the Perl module filenames, you can use File::Find::Rule: use File::Find::Rule The standard library which comes with Perl just shows up as "Perl" (although you can get those with Module::CoreList). Inside a Perl program, you can use the ExtUtils::Installed module to show all installed distributions, although it can take awhile to do its magic. You can also use cpan's -a switch to create an autobundle file that CPAN.pm understands and can use to re-install every module: $ cpan -a # How do I find which modules are installed on my system?įrom the command line, you can use the cpan command's -l switch: $ cpan -l You can also use Devel::REPL which is an interactive shell for Perl, commonly known as a REPL - Read, Evaluate, Print, Loop. You can also examine the symbol table, get stack backtraces, check variable values, set breakpoints, and other operations typically found in symbolic debuggers. Now just type in any legal Perl code, and it will be immediately evaluated. The typical approach uses the Perl debugger, described in the perldebug(1) manpage, on an "empty" program, like this: perl -de 42 (not a man-page but still useful, a collection of various essays on Perl techniques)Ī crude table of contents for the Perl manpage set is found in perltoc. Have you read the appropriate manpages? Here's a brief index: #Basics # perldata - Perl data types # perlvar - Perl pre-defined variables # perlsyn - Perl syntax # perlop - Perl operators and precedence # perlsub - Perl subroutines #Execution # perlrun - how to execute the Perl interpreter # perldebug - Perl debugging #Functions # perlfunc - Perl builtin functions #Objects # perlref - Perl references and nested data structures # perlmod - Perl modules (packages and symbol tables) # perlobj - Perl objects # perltie - how to hide an object class in a simple variable # Data Structures # perlref - Perl references and nested data structures # perllol - Manipulating arrays of arrays in Perl # perldsc - Perl Data Structures Cookbook #Modules # perlmod - Perl modules (packages and symbol tables) # perlmodlib - constructing new Perl modules and finding existing ones #Regexes # perlre - Perl regular expressions # perlfunc - Perl builtin functions> # perlop - Perl operators and precedence # perllocale - Perl locale handling (internationalization and localization) # Moving to perl5 # perltrap - Perl traps for the unwary # perl # Linking with C # perlxstut - Tutorial for writing XSUBs # perlxs - XS language reference manual # perlcall - Perl calling conventions from C # perlguts - Introduction to the Perl API # perlembed - how to embed perl in your C program #Various Have you looked at CPAN (see perlfaq2)? The chances are that someone has already written a module that can solve your problem. This section of the FAQ answers questions related to programmer tools and programming support. When I tried to run my script, I got this message.I've read perlembed, perlguts, etc., but I can't embed perl in my C program what am I doing wrong?.Where can I learn about linking C with Perl?.Where can I learn about object-oriented Perl programming?.Where can I learn about CGI or Web programming in Perl?.Why don't Perl one-liners work on my DOS/Mac/VMS system?.Can I write useful Perl programs on the command line?.How can I compile my Perl program into byte code or C?.How can I hide the source for my Perl program?.How can I make my CGI script more efficient?.How can I free an array or hash so my program shrinks?.Is it safe to return a reference to local or lexical data?.How can I make my Perl program take less memory?.How can I make my Perl program run faster?.How can I write a GUI (X, Tk, Gtk, etc.) in Perl?.Where can I get perl-mode or cperl-mode for emacs?.Is there an IDE or Windows Perl Editor?.Is there a pretty-printer (formatter) for Perl?. How do I cross-reference my Perl programs?.How do I find which modules are installed on my system?.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |