Your syntax is wrong on the first example. It's not a => operator, it's my $handle = TeamSite::Config->new();
And that is one of the most common ways to instantiate an object using Perl's object system. The second example you gave, File::Copy, is not an object oriented module. Instead, it internally invokes the Exporter module to export the copy() subroutine into your main package namespace so that you can invoke it almost as if it were a built-in function.
So the first is an example of an Object Oriented module, and the second is a Module with a functional interface.
I would say to pick up a copy of Intermediate Perl, published by O'Reilly. It covers modules, and an introduction to Object Oriented programming. But it may be too big a bite to chew on if you're really new to Perl. If that's the case, start with Learning Perl (the Llama book), and then move on to Intermediate Perl.
There is also perlmod, and perltoot; Perl documentation that is free and explains modules and OO programming with Perl.
Dave
In reply to Re: Use of Handle to use subroutines in a module
by davido
in thread Use of Handle to use subroutines in a module
by manishrathi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |