You can also use the she bangs (!#) for manipulation the enviroment. For example assume you want to create a particular enviroment for you script if you use
#!/usr/bin/perl
foreach (keys %ENV){
print $_ . " " . $ENV{$_}."\n";
}
You obtain the enviroment from which you run the script.
If you use:
#!/usr/bin/env -i perl
foreach (keys %ENV){
print $_ . " " . $ENV{$_}."\n";
}
You obtain nothing.
see
info coreutils env