[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Problems with line of unix file.



On Mon, May 08, 2000 at 05:42:36PM +0200, sergio@sicon.net wrote:
} Hello,  
}   
} I am making a script to process lines of a file coming from a linux and I don't get 
} him to recognize the end of line since it doesn't interpret it correctly and it 
} understands the whole file like an only one lines. Is it possible that the script 
} recognizes the unix end of line?. The skeleton of the script that I am using is the 
} following one.  
}   
} ...  

Change the input record separator to the one that Unix uses:

$/ = '\012';

} open (ENTRADA , "filename.log");  
} open (SALIDA, ">>filename2.processed");  
}   
} $l1 = <ENTRADA>;  
} while($l1 ne ""){  
}   #Process with l1  
}   ....  
}   ....   
}   print SALIDA ($linea);  
}   $l1 = <ENTRADA>;  
} }  
} close ENTRADA;
}   
} In the line "$l1=<ENTRADA>" it loads the whole file and like it is a big file, I have 
} memory problems and the process is slow.  
} Is there some solution?  
}   
} Thank you for your time.  
}   
} A greeting  
} 
} Sergio Montoro
} -------------------------------------------------
} Sergio Montoro Rodriguez <montoro@sicon.net>
} Dpto. Nuevos Productos.
} SiCon. Sistemas Integrados de Conectividad.
} Finlandia 21, Valencia E-46010
} Spain
} Tel +34 963 621 321  Fax +34 963 619 552
} <sicon@sicon.net> <http://www.sicon.net>
} -------------------------------------------------
} 
} # ===== Want to unsubscribe from this list?
} # ===== Send mail with body "unsubscribe" to macperl-request@macperl.org
} 
} 

-- 
Paul Schinder
schinder@pobox.com

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org