in reply to alias of a variable

By making use of the Alias module perhaps?
$ perl -MAlias -E 'alias foo => $!; for (1 .. 10) {$! = $_; say $foo}' Operation not permitted No such file or directory No such process Interrupted system call Input/output error No such device or address Argument list too long Exec format error Bad file descriptor No child processes