Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: Split int into segments of max int 26

by choroba (Bishop)
on Sep 13, 2017 at 11:44 UTC ( #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 (Vicar) 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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1199293]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2018-05-26 12:36 GMT
Find Nodes?
    Voting Booth?