#!/usr/bin/perl -w use strict; while () { print if !/^\s$/; } =prints This first non-"blank" line this is second non-blank line =cut __DATA__ This first non-"blank" line this is second non-blank line