On Oct 7, Dave Thacker said:
Given this test file.
--start-
this
is
my file
end--
I want to skip the blank lines and just print the lines with text, like this
When you say "blank", do you mean lines with NO characters at all (other
than the ending newline) or lin
> -Original Message-
> From: Dave Thacker [mailto:[EMAIL PROTECTED]
> Sent: Friday, October 07, 2005 07:05
> To: beginners@perl.org
> Subject: Skipping blank lines while reading a flat file.
>
>
> Perl 5.6 on linux
>
> Given this test file.
> --start-
> this
>
> is
>
> m
Dave Thacker wrote:
> Perl 5.6 on linux
>
> Given this test file.
> --start-
> this
>
> is
>
> my file
> end--
> I want to skip the blank lines and just print the lines with text, like this
> this
> is
> myfile
>
> This is my test case code.
> #!/usr/bin/perl -w
>
Dave,
(this is one I know :-) )
I want to skip the blank lines and just print the lines with text, like this
this
is
myfile
This is my test case code.
#!/usr/bin/perl -w
use strict;
my $opt_testfile="test-text.txt";
open (TS, $opt_testfile) or die "can't open file";
while () {
chomp;