in reply to (jcwren) RE: RE: RE: Re: something about improving code...
in thread something about improving code...

I didn't know we were golfing... :-)
my ($START, $STOP) = qw(START STOP); while (<DATA>) { print (($where = /$START/../$STOP/ and $where !~ /^1$|E/) ? "PRINTIN +G" : "not printing"; }

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
RE: RE: RE: RE: RE: Re: something about improving code...
by cwest (Friar) on Jun 28, 2000 at 04:20 UTC
    Just because it's lying wide open... You've got a syntax error, ((close your parens :)

    And because I can't help this either... ( not simpler, just uglier... or is it? )

    my ($START, $STOP) = qw(START STOP); print( do {$_ = /$START/../$STOP/; $_ && $_ !~ /^1$|E/} ? "PRINTING\n" + : "not printing\n") while <DATA>;
    Enjoy!
    --
    Casey