in reply to please solve this

Here's a different hint

#!/usr/bin/perl # http://perlmonks.org/?node_id=1120349 use strict; use warnings; my $keyboard = <<end_of_keyboard; ERTYU1 DFGHJ2 CVBNM4 end_of_keyboard my ($oldrow, $oldcol); for my $press ( split //, shift // 'RFGM' ) { $keyboard =~ /(.*)\Q$press/ or next; # find key, ignore if missing my ($row, $col) = ($` =~ tr/\n//, length $1); defined $oldrow and print 'v' x ($row - $oldrow), '^' x ($oldrow - $row), '>' x ($col - $oldcol), '<' x ($oldcol - $col); ($oldrow, $oldcol) = ($row, $col); print $press; } print "\n";