Joseph C. Bautista wrote:

> Hi All,
> 
>        Is there a way in perl to pass arguments by value?  Normally it’s
> treating every arguments to be pass as a reference…

Perl normally passes by value - to pass by reference you would explicitly
do so or pass a value that is already a reference.

EG:

my $one = 1;
my $oneref = \$one;

mysub (1);      # will pass the value 1
mysub ($one);   

mysub (\1);     # will pass a reference to 1
mysub (\$one);  
mysub ($oneref);

You can test to see if the argument is a reference using 'ref'
command.
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to