in reply to List of Numbers

Hi,

The
map { ($x < $_)? print "[$num{$_}]\n;: ($x = ($_ + $num_before) /2)? print "[$num($_)]\n";: next; $num_before = $_;}sort keys %num;
shall I guess give the mathematical implementation for the logic (just wrote not tested)

Replies are listed 'Best First'.
Re^2: List of Numbers
by Aristotle (Chancellor) on Jan 18, 2003 at 21:56 UTC
    Backslash found where operator expected at t line 4, near "]\" (Missing operator before \?) String found where operator expected at t line 4, at end of line (Missing semicolon on previous line?) syntax error at t line 4, near "print "[" (Might be a runaway multi-line "" string starting on line 2) Can't find string terminator '"' anywhere before EOF at t line 4.
    That's not even with warnings and strictures. Not to mention next doesn't work in map blocks.

    Makeshifts last the longest.