in reply to Sub can't get $_ value?

Or you do the following instead (as I often do in my sub's).
my $num = shift;