in reply to Re: Parsing
in thread Parsing tips

Ok - you changed your input file again :).
change the regexp to !/^PR:/ or if you are worried about changeing data !/^pr:/i to make it case insenesitive.

Also the sort should look something like this:
$len = length( (sort {$a <=> $b} @s)[0]);


UPDATE: Whooops that sort was waaay off
$len_stmts   = (sort {$b <=> $a} map {length} @stmts  )[0];

grep
grep> chown linux:users /world

Replies are listed 'Best First'.
Re: Re: Re: Parsing
by smgfc (Monk) on Feb 12, 2002 at 00:02 UTC
    well i havent dealt with the parsing yet, but I am having trouble with the sort stuff. The foreach loops work great but the
    $len = length( (sort {$a <=> $b } @s)[0]); $lent = length( (sort {$a <=> $b } @r)[0]);
    gives weird results:
    ___________________________________|______________ 1. D midpoint side AB | G 2. F midpoint side AC | G 3. segment ED median | def of median 4. segment BF median | def of median 5. segment AE median | only one line concurrunt with ot +her median 6. N point of concurrency of medians triangle ABC | def of point of + concurrency 7. segment NE / segment AN = 1/2 | median thm 8. point O point of concurrency triangle ABE | def of point of conc +urrency 9. (segment BP / segment PE) * (segment EN / segment NA) * (segment A +D / segment DB) = 1 | cheva 10. segment AD congruent segment DB | def of midpoint 11. m segment AD = m segment DB | docs 10 12. segment AD / segment DB | ? 13. segment AD / segment AD = 1 | sub 11 , 12 14. (segment BP / segment PE) * (1/2) * (1) = 1 | sub 7, 13, 9 15. segment BP / (segment PE * 2) = 1 | multiplication 14 16. segment BP = segment PE * 2 | cross multipy 15 17. segment BP / segment PE = 2/1 | division 16
    with errors for every numeric compare, so i changed it to cmp:
    $len = length( (sort {$a cmp $b } @s)[0]); $lent = length( (sort {$a cmp $b } @r)[0]);
    , but still, same results. And help would be great. The file i am running this on is available in my scratch pad, here scratch pad viewer