in reply to ((Conditional, Ternary Operator)) Specifying default and non-default values
You can tidy the ternary operator up too. I'd write something like (untested but optimised for brevity :-)
For real I'd put an or die after the system though ;-)$extension{index} = 'pod'; system "pod2html $_." . ($extension{$_} || 'pm') . " > $_.html" for (qw(HostCycle Instinet index));
Update: I did test it, and I got this result
$ perl - [fx: cuts and pastes the code above] Can't open HostCycle.pm: No such file or directory Can't open Instinet.pm: No such file or directory Can't open index.pod: No such file or directoryIt works! (The error messages are from pod2html.)
|
|---|