use File::Util; sub write_file { my $path = shift; my $text = shift; my($f) = File::Util->new(); $f->write_file( 'file' => $path, 'content' => $text, 'bitmask' => 0777, 'mode' => 'write', ); }