#!/usr/bin/perl use warnings; use strict; use POSIX qw/ pow /; sub convert_from_base26 { my ($total, $exp); my ($val) = @_; $total += (ord($_) - (ord('a') - 1)) * pow(26, $exp++) for split('', lc(reverse($val))); return $total; } print "Enter a value: "; while (<>) { chomp; print convert_from_base26($_)."\n"; print "Enter a value: "; }