G
George
Hi
I needed to run regular exression(RE) for all the elements of an array
so I thought of using MAP(one liner) insted foreach.
Following line
@Rfolder=map {/#(.*?)(?=/,$_} @getlistF;
gave me all the existing elements plus what is extracted by RE
but
following line
@Rfolder=map {/#(.*?)(?=/} @getlistF;
gave me just what RE returned,
Definetly it means that I do not understand MAP correctly,
can somebody please explain what is the difference between two
statement , cause what I understood that $_ needs to be set before ,
for RE to work.
I needed to run regular exression(RE) for all the elements of an array
so I thought of using MAP(one liner) insted foreach.
Following line
@Rfolder=map {/#(.*?)(?=/,$_} @getlistF;
gave me all the existing elements plus what is extracted by RE
but
following line
@Rfolder=map {/#(.*?)(?=/} @getlistF;
gave me just what RE returned,
Definetly it means that I do not understand MAP correctly,
can somebody please explain what is the difference between two
statement , cause what I understood that $_ needs to be set before ,
for RE to work.