Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (11)
As of 2015-07-06 10:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (71 votes), past polls