- or download this
sub double_it { $_[0] *= 2 }
my $x = 1;
print "\$x is $x\n";
double_it($x);
print "\$x is now $x\n";
- or download this
$x is 1
$x is now 2
- or download this
my ($url, @list) = @_;
- or download this
sub links {
my $url = shift; # This removes the first element of @_
map { "$url/$_" } @_; # You don't need return :)
}
- or download this
sub some_func {
# ... some stuff?
my ($foo, $bar, $baz) = @_;
# ... other stuff
}
- or download this
sub some_func {
my $self = shift;
...
my ($foo, $bar, $baz) = @_;
# ... other stuff
}