Brother Sharky has asked for the wisdom of the Perl Monks concerning the following question:
thx 4 the help#----------------------------------------------------------- sub findTheTypeByTheName{ my $tree = $_[0]; my $name = $_[1];#$name is each line from the config file my $assignment = $tree->{assignment};#$assignment is an array #----------------------------------------------------------- Function: #open Config file open(TXTDOC, $ARGV[1]) || die "Cant open file" . $ARGV[1] . " for comp +aring!\n"; while (<TXTDOC>){ my $name = $_; chomp $name;#remove newlines $name=~s/(\s+)\z//;#rem white space $typeMatched = findTheTypeByTheName($tree,$name); prettyPrintTheType($typeMatched); my $noName = null;#tried to assign to scalar if ($noName){ print "$name . "Is not matched to an ASN name"; } } foreach $theAssignment (@$assignment) { if ($name eq $theAssignment->{ident}{__VALUE__}) { return $theAssignment->{type}; } } return null; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: using return types
by dash2 (Hermit) on Jan 21, 2002 at 20:27 UTC | |
by Brother Sharky (Initiate) on Jan 21, 2002 at 20:39 UTC | |
by hossman (Prior) on Jan 22, 2002 at 03:34 UTC | |
|
Re: using return types
by derby (Abbot) on Jan 21, 2002 at 20:23 UTC |