my $firstname = 'Parham'; #set first name $firstname =~ /^(\w)/; #grab the first letter print $1; #print the first letter #### my ($variable) = $variable =~ /regex/;