#!/usr/bin/perl use strict; use warnings; $a = chr(65); print "This is what Alpha looks like $a\n"; #### #!/usr/bin/perl use strict; use warnings; $a = 'This is what Alpha looks like:'; # This instruction overwrites the 33rd # character in string $a with chr(65). # But since string $a is only 30 characters long, # it extends string $a with some spaces and then # writes chr(65) to position 32. The index starts # with 0, so "0" would be the first letter, and # "1" would be the second letter, and # "32" is the 33rd letter... vec($a, 32, 8) = 65; print $a, "\n";