Hello perlimpinpin, and welcome to the Monastery!
use Config; use utf8::all if $Config{osname} eq 'Linux'; # perl adamantly ignores +the condition
You can’t use Perl’s usual if here, you must use the pragma if, which has a different syntax:
use Config; use if $Config{osname} eq 'Linux', 'utf8::all';
Note also that the Config module isn’t needed for this test. Either $ENV{OS} or $^O will give you the information you need.
Update 1: Struck out $ENV{OS}, thanks to afoken, below.
Update 2: Changed utf8::all to 'utf8::all' (i.e., added quotes) to avoid a syntax error when the condition fails.
Hope that helps,
Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re: Cross-platform accented character file names sorting
by Athanasius
in thread Cross-platform accented character file names sorting
by perlimpinpin
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |