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

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.