outputting blank lines via the write command 
Author Message
 outputting blank lines via the write command

Hi,

I'd like to be able to print out a variable block of text using the write
command. I'm using the following test code and format definition:

$file = "data";
open(FILE1, $file) || die "Cannot open file \"$file\"";

while (<FILE1>) {
    $line .= $_;

Quote:
}

#print $line;       # this does the right thing!
write;

format =
~~^<<<<<<<<<<<<<<<<<<<<<<<<<
$line
.

Given the input data:

this is line 1

this is line 3

this is line 5

the above script outputs:

this is line 1  this is
line 3  this is line 5

The problem is that i've lost the blank lines in the output!!

Does anyone know how i can make the output to include the blank lines
using the variable length record format definition ?

Also, the output didn't break the lines on the "\n" character as i expected
it to.

Thanks in advance.

Jas



Sun, 17 Jan 1999 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. capturing command line error or output from `<command>`

2. Output of a command line command

3. format report blank line in output

4. Newbie needs help- trying to submit command-line function to perl script via web

5. Passing Args to script via web and command line

6. connecting to a Mysql via command line ok FAILs with perl

7. Passing How Do I Send Parseable values via the Command Line

8. work on command line and not via browser?

9. novice question: how import many lines of command output

10. Command line options Input >Output how?

11. command-line output re-direction in winNT

12. Unicode output in Command Line

 

 
Powered by phpBB® Forum Software