nmerriweather has asked for the wisdom of the Perl Monks concerning the following question:
how can i do something like that in perl?myString = '123_456' print myString.split('_')[1] --- you get '456'
edit: i actually answered myself correctly with my pseudocode description. there was a typo elsewhere in the program that made this not look right. i'm leaving this here for others.$myString = '123_456' print ( split '_' , $myString )[1] --- you get '456'
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: python-like split+array access -- possible?
by Juerd (Abbot) on Oct 26, 2005 at 19:50 UTC | |
Re: python-like split+array access -- possible?
by Corion (Patriarch) on Oct 26, 2005 at 19:46 UTC | |
by Juerd (Abbot) on Oct 26, 2005 at 19:56 UTC | |
Re: python-like split+array access -- possible?
by neniro (Priest) on Oct 26, 2005 at 19:52 UTC | |
by Juerd (Abbot) on Oct 26, 2005 at 19:57 UTC |