$ pwd >! tmp_1 #### #!/usr/bin/perl -w use strict; use warnings; my ($util,$command,$redirect,$file); $util = "pwd"; $redirect = ">!"; $file = "tmp_1"; $command = sprintf("%s %s %s", $util, $redirect, $file); system($command); system("pwd >! tmp_1");