my $var_one; sub copy_file { open(IFILE, ") {$x =~ s|(\$\w+)|$1|eeg; print $x}; close(IFILE); } copy_file();