#!/usr/bin/perl $icase = 'i'; $str = 'ASdf'; if ( 'asdf' =~ /$str/$icase ) { print "it works!\n" } #### $ perl test.pl Scalar found where operator expected at test.pl line 6, near "/$str/$icase" (Missing operator before $icase?) syntax error at test.pl line 6, near "/$str/$icase " Execution of test.pl aborted due to compilation errors.