This prints:package Aa; use warnings; #no warnings 'void'; use strict; #no strict 'refs'; package Bb; #>> when you uncomment this, it wont work!! #use strict; #use warnings; #<< my $strict = eval('package Aa;my $h;BEGIN { $h = ${^H} };return $h;'); printf "use strict " . ($strict == 1794 ? 'yes' : 'no') . "\n"; my $warn = eval('package Aa;my $w;BEGIN { $w = ${^WARNING_BITS} };retu +rn $w;'); printf "use warnings " . (unpack('b*', warnings::bits('all')) == unpac +k('b*', $warn) ? 'yes' : 'no') . "\n";
use strict = yes use warnings = yestill you use all-warnings ans all-stricts. Conclusion: it works fine and do what I want.
And by the way: in last few weeks I've see a lot of little perl wonders like this. I think, there must be a perl-good. Now I'm a believer :D
In reply to Re^2: Find out, if "use warnings(all)" and "use strict(all)" are used
by Tobiwan
in thread Find out, if "use warnings(all)" and "use strict(all)" are used
by Tobiwan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |