Home >> perlfunctions >>
perl function : split
split [ PATTERN [ , EXPR† [ , LIMIT ] ] ]
Splits a string into an array of strings, and returns it. If LIMIT is specified, splits into at most that number of fields. If PATTERN is also omitted, splits at the whitespace. If not in array context, returns number of fields and splits to @_.
#!/usr/bin/perl
use strict;
my $st="101,32,45,67";
my @spt=split(",",$st);
print $spt[0];
in above example 101 will be printed.
Perl functions
|
eval List of all perl functions ord Perl function: lc shift
Download perl
download stable version of perl
Perl 5.10.1
|
|