in reply to Scalar assignment question

The parentheses indicate list context. For example:
my @fred = qw(42 43 44 45); my ($q, $x, $y, $z) = grep /\d+/, @fred; print "$q $x $y $z\n";
I don't think you would be surprised at the result:
42 43 44 45
So $q is 42. Now remove $z:
($q, $x, $y) = grep /\d+/, @fred; print "$q $x $y\n";
Now we get just 42 43 44That is $q has not changed. Now remove $y:
($q, $x) = grep /\d+/, @fred; print "$x\n";
and we get
42 43
$q still is unchanged. Finally remove $x:
($q) = grep /\d+/, @fred; print "$q\n";
and $q is still:
42