On Saturday, May 25, 2002, at 01:59 , [EMAIL PROTECTED] wrote:
[..]
> I have a list of the following format that I want to
> parse:-
>
> ((sa1 da1 sp1 dp1 p1) (sa2 da2 sp2 dp2 p2) .... (saN daN
> spN dpN pN)  )
>
> there are N entries.
[..]
> I was wondering if there is a single-shot method of
> parsing the whole thing.

something like:

        if ( $line =~ m/$louter(.*)$router/xo ) {
                push(@array_oh_array,[ split(/ /, $_)]) for (split(/$inner/, $1));
        }

which is the 'flat-ish' liner for what we do below, but
It is bordering on the unparsable.

> Any comments or ideas are
> appreciated.

sorta depends on what you really want to do here....

based upon your regEx I presume you are getting that back in
a scalar variable - and I'm not sold on the following but it
may help you work the longer more flexible approach to turning
that singular scalar into an array of arrays.

cf:
http://www.wetware.com/drieux/pbl/RegEx/PackListProb.txt


ciao
drieux

---


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to