http://www.perlmonks.org?node_id=503149


in reply to python-like split+array access -- possible?

Or just use an anonym array:
my $myString = '123_456'; print [split /_/ , $myString]->[1];

Replies are listed 'Best First'.
Re^2: python-like split+array access -- possible?
by Juerd (Abbot) on Oct 26, 2005 at 19:57 UTC

    Or just use an anonym array

    The construction and destruction of this temporary array do have some overhead that may be unwanted because of permormance needs.

    Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }