#!/usr/bin/perl -w print "Enter a string : "; $whatever = "foo"; chomp($input = <>); print "Found a+b*\n" if $input =~ /a+b*/; print "Found /*\**\n" if $input =~ m#/*\**#; print "Found \$whatever x 3\n" if $input =~ /$whatever$whatever$whatever/; print "Found any five chars\n" if $input =~ /(.|\n){5}/; print "Found same word written twice\n" if $input =~ /(\w+)\W+\1/;