Recommendation
If you need to know about basic data manipulation, data types, etc., read perldata or perlfaq4 (Data Manipulation).
Also, for all kinds of different base conversions, definately check out cseg's 2.pl. It's a
very useful program and I find a use for it daily.
Data Conversion
There are a bunch of different functions for data conversion. Here are a few:
Permutation
Permutation allows you to take a list and get every possible combination of the values in the list. You can use
Algorithm::Permute which uses C or check out this example
code that permutes through a list.
$perm = newcombo main(@list); while (@comb = $perm->nextcombo) { print join(", ", @comb) . "\n"; } sub newcombo { $class = shift; $list = [ @_ ]; bless [$list, [0 .. $#$list]], $class; } sub nextcombo { $self = shift; $list = $self->[0]; $tot = $self->[1]; return unless @$tot; @next = @$tot; @end = pop @next; while (@next && $next[-1] > $end[-1]) { push(@end, pop(@next)); } if (defined($extra = pop(@next))) { ($place) = grep $extra < $end[$_], 0 .. $#end; ($extra, $end[$place]) = ($end[$place], $extra); $self->[1] = [@next, $extra, @end]; } else { $self->[1] = []; } return @$list[@$tot]; }