thanks for this. As it now issues the warning (perl v5.36.0):
each on anonymous hash will always start from the beginning
I propose this variation: ($foo) = keys %{{$foo,0}}
Also, here is a test script using Test::Taint to check taintness:
#!perl -T
use strict;
use warnings;
use Test::More;
use Test::Taint;
my $foo = "ababab";
taint($foo);
tainted_ok($foo, "foo is tainted");
($foo) = keys %{{$foo,0}};
untainted_ok($foo, "foo is now untainted");
done_testing;