B
Brad Baxter
Consider the code below. My admittedly superficial understanding makes me
think that line 7 says essentially, "Copy the value of $right to $left."
My intuition, based on statements in documents like `perldoc perlsub`,
makes me wonder if line 10 may, on the other hand, mean something like,
"Copy the value of $right to the holding area where subroutine return
values are processed, and then copy the value from this holding area to
$left."
I ask only to get an idea of what might happen if the value of $right we
very large. I.e., would there not only be a copy of this hypothetical
large value in $right and $left, but also in this "holding area" (which
I'm not sure actually exists).
Thanks,
Brad
1 #!/usr/local/bin/perl
2 use warnings;
3 use strict;
4
5 our( $left, $right ) = ( 'left', 'right' );
6
7 $left = $right;
8 print $left;
9
10 $left = right();
11 print $left;
12
13 sub right{ $right }
think that line 7 says essentially, "Copy the value of $right to $left."
My intuition, based on statements in documents like `perldoc perlsub`,
makes me wonder if line 10 may, on the other hand, mean something like,
"Copy the value of $right to the holding area where subroutine return
values are processed, and then copy the value from this holding area to
$left."
I ask only to get an idea of what might happen if the value of $right we
very large. I.e., would there not only be a copy of this hypothetical
large value in $right and $left, but also in this "holding area" (which
I'm not sure actually exists).
Thanks,
Brad
1 #!/usr/local/bin/perl
2 use warnings;
3 use strict;
4
5 our( $left, $right ) = ( 'left', 'right' );
6
7 $left = $right;
8 print $left;
9
10 $left = right();
11 print $left;
12
13 sub right{ $right }