Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Split int into segments of max int 26

by choroba (Cardinal)
on Sep 13, 2017 at 11:44 UTC ( [id://1199293]=note: print w/replies, xml ) Need Help??


in reply to Split int into segments of max int 26

Use Math::Base::Convert :
#! /usr/bin/perl use warnings; use strict; use feature qw{ say }; use Math::Base::Convert; my $converter = 'Math::Base::Convert'->new(10, ['A' .. 'Z']); say $converter->cnv(1000);

The strings will be a bit different to what you proposed, as A stands for 0 (thus it's A, B, C, ..., Z, BA, BB, BC, etc.), but it's not clear whether it matters.

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^2: Split int into segments of max int 26
by thanos1983 (Parson) on Sep 13, 2017 at 14:28 UTC

    Hello choroba,

    That is a nice approach, I had not idea about the module.

    Thanks for sharing.

    BR / Thanos

    Seeking for Perl wisdom...on the process of learning...not there...yet!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (7)
As of 2024-03-28 10:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found