in reply to Re^4: peek at STDIN, to determine data type and then pass STDIN to a parser
in thread peek at STDIN, to determine data type and then pass STDIN to a parser

Ok, I have had a chance to look at this - my statement above about it "treat it as just a file handle" is not quite accurate. It needs a little more support to make it look like an IO::Handle or a tied file handle. I am considering a self-project to be able to export an Iterator::Simple object as an IO::Handle object.

I have been using the iterators with the ->next() or <$iterator> syntax, so stating that they just behave like a file handle is definitely a mea culpa. Given a couple of days perhaps I can have something available that will wrap an iterator as a globish object. I will update here if/when that happens.

--MidLifeXis

Replies are listed 'Best First'.
Re^6: peek at STDIN, to determine data type and then pass STDIN to a parser
by aral (Acolyte) on Jan 12, 2015 at 13:54 UTC

    If you could find a way to do this that would be much appreciated. I would try it myself, but I am afraid I am still way too clueless about the lower level mechanics of perl :)

Re^6: peek at STDIN, to determine data type and then pass STDIN to a parser
by aral (Acolyte) on Feb 17, 2015 at 11:44 UTC

    I understand you've probably been too busy to get back to this. However, the idea and approach seemed very valuable, and I would therefore like to bump the topic, in case someone has the time and interest to come up with a solution to wrap the above iterator approach in a glob like object.

    Anyone? :)