From david at wwns.com Thu Dec 16 00:35:51 2004 From: david at wwns.com (David R. Wilson) Date: Thu Dec 16 00:30:21 2004 Subject: [Nashville-pm] How do I handle this? Message-ID: <1103178951.25761.4.camel@theo.wwns.com> I have a string that has multiple lines including cr/lf sequences embedded in the string. I am trying to send this to a file ie: open (FILE,">file.txt"); print FILE "$string"; close (FILE); if I add in a line "print $string" it will output the data to the screen. What is a good way around this? Thanks From tilghman at mail.jeffandtilghman.com Thu Dec 16 10:31:56 2004 From: tilghman at mail.jeffandtilghman.com (Tilghman Lesher) Date: Thu Dec 16 10:32:05 2004 Subject: [Nashville-pm] How do I handle this? In-Reply-To: <1103178951.25761.4.camel@theo.wwns.com> References: <1103178951.25761.4.camel@theo.wwns.com> Message-ID: <200412161031.57011.tilghman@mail.jeffandtilghman.com> On Thursday 16 December 2004 00:35, David R. Wilson wrote: > I have a string that has multiple lines including cr/lf sequences > embedded in the string. > > I am trying to send this to a file ie: > open (FILE,">file.txt"); > print FILE "$string"; > close (FILE); > > if I add in a line "print $string" it will output the data to the > screen. What is a good way around this? You can use select to change the default output to your filehandle, instead of STDOUT, i.e. select FILE;. Note that you can still write to STDOUT by specifying it, the same way you would a file, i.e. print STDOUT "something\n"; -- Tilghman From david at wwns.com Thu Dec 16 11:22:13 2004 From: david at wwns.com (David R. Wilson) Date: Thu Dec 16 11:16:42 2004 Subject: [Fwd: Re: [Nashville-pm] How do I handle this?] Message-ID: <1103217733.1447.13.camel@theo.wwns.com> Thanks Tilghman, I tried: select FILE; and then modifying the code past that to: print "$string"; close (FILE); That only sent the \r\n sequences to the file. Dave -------------- next part -------------- An embedded message was scrubbed... From: Tilghman Lesher Subject: Re: [Nashville-pm] How do I handle this? Date: Thu, 16 Dec 2004 10:31:56 -0600 Size: 2909 Url: http://mail.pm.org/archives/nashville-pm/attachments/20041216/6332edfb/attachment.eml