Trying to figure out hash references and methods.

Why does the  "print $exp" work in case1,
while in case2 it only prints the hash reference?
Is it that critical that the explain method is on a separate line?
Or why does the print statement enable the "$exp->explain"
to work, as in the last line?

##################################################
#!/usr/bin/perl 
use warnings;
use strict;
use YAPE::Regex::Explain;                                                      
my $regex = 's/^(.{200}).*$/$1/';

#case1
################################################
my $exp = YAPE::Regex::Explain->new($regex)->explain;
print $exp;  #this works
###############################################


#case2
###############################################
my $exp = YAPE::Regex::Explain->new($regex);
$exp -> explain;
print $exp;  # this just gives the HASHreference
print $exp->explain;  #this works 
################################################





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to