#!/usr/local/bin/perl use strict; use warnings; my %seen = (); my $string = "an apple a boz"; while ($string =~ /(.)/g){ $seen{$1}++; } print "unique charts are:", sort(keys %seen), "\n"; my $sum = 0; foreach my $ascval(unpack("C*", $string)){ $sum += $ascval; } print "sum is $sum\n"; my $DELAY = ($ARGV[0] =~ /^-([.\d]+)/) ? (shift, $1) : 1; $| = 1; while(<>){ for(split(//)){ print; select(undef, undef, undef, 1 * $DELAY); } }