#!/usr/bin/perl -l sub foo { open "/foo"; print 0+$!, " $!"; print 0+$_[0], " $_[0]"; } # not copied mkdir "/foo"; foo $!; print "---"; # copied with string interpolation mkdir "/foo"; foo "$!"; print "---"; # copied with temp scalar mkdir "/foo"; foo ${ \(my $t = $!) }; print "---"; # copied with array deref mkdir "/foo"; foo @{[$!]};