Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > special variables

Reply
Thread Tools

special variables

 
 
julia
Guest
Posts: n/a
 
      03-03-2005
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;
}
 
Reply With Quote
 
 
 
 
Sherm Pendley
Guest
Posts: n/a
 
      03-03-2005
julia wrote:

> 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--

--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Put variables into member variables or function variables? tjumail@gmail.com C++ 9 03-23-2008 04:03 PM
Special Report: How special are you? Death from Above MCSE 2 03-19-2007 07:22 PM
tk special variables Alan Lake Ruby 1 03-03-2007 09:02 PM
Special editions and Deluxe special edition dvd question. Rclrk43 DVD Video 8 12-29-2004 07:32 PM
Inherited class methods and special variables Jim Schueler Perl 2 08-20-2004 06:11 PM



Advertisments