answersLogoWhite

0

What is 'use' in Perl?

Updated: 10/26/2022
User Avatar

Wiki User

15y ago

Best Answer

The "use" command is the way to request additional features in perl.

For example, the statement

use Date::Parse;

will include the Date/Parse.pm module which provides two functions to parse date strings.

There are thousands of modules available and you may easily write your own modules for code that you use in several programs.

This answer naturally leads on to follow-on questions:

How do I know which features have been added by a particular "use" statement?

For standard modules (such as Date::Parse) that are usually installed on your computer, try the command

perldoc Date::Parse

on the command line. This should give you the documentation of the installed module. If this fails, go on to the next question.

For non-standard modules, you have to find the file Date/Parse.pm and look into it for documentation (this is not always informative).

Which modules are available for free?

Many Perl modules are distributed as free software. Go to http://www.cpan.org/ or http://search.cpan.org/ and browse/search the CPAN (Comprehensive Perl Archive Network).

Most likely you will initially be overwhelmed by the pure number of available modules --- but in most cases you will find that somebody has already posted some code for features that you need.

Documentation is included The "use" command is the way to request additional features in perl.

For example, the statement

use Date::Parse;

will include the Date/Parse.pm module which provides two functions to parse date strings.

There are thousands of modules available and you may easily write your own modules for code that you use in several programs.

This answer naturally leads on to follow-on questions:

How do I know which features have been added by a particular "use" statement?

For standard modules (such as Date::Parse) that are usually installed on your computer, try the command

perldoc Date::Parse

on the command line. This should give you the documentation of the installed module. If this fails, go on to the next question.

For non-standard modules, you have to find the file Date/Parse.pm and look into it for documentation (this is not always informative).

Which modules are available for free?

Many Perl modules are distributed as free software. Go to http://www.cpan.org/ or http://search.cpan.org/ and browse/search the CPAN (Comprehensive Perl Archive Network).

Most likely you will initially be overwhelmed by the pure number of available modules --- but in most cases you will find that somebody has already posted some code for features that you need.

Documentation is included

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is 'use' in Perl?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

When are Perl array variable sizes set up for use?

Perl auto-scales its arrays, so just use the array and let perl take care of the sizing.


What is the computer program Perl and how do you use it?

Perl is a programming language, and to use it requires many hours of reading about it and of practice writing programs in it.


How does one use the perl split function?

The Perl split function is used to split a string into smaller section. One can find a guide on how to use a Perl split function on various websites including Perlmeme.


How does one use the Perl chomp function?

The Perl Chomp function is a programming function that remove the "newline" character at the end of the string. One can use the Perl Chomp function to remove any character that has the same value as the current one.


Is PERL beneficial to Linux administrator?

Absolutely! In fact, Perl is usually integrated into the core of most Linux distribution userspaces because some of the most common system utilities use Perl.


How you redirect the output of the perl script into some file using perl script?

If the perl script outputs to the standard output device, use the I/O redirection operators (>, >>, |) to redirect it somewhere else.


What are two different ways to turn on warning in perl?

For Perl one-liner, use -w option on the command line. UNIX or Windows, use's the -w option in the shebang line (The first # line in the script). When using other systems, choose compiler warnings, or check the compiler documentation.


How use perl in bioinformatics?

Perl is a powerful and flexible scripting programming language, making it very helpful for manipulating data in bioinformatics research.


What are some facts about Perl?

Perl is a programming language. Perl is an interpreted programming language. Perl is very useful for shell scripts, application programming, and web applications. Perl is quite easy to learn. Perl can be, but does not have to be, object-oriented. Perl was created by Larry Wall. Perl has probably the best implementation of regular expressions in existence.


Where do you find a magicarp in Pokemon perl?

you use a old rod anywhere


Is there a way to get user input besides the command line in Perl?

Are you looking specifically for a Perl answer, or a general answer? Most shell environments can do this as well, use the 'read' command.


How do you edit PHP and Perl scripts?

I am asking the question?>>PHP ,Perl scripts can be edited with help of editors like Editplus,Notepad++ OR you can also use Zend IDE.