Wednesday, January 12, 2011

To get the variable

Usually you would pass data as parameter to the function of the module.
in test.pm:
sub show {
    my $var = shift;
    print $var;
}
in test.pl:
use test.pm

show('test123');
this would print test123.

No comments: