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

Re: [MacPerl] Perl vs MacPerl constructs?




In Regards to your letter <199601100944.KAA14670@yggdrasil.ethz.ch>:
:  In message <D2150039.hhcngu@udwarf.tymnet.com> you write:
:  >  This is probably a dumb question, but I haven't had time to get the current
:  >FAQ and scan it lately, so I thought I'd ask the list... please don't berate
:  >me for asking first...
:  
:  I think Judith Martin (a.k.a. Miss Manners) would have something to say about
:  asking questions without bothering to read the documentation, but anyway,
:  here's your answer (which, in fact, you probably wouldn't have gotten from the
:  MacPerl specific documentation). 

Well, actually... I had read the documentation about a year and a half ago...
but I hadn't read it more recently, especially after all the nice new work that
Hal and others had done on it.  Sorry I wasn't more precise.
:  
:  >  The variable $/ is supposed to contain the input record separator...
:  It does.
:  
:  >and when
:  >I've tried reading some files which are actually separated by \012 (newline)
:  >coming from my UUCP client software, then the entire file (or as much as will
:  >fit in a single buffer) gets read on each  'while ( $line = <FILE>)'  statement.
:  
:  Yes. One aspect of MacPerl that is somewhat puzzling to people with an Unix
:  background is that "\n" stands for "\015", not for "\012". If you want the
:  latter, write it out.

FYI... I knew that this wasn't the problem... for I understand quite well the
differences between \012, \015, and \015\012 eol sequences on various machines,
unix, mac, (ugh) DOS, and many mainframe and mini computer systems.
:  
:  Fair enough. Do
:  
:  $oldfh = select(FILE);
:  $/ = "\012";
:  select($oldfh);
:  
:  You probably forgot the select statements when you tried this ($/ applies only
:  to the current file handle).
:  
:  Matthias
:  

**** Ding Ding Ding Ding ****
This was exactly the problem.... not doing the select, or not setting the $/
                                 on the file handle AFTER opening the file.
                                 I had forgotten that there is no "global"
                                 state for the file handle based variables.

Thanks again to Matthias, and the list for exactly the response I needed. I
guess a code sample would have identified the root of the problem right off.

-Carl


Catalyst Industries -- Carl A Baltrunas <carl@1unique.com>
The One-Stop shareware registration and distribution service
URL:  <http://www.reststop.com>    INFO: info@1unique.com
-- owned by EWBR & EWBR-ette [our bunnies] and Czazu [our dog] --