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;
   [B]map{push(@aFN,$_)}@A;[/B]  }
}
close CONF;

Recommended Answers

'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;
Jump to Post

All 2 Replies

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

Hi k_manimuthu,

Thank you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.