I sometimes see Perl code like this:
my ( $variable ) = blah....
What is the point of putting parentheses around a single variable? I thou
The parentheses create a list context which affects how the right hand side of the assignment is evaluated.
Compare
my $x = grep { /s/ } qw(apples bananas cherries);
print $x;
with
my ($x) = grep { /s/ } qw(apples bananas cherries);
print $x;
You will often use this construction when you just want to grab the first element of a list and discard the rest.