On Fri, 15 Dec 2006, Jeff Pang wrote:


What are you missing?You can write it as your way with no problem usually.
But don't do this under mod_perl,otherwise you'll get lost really.

You may write them like:

use strict;
my $ab=27;   # don't use $a,$b as variable's name since both $a and $b are used 
by perl's 'sort' function by default.
doit($ab);   # pass $ab to the subroutine distinctly

sub doit {
   my $s = shift;
   print "$s\n";
}

My only problem was that the variable in the subroutine was not declared
with my nor our, not on purpose. I didn't know that you could do that
when using strict. I always use my or our, so I hadn't encounter this
behaviour yet.

Thank you.
--
Jorge Almeida

--
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