Perl Split Function

by Geethalakshmi 2010-09-17 14:09:22

Perl Split Function


The split() function breaks apart an expression based on a delimiter value. This can be used to parse a scarlar variable into an array so each field can be treated as a single element.

$value = "field1:field2:lastfield";
@fields = split(/:/,$value);

@fields = "field1", "field2", "lastfield"

Tagged in:

758
like
0
dislike
0
mail
flag

You must LOGIN to add comments