special variables

J

julia

Hi, all. I have been looking for some documentation that discusses the
@$ (@$newRules) variables but I can't find the right information so I
decrypt the subroutine.


sub buildRulesSens {
my ($sens, $exceptFile, $lang) = @_;

@RULES_FILES = ();
my $rulesPath = "$lang/rules/sens$sens";
find \&lsRuleFiles, "$rulesPath";
my $out = "$lang/rules_sens$sens.txt";

my $conf = readConfFile($exceptFile);

open (OUT, ">$out") or error("Cant open '$out'");
foreach my $ruleF (@RULES_FILES) {
printc "Processing rules file: $ruleF\n";
print OUT "#<FILE>$ruleF<BODY>\n";
my $newRules = buildRules($ruleF, $conf);
foreach my $r (@$newRules) {
print OUT "$r\n";
}
#trc('_rules', $_rules); die;
}
close OUT;
}
 
S

Sherm Pendley

julia said:
Hi, all. I have been looking for some documentation that discusses the
@$ (@$newRules) variables but I can't find the right information so I
decrypt the subroutine.

$newRules is a reference to an array. Using "foreach (@$newRules)" will loop
over the elements in the array that $newRules refers to.

For more about references, have a look at:
perldoc perlreftut
perldoc perldsc
perldoc perllol

sherm--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top