#!/usr/bin/env perl use strict; use warnings; open my $fh, '>', 'my_file.txt' or die $!; while ( my $line = ) { print $fh $line; } close $fh;