#!/usr/bin/perl $_ = 'abcdefg'; # define a string /(..)(..)(..)/; # break the string into 3 two-character chunks print "$1 $2 $3\n"; # print the chunks /(j)/n; # search for a letter that's not in the string print "$1 $2 $3\n"; # print the chunks /(g)/n; # search for a letter that's in the string print "$1 $2 $3\n"; # print the chunks