Just random mumbling
Time pass to be honest,may work as a reference later,I am not sure.
Wednesday, October 19, 2022
Pass by value example in perl
sub
cube
{
my
$num1
=
@_
[
0
];
#num1 parameter passed by value here
return
$num1
*
$num1
*
$num1;
#cube of num1 returned
}
$answer
= cube
(
3
);
#function cube called with 3 passed as the argument
print
$answer
;
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment