Indeed. Your module says:
my $hello = hello(); sub hello { my $h = shift; return; } print $hello;
So $hello is given the return value of hello() which is undef. You probably want to return $h instead.
PS. I would strongly advise naming your variables and your subroutines with different names, otherwise it's going to get very confusing very quickly.
PPS. and as stevieb quite rightly says, pass an argument when you call hello().
In reply to Re^3: Passing value to a Perl module
by hippo
in thread Passing value to a Perl module
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |