#!/usr/bin/perl use strict; use warnings; my $file = $ARGV[0] or die "Usage: $0 "; open(my $fh, '<', $file) or die "Unable to open '$file' for reading: $!"; while (<$fh>) { next if /^(?:\s|[:cntrl:])/ || /^$/; s/^\S+\s//; print; }