Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: reducing the number of lines

by tobyink (Canon)
on Jan 11, 2013 at 17:06 UTC ( [id://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 (Cardinal) on Jan 11, 2013 at 17:21 UTC
    Aren't you missing a colon somewhere?
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2024-04-20 03:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found