--- Sean O'Leary <[EMAIL PROTECTED]> wrote:
> At 10:27 AM 4/24/2001, you wrote:
> > Another possible solution is to use Brian Ingerson's Inline.pm and
> > code the reads &c. with C's lower level IO. I think a C getc()
would 
> > do it....
> >
> > But be warned that, while it's actually quite friendly, a raw
> > beginner might have some trouble with the Inline stuff, especially
> > if they don't know C. I'd say look, maybe try, and decide based on
> > your own confidence.
> >
> >Good luck.
> 
> Whoa there, Cowboy!  : )

Yee-ha! lol!

> Inline is way cool, but it's not even really stable yet. 

Mine's been stable as a rock. Never occurred to me it wasn't.
Have to keep that in mind.

> I mess around with it (when I want to be in awe of infinitely
superior
> programming prowess) but I don't think that people just getting into
> Perl want to be worrying about things like finding the right .h file
> that defines their system's getc function, and other such
shenanigans. 

Er? Again, guilty, never occurred to me.
That is, however, why I put in the caveat to people who don't know C.
(See above)

> Plus, a lot of people here might not even have a C compiler. 

Again, see above caveat.
For those of you who might have been confused by this, my apologies.

> (Remember, us Win32 punks usually have to pay some bucks for a good
> one, or have to be compiler gurus ourselves to get GCC set up.)

lol!! True enough.

> But all that's moot, considering that Perl has getc(), and will use
> your system's if it can find it.  

Not on mine. Perl's getc() on this system requires that there be
something in the buffer, which there isn't until you put in a newline.
Screwy design, but it's what we got. =o)

> But bear in mind, doing this you are bypassing a lot of Perl's IO
> niceness, and will have to handle stuff that you don't need to handle
> anyway.

AMEN! (and no sarcasm intended!)

> And it will break when you move the program somewhere else, or if you
> decide you need to read Unicode or something.

Again, agreed!

> So, I guess my point is, this is a solution, and TMTOWTDI, but
> there's a pretty high bar to being able to implement this, not to
> mention that I can't think of a really good reason to do it, beyond
> hubris, which usually isn't a very good reason.

Because on some systems it would work, and the person might have no
interest in portability. If all they want is for their code to work,
and they *do* have a good compiler and familiarity with C, it's one
possible solution (I'm not familiar with ReadTerm). I've written some
horrible code before just because nothing else I tried worked. Also,
since you mention win32, remember Perl's extended motto for windoze:
There's more than one way to do it, and for Windoze that's a good
thing, 'cause lot's of them don't work! ~lol~

Still, I was aware that it was an unlikely solution. I just posted it
because it was the possibility I could come up with that might work on
the system *I'm* using. (I'll have to look at ReadTerm, though.....)

> I guess since this is a beginner's list we should try to keep the
> ideas simple, flexible, and reliable.

Duly chastised, I in fact agree. <grin>
 
> I'm not suggesting that I'll always have the right answers.  I've not
> been writing Perl very long, and am discovering new stuff daily.  I
> also have an admittedly limited background in computer programming.  
> But I think your suggestion here isn't really a good one for a
> beginner, seeing as there is a simpler way to the exact same
> functionality ( Perl's own getc() )

Which doesn't work on my box....

> and even that is harder to use than the module.  Frankly, I was kinda
> scared of the code put around getc() in the examples, and 
> Anyway, I just think we should keep advice (because that is really
> what we are offering here) as generally useful and easy to follow as 
> possible.  Just my $0.02.

As valid as anyone's opinion, and admirably stated, if a touch long.
~smirk~

Keep up the good work, Sean, and keep me straight. ;o]
Better to make a fool of me for a day than to have possibly lots of
people spending many days working under the onus of bad advice I might
have given. 

Paul

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

Reply via email to