Depends on what you consider elegant.
no warnings qw(once);
our ($a, $b);
One of these two will suffice. You can even limit their scope pretty easily.
my @sums = pairwise { no warnings qw(once); $a + $b } @x, @y;
my @sums = pairwise { our $a + our $b } @x, @y;
Explicitly specifying the package will suppress the warning too. If you're in main
,
my @sums = pairwise { $::a + $::b } @x, @y;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…