Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!usc!snorkelwacker!bu.edu!xylogics!merk!alliant!linus!nixbur!nixpbe!nixsin!koerberm From: koerberm@nixsin.UUCP (Mathias Koerber) Newsgroups: comp.lang.perl Subject: keeping the text-format when using write Keywords: write Message-ID: <1104@nixsin.UUCP> Date: 20 Jul 90 07:47:05 GMT Organization: Nixdorf Regional HQ Pte Ltd, Singapore Lines: 60 Howdy, I just got perl running on my machine, and it really seems to be a fine thing. Just now I'm trying to write my first perl-script, and End-of-Day script which else i would have to write in sh (C is to inflexible when it comes to easily adding another procedure ..) Even better, I can keep a nice log using the format and write. But there my first problem begins. I try to do something like this: format SPOOL = @<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<<<<< $time, $description, $result ~~ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<<<<< $description, $result . then, when it comes to show an error, I do this: $result = <<"EOT"; There was an error in function xxxxx. This may be due to different reasons a) ..... b) ..... c) ..... remedies: a)... b)... c)... EOT write SPOOL; My problem is, that write squeezes as much as possible into the text, getting rid of my nice indents, newlines etc. I tried setting $: = "\n"; so that write has to break at the newline, without success. I don't care if it breaks ALSO where the line is full, but 'd like it to break on newlines and keep tabs whenever it finds them. Is there any way to do this? As I said, I am so green on perl, you could call me a cucumber :-) regards, Mathias. PS: My only documentation for perl is the man-pages. Can anyone recommend a good book that someone like me, who is more (not *very*) proficient on C,sh and the likes, can understand? MK -- Mathias Koerber |Tel: +65 / 7473828 ext 1852|Fax: +65 / 7474331 Nixdorf Computer Singapore|EUnet: koerber.sin@nixpbe |nerv: koerber.sin 2 Kallang Sector |uunet: uunet!linus!nixbur!koerber.sin Singapore 1334 |[Standard-disclaimer:All views personal... ]