#!/usr/bin/perl -w my $str = "abcdefg"; my %hash; %hash = map {$_ => $_} split //, $str; print qq{$_ => $hash{$_}\n} for sort keys %hash;
When run:
# ./t.pl a => a b => b c => c d => d e => e f => f g => g
Cheers,
KM
In reply to Re: Spliting letters in a string
by KM
in thread Spliting letters in a string
by Jemts
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |