if($options{r}){ #variable grab, add flags to pattern if they exist. my $pattern = $options{r}; $pattern .= 'g' if $options{g}; $pattern .= 'i' if $options{i}; $pattern .= 's' if $options{s}; #compile that stuff with eval my $compd_pattern = eval "qr($pattern)" or die $@; print "Please enter the text you wish to run the pattern on: "; my $text = ; chomp $text; #do work and display if($text =~ $compd_pattern){ print $text; } else{ print "$pattern on \n\t{$text} Failed. "; } } #end R FLAG