[Solved] Perl : Get array of all possible cases of a string
If you’re aiming to use if for glob anyway then you can use glob‘s built-in pattern generation my $filename=”File.CSV”; my $test = $filename =~ s/([a-z])/sprintf ‘{%s,%s}’, uc($1), lc($1)/iegr; say $test, “\n”; say for glob $test; output {F,f}{I,i}{L,l}{E,e}.{C,c}{S,s}{V,v} FILE.CSV FILE.CSv FILE.CsV FILE.Csv FILE.cSV FILE.cSv FILE.csV FILE.csv FILe.CSV FILe.CSv FILe.CsV FILe.Csv FILe.cSV FILe.cSv FILe.csV FILe.csv FIlE.CSV FIlE.CSv … Read more