#!/usr/bin/perl use strict; use warnings; open my $fh, '>>', 'foo.txt' or die $!; print $fh "hello world\n"; close $fh;