Sophie

Sophie

distrib > Mageia > 1 > i586 > by-pkgid > d92aa75c2d384ff9f513aed09a46f703 > files > 839

parrot-doc-3.1.0-2.mga1.i586.rpm

# Copyright (C) 2007-2009, Parrot Foundation.

=head1

C<split> is an operation that breaks up a string at certain marker
characters, and puts the resulting parts into an array. The first
argument to C<split> is the pattern to search for, and the second
argument is the string to search. The result is an array PMC.

=cut

.sub main :main
    .local pmc words

    split words, " ", "the quick brown fox"
    $P1 = words[0]
    say $P1              # 'the'

    $P2 = words[2]
    say $P2              # 'brown'

.end

# Local Variables:
#   mode: pir
#   fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir: