On Nov 4, eventualdeath said: >Q1) Can I use the split function to split an existing array (with >several elements ) such as the example below.
No. split() uses a string. >Q2) Could it be that the split function can only be used to split a >scalar (one element). Yup. >Q3) Could someone explain to me the reason why @readagain return the >number 4, and $#readagain return 0. split() happens to ENFORCE scalar context on its second argument -- that means that split /whatever/, @read; is like split /whatever/, scalar(@read); and scalar(@array) returns the number of elements in the array. -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ ** Look for "Regular Expressions in Perl" published by Manning, in 2002 ** -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]