http://qs321.pair.com?node_id=270366


in reply to Alpha base-26 to base-10...


Here is some similar code that I wrote a while ago as part of Spreadsheet::WriteExcel::Utility. The code is verbatim although I was tempted to take out some of the parentheses:
# Convert base26 column string to number # All your Base are belong to us. my @chars = split //, $col; my $expn = 0; $col = 0; while (@chars) { my $char = pop(@chars); # LS char first $col += (ord($char) -ord('A') +1) * (26**$expn); $expn++; }

As an aside. Any particular reason for using POSIX::pow()?

And as another aside the POSIX strtol() function will convert base 26 (or bases from 2 to 36) to base 10, although not for this base 26 format.

--
John.