no warnings 'layers'; use open ':locale'; use warnings 'all'; #### perl -pi.bak -e "if( $. == 2 ) { $_ = q/no warnings 'layer';\n use open ':locale';\nuse warnings 'all';\n$_/;}" myscript.pl #### no warnings 'layer'; # This squelches any warning due # to the open pragma not being able to find # a locale definition in your environment # variables. use open ':locale'; # set a default locale for all IO # in your script based on env vars. use warnings 'all';