#!/bin/perl -w use strict; my $file = shift or die; open my $fh, '<', $file; while (<$fh>) { while (m|.+?|g) { print $1 . "\n"; } }