Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: How to format such a string?

by RichardK (Parson)
on Jun 16, 2013 at 00:34 UTC ( #1039169=note: print w/replies, xml ) Need Help??


in reply to How to format such a string?

What are your rules to transform the input string to the output string?

I don't see any obvious connection, so can't help much.

Once you've sorted out the rules then I'd use split,length & join

Replies are listed 'Best First'.
Re^2: How to format such a string?
by Anonymous Monk on Jun 16, 2013 at 00:45 UTC
    It is actually the boundaries of the small substrings... So, in my example, you have: i3-12o36-45i76-88o, which means that the "original" string starts with i, then from 3-12 we have M, then we have o, then from 36-45 we have M again, then i etc...

      Ok -- is your output format fixed? I think run length encoding could be more compact and easier to work with, but maybe that's just me.

      So your string would rle as 2i10M23o...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1039169]
help
Chatterbox?
[Corion]: Meh. My bank removed (part of) their CSV download facilities. Now I will either have to implement a full scraper or automate the download using the HBCI interface instead (or just get a new account elsewhere...)
[Corion]: On the upside, I spend a lot of time thinking this weekend about how to actually implement rate limiting for futures, and if things work out, maybe even loading a configuration from an external file makes sense
[Corion]: I've also found some interesting invariants that I have to think/write about more. A simple rate limiter will never change the order of the input, while a limiter that allows for parallel execution will change the order. But my API currently allows for bo
[Corion]: ... for both, and I'm not sure if I want to add the cruft from the parallel API (a token that you need to hold on to while you hold the lock) to the rate limiting API too, to allow seamless up/downgrades, or not.
[Corion]: Also, rate limiting will look great with await: my $token = await $limiter-> limit($hostname); instead of my $f = $limiter->limit( $hostname )->then(sub { my( $token)=@_; ... });

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2017-10-23 08:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (277 votes). Check out past polls.

    Notices?