in reply to Re: Converting to uppercase and wrapping ''
in thread Converting to uppercase and wrapping ''

I tried above ,in the below code for me if $mk matches 'DATA' it should ignore all the subsequent statements,why is it printing "IN"?Please advise

$folder= "data"; my $up=uc qq{'$folder'}; print "\n$up"; my $mk= 'DATA'; next if $mk =~ /uc qq{'$folder'}/i; print "\nIN"; --->prints,ideally if above line matches it should not p +rint this line

Replies are listed 'Best First'.
Re^3: Converting to uppercase and wrapping ''
by jwkrahn (Abbot) on May 02, 2011 at 05:29 UTC
Re^3: Converting to uppercase and wrapping ''
by wind (Priest) on May 02, 2011 at 07:02 UTC

    Why do you want to put quotes around $folder? Are you really just wanted to test if $folder and $mk are equal except for case?

    If so just do the following:

    next if uc $mk eq uc $folder;