in reply to Monk Specs.?

I'm not sure what you mean by 'morally OK' and 'Monk specifiation' but you could write your code shorter as

while (<LOG>) { print LOGFILE $_ if /$date/..0; }

-- Hofmator

Replies are listed 'Best First'.
Re: Re: Monk Specs.?
by blakem (Monsignor) on Jan 17, 2002 at 01:03 UTC
    Nice. Its even shorter as:
    /$date/..0 and print LOGFILE while <LOG>;

    -Blake

Re: Re: Monk Specs.?
by particle (Vicar) on Jan 16, 2002 at 19:49 UTC
    wow. super cool one liner, Hofmator!

    can you explain to me the construct (specifically if /$date/..0;)? if i can understand it, i can use it :)

    ~Particle

      Read up on the bi-stable .. operator in perlop under 'Range Operators'.

      At first it evaluates to false. It changes its state to true once the condition on the left hand side (the regex matching $date) is true. It changes its state back to false when the right hand side is true. Here this is never the case (0) so the file is read until the end.

      -- Hofmator