CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate: Re: [gevni] Problem in using split and join function!!: Edit Log



Laurent_R
Veteran / Moderator

Dec 1, 2012, 3:02 PM


Views: 3641
Re: [gevni] Problem in using split and join function!!

Not at all, it is completely generic. Exactly the same code with a different input array:


Code
my  @new_array= qw/ 2_2_2_2 3_3 4_4_4 1_1_1 17_17_17 6_6_6_6_6 8_8/; 
my @resplit = map {split /_/, $_} @new_array;
print "@resplit";
# prints : 2 2 2 2 3 3 4 4 4 1 1 1 17 17 17 6 6 6 6 6 8 8


Please ask if you have trouble understanding the logic.


(This post was edited by Laurent_R on Dec 1, 2012, 3:08 PM)


Edit Log:
Post edited by Laurent_R (Veteran) on Dec 1, 2012, 3:07 PM
Post edited by Laurent_R (Veteran) on Dec 1, 2012, 3:08 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives