I downvoted for the string eval. Don't use string eval unless necessary.
If you want to do something which is not easy enough to write with the if module, you can still use require in a begin-block:
BEGIN { if ($^O =~ /win32/) { require Win32::TieRegistry; import Win32 +::TieRegistry Delimiter=>"/", ArrayValues=>0; } }
In reply to Re^2: require different modules per OS?
by ambrus
in thread require different modules per OS?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |