#swap two values
($a, $b) = (11, 12);
($b, $a) = ($a, $b);
print "$a\t$b\n\n";
($x,@y) = (1, 2, 3, 4);
print "\$x: $x\n";
print "\@y: @y\n\n\n";
(@x, $y) = (1, 2, 3, 4);
print "\@x: @x\n";
print "\$y: $y\n\n";
@array = qw(a a a a);
@array = 3 x @array;
print "@array";
__END__
12 11
$x: 1
@y: 2 3 4
@x: 1 2 3 4
$y:
3333
($a, $b) = (11, 12);
($b, $a) = ($a, $b);
print "$a\t$b\n\n";
($x,@y) = (1, 2, 3, 4);
print "\$x: $x\n";
print "\@y: @y\n\n\n";
(@x, $y) = (1, 2, 3, 4);
print "\@x: @x\n";
print "\$y: $y\n\n";
@array = qw(a a a a);
@array = 3 x @array;
print "@array";
__END__
12 11
$x: 1
@y: 2 3 4
@x: 1 2 3 4
$y:
3333
No comments:
Post a Comment