Skip to content

Instantly share code, notes, and snippets.

@llamerr
Last active November 6, 2017 16:54
Show Gist options
  • Save llamerr/4016895 to your computer and use it in GitHub Desktop.
Save llamerr/4016895 to your computer and use it in GitHub Desktop.
file_put_contents for perl
sub file_put_contents {
my $fh;
open($fh, '>>', "/some/path/file.txt") or die "Couldn't open: $!";
print $fh "\n";
print $fh @_[0];
print $fh @_[1];
close $fh;
}
file_put_contents("1:","new");
use Data::Dumper;
file_put_contents("1:",Dumper($cgi));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment