in reply to If-else problem

Writing this is enough:
if ($attributes[0] =~m/^DI/i){
See perldoc perlref:
i Do case-insensitive pattern matching. ^ Match the beginning of the line