Hello everyone. I'm writing a perl script to implement some active content on my website. Does anyone know if there is a source code library to convert an integer variable to an equivalent character string? I've managed to do the reverse, i.e.
sub char_2_int{
for ($c = 0; $c < 4; $c++)
{
$d = 3 - $c;
$e = 10**$d;
if ($data[$c] == 0) {}
elsif ($data[$c] == 1) {$hit_count = $hit_count + (1 * $e)}
elsif ($data[$c] == 2) {$hit_count = $hit_count + (2 * $e)}
elsif ($data[$c] == 3) {$hit_count = $hit_count + (3 * $e)}
elsif ($data[$c] == 4) {$hit_count = $hit_count + (4 * $e)}
elsif ($data[$c] == 5) {$hit_count = $hit_count + (5 * $e)}
elsif ($data[$c] == 6) {$hit_count = $hit_count + (6 * $e)}
elsif ($data[$c] == 7) {$hit_count = $hit_count + (7 * $e)}
elsif ($data[$c] == 8) {$hit_count = $hit_count + (8 * $e)}
elsif ($data[$c] == 9) {$hit_count = $hit_count + (9 * $e)}
}
}
where $data and $hit_count are the character and integer variables respectively. The int_2_char job is proving a bit harder. Any help would be appriciated. Thanks.
Steven.