#!/usr/bin/perl -w use strict; my $line; my $element; my @list; while ($line = <DATA>){ chomp $line; unless ($line =~ /^\s*$/) { push(@list, $line); } } foreach $element(@list){ print "my remaining lines are: $element\n"; } __DATA__ 1 1 Foo Bar Baz 2 2 Foo Bar Baz __END__
In reply to Re: replacing blank lines
by Tuna
in thread replacing blank lines
by indapa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |