Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: reducing the number of lines

by tobyink (Abbot)
on Jan 11, 2013 at 17:06 UTC ( #1012923=note: print w/ replies, xml ) Need Help??

in reply to reducing the number of lines

Without any test data, it's hard to tell it this runs the same as your original, but...

my ($max, $cval, $inc_var, $sref, $d_or_b) = ($l == $k) ? ([$k,$lt], 0, undef, \@s, $b) : ($l < $k) ? ([$k,$lt], 2, \$j, \@s_rev, $d) : ([$l,$kt], 1, \$i, \@s, $b); $sref->[$d_or_b+1] ||= $max->[0] - 2 if $max->[0] > 2; $h = $s[$b] == 0 ? 0 : $s[$b]-1; $s[$b1] = max(@$max); $c = $cval; $$inc_var++ if $inc_var; $h = $c = 0 if ( $l==$k );

Update #1: Thanks choroba, colons fixed.

Update #2: Thanks choroba again for the test script template; minor adjustments, works now.

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Comment on Re: reducing the number of lines
Download Code
Replies are listed 'Best First'.
Re^2: reducing the number of lines
by choroba (Canon) on Jan 11, 2013 at 17:21 UTC
    Aren't you missing a colon somewhere?
    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1012923]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2015-11-29 18:22 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (752 votes), past polls