954,523 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

need help with "map" syntax

What is map doing below?

my @aFN         = ();
 
#-------------------------------------------------------------------------------
# get the nodes
#-------------------------------------------------------------------------------
if (-e $fConfFN)
{
 open CONF,$fConfFN;
 while(<CONF>)
 {
  chomp;
  if( /.*=(.*)/ )
  {
   my @A = split /\s+/, $1;
   <strong>map{push(@aFN,$_)}@A;</strong>  }
}
close CONF;
bilal.farooq
Newbie Poster
2 posts since Mar 2011
Reputation Points: 10
Solved Threads: 0
 


'map' process each element of an array. Here you no need use the map function. You directly add the @A elements to @aFN.

# map{push(@aFN,$_)}@A;  
push @aFN, @A;
k_manimuthu
Junior Poster in Training
93 posts since Jun 2009
Reputation Points: 55
Solved Threads: 24
 

Hi k_manimuthu,

Thank you.

bilal.farooq
Newbie Poster
2 posts since Mar 2011
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: