Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: How to build a better mousetrap (or a variable to hold a column-measuring scale)

by AnomalousMonk (Bishop)
on Sep 10, 2019 at 01:09 UTC ( #11105918=note: print w/replies, xml ) Need Help??


in reply to How to build a better mousetrap (or a variable to hold a column-measuring scale)

Sorry for the wrap-around.

c:\@Work\Perl\monks>perl -wMstrict -le "my $old = '|---+----10---+----20---+----30---+----40---+----50---+----60---+- +---70---+----80---+----90---+----100--+----10---+- ---20---+----30---+----40---+----50---+----60---+----70---+----80---+- +---90---+----200--+----10---+----20---+----'; print qq{>$old<}; ;; my $fill = '--+----'; ;; my $new = qq{|-$fill}; $new .= grad($_*10) . $fill for 1 .. 22; die 'nope' unless $new eq $old; print qq{>$new<}; ;; sub grad { return $_[0] % 100 ? $_[0]%100 . '-' : $_[0]; } " >|---+----10---+----20---+----30---+----40---+----50---+----60---+---- +70---+----80---+----90---+----100--+----10---+---- 20---+----30---+----40---+----50---+----60---+----70---+----80---+---- +90---+----200--+----10---+----20---+----< >|---+----10---+----20---+----30---+----40---+----50---+----60---+---- +70---+----80---+----90---+----100--+----10---+---- 20---+----30---+----40---+----50---+----60---+----70---+----80---+---- +90---+----200--+----10---+----20---+----<


Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2020-01-28 19:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?