On Jun 3, 2013, at 4:01 PM, Rahim Fakir wrote:

> Iam using win 7 64bits, and i downloaded Strawberry, and I use Perl PAckage 
> Manager to install modules, insted of Cpan command.
> I know how to install them, but I need instrucions how to use them, step by 
> step, how-to run the modules.

Each module is used differently. Almost all modules can be included in your 
program with the statement (usually near the beginning of your program):

  use Module;

where you substitute the name of the module you are going to use for "Module". 
This statement imports the module's program statements into your program. This 
happens at compile time, no matter where in your program you actually put the 
'use' statement.

You can also import modules using 'do' or 'require', but you need to know what 
those do and why to use them before you use them instead of 'use'.

Modules come in two flavors: procedural and object-oriented. Some modules 
support both flavors. Most modules come with built-in documentation that 
describes how to use them, usually including some sample code statements. To 
access the documentation, you can do the following on a command-line:

        perldoc Module

Strawberry Perl may afford another way of accessing documentation.

Procedural modules will import functions into your namespace, so you can just 
call these functions as if they were part of built-in Perl or part of your own 
program.

Object-oriented modules allow you to create "objects" of the module class, and 
call methods of those objects. To create an object instance of the Module class:

  my $object = Module->new();

The new() method is a convention. It could be called anything, but most OO 
modules use a new() method for object creation, Some new() methods take 
arguments.

To call a method on the object:

  $object->method();

See the documentation for each module to find out what functions and methods 
are available.

There are Perl tutorials for using modules and doing object-oriented 
programming:

  perldoc perlmod
  perldoc perlmodlib
  perldoc perlmodstyle
  perldoc perlmodinstall
  perldoc perlboot
  perldoc perltoot
  perldoc perltooc

Good luck!




--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to