Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Regexes on Streams

by Abigail-II (Bishop)
on Oct 11, 2003 at 02:34 UTC ( [id://298471]=note: print w/replies, xml ) Need Help??


in reply to Regexes on Streams

Well, this idea isn't new. It has (of course) been discussed on p5p. And was never implemented because noone could find a solution to the problems you list. What are you going to do with /.*;/, which basically asks you to find the last semi-colon in the stream?

Abigail

Replies are listed 'Best First'.
Re: Re: Regexes on Streams
by liz (Monsignor) on Oct 11, 2003 at 10:53 UTC
    What are you going to do with /.*;/,...

    When matching a stream, I would let this cause an execution error. In my mind, it's similar to division by 0. And that also causes an execution error.

    Liz

Re: Re: Regexes on Streams
by tsee (Curate) on Oct 11, 2003 at 07:19 UTC
    Nothing. Anybody asking for any *last* thing in a stream is asking for trouble! Streams are of infinite length by concept, which is something one should be aware of before trying to combine streams and regexes.

    So in brief: /.*;/ should yield the whole stream in-memory. Which is exactly what the author of the regex asked for.

    Steffen

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://298471]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-19 22:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found