in reply to Fast file parsing

My first thought is, after you've answered all of your questions (#pages, simplex/duplex, pagesize, copies, title), why do you keep looking through the file? Why not do something like
my $more = 5; while ( $more && <FILE> ) { . . . # $more-- with each successful assignment so $more will be 0 when all +five variables are known . . . }

If I remember correctly, everything you need from your postscipt file is in the first few lines right?

- - arden.

Replies are listed 'Best First'.
Re: Re: Fast file parsing
by perrin (Chancellor) on Mar 05, 2004 at 20:01 UTC
    You could also exit the while loop with a "last" statement when you get them all. Might be easier to read.