in reply to (chromatic) Re: Strange Behavior while Parsing Sendmail logs
in thread Strange Behavior while Parsing Sendmail logs

Out of curiosity, what does phrasing it in that way buy you?

I thought maybe you were gaining an advantage from the short circuit of && so I wrote a benchmark, but the times came back so close together that the difference is easily attributed to background processes. So I ran the deparser and found that perl converts this to an if(){} structure, which is (as you said) easier to read.

E:\Projects>perl -MO=Deparse -we "my $s; $_ && do { $s = $_ }" my $s; if ($_) { $s = $_; } -e syntax OK

Replies are listed 'Best First'.
(chromatic) RE: Style Question
by chromatic (Archbishop) on Jul 19, 2000 at 07:06 UTC
    My guilty admission is that I just like the way it looks better.