Jamie Risk wrote: > > On the unix system in question, a lot of text files are sent via binary > method; particular culprits are samba users mounting unix drives from there > Windows/MAC machines. I understand that PERL sets $/ according to the sytem > it is running on; but that isn't always sufficient when I use chomp(). > Short of writing my own chomp_() to handle any system's text file, I was > wondering if there already existed a PERL command to strip trailing white > space (including various combinations fo CR & LF) regardless of the hosts > defined INPUT_RECORD_SEPERATOR (i.e. is there already a function to "handle" > this)?
No there is no easy way to handle this. The input record separator is a string so it can either be "\r" or "\n" or "\r\n" unlike AWK where the IRS can be a regular expression. The only sure method is to load the entire file, or a large enough portion of the file, and determine the line endings yourself. BTW, it is Perl or perl but never PERL. John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]