Hi all,

I write a small script to see what is the difference
between  calling methods and regular subroutines. Then
I use Data::Dumper to see the data structure. What I
expecte is to print out a string(This is the data1 1
and data2 2) after using Dumper. But here are the
results I get from using Dumper;

$VAR1 = 1;


My question: What does it mean? Does it mean
successfully calling either a subroutine or method?

Thanks in advacne,

Li



##codes

use strict;
use warnings;
use Data::Dumper;
use Bar;

my $call=&Bar::print_result(1,2);#call as a regular
routine
print Dumper $call;
print "\n";
my $call2=Bar->print_result(2);#call as a method
print Dumper $call2;
print "\n";
exit;


##package Bar

package Bar;
use strict;
use warnings;

sub print_result{
                    my $data1=shift; 
                    my $data2=shift;                
                print "This is the data1 $data1 and
data2 $data2", "\n";
 }

1;

##screen output
This is the data1 1 and data2 2
$VAR1 = 1;

This is the data1 Bar and data2 2
$VAR1 = 1;


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to