- or download this
my $x = 100;
my @y = (10, 20, 30);
...
}
local $" = ", ";
print "\$x = $x\n\@y = (@y)\n";
- or download this
# or:
foreach my $n ($x, @y) {
$n *= 2;
}
- or download this
map { $_ *= 2 } $x, @y;
- or download this
grep { $_ *= 2 } $x, @y;
- or download this
sub double {
foreach(@_) {
...
}
double($x, @y);