At 3:15 pm +0000 22/12/05, James Harvard wrote:

Is there any easy way to do this?

PS. The whole script, from which Peter quoted only the last bit in providing his genial one-liner, was as follows:



#!/usr/bin/perl
$f = "$ENV{HOME}/Documents/Eudora Folder/Mail Folder/Manningham" ;
sysopen F, $f, O_RDONLY ;
sysread F, $_, 1000 ;
if (/\015\012/) {
  $/ = "\015\012" ;
 } elsif (/\015/) {
   $/ = "\015" ;
 } else {
   $/ = "\012" ;
 }
 open F, $f ;
 for (<F>) {
   /^From: / and chomp and print "$_\n"
 }


At 10:45 am +0800 21/11/02, Peter N Lewis wrote:

You can do this with one regular expression which will pick up the first line ending:

 $/ = /(\015\012|\015|\012)/ ? $1: "\n";

   Peter.

Reply via email to