Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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'

Replies are listed 'Best First'.
Re^2: reducing the number of lines
by choroba (Bishop) 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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2018-02-26 02:01 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (316 votes). Check out past polls.