perl6 'do(file)' equivalent
In perl5 I used to 'do (file)' for configuration files like this: ---script.pl start --- our @conf = (); do '/path/some_conf_file'; ... foreach $item (@conf) { $item->{rules} ... ... ---script.pl end --- ---/path/some_conf_file start --- # arbitrary code to 'fill' @conf @conf = ( {name => 'gateway', rules => [ {verdict => 'allow', srcnet => 'gw', dstnet => 'lan2'} ] }, {name => 'lan <-> lan2', rules => [ {srcnet => 'lan', dstnet => 'lan2', verdict => 'allow', dstip => '192.168.5.0/24'} ] }, ); ---/path/some_conf_file end --- Also Larry Wall's "Programming Perl" also mentions this method: But