[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Quick Help



On Mon, Apr 12, 1999 at 09:38:02PM -0500, Michael D. Kirkpatrick wrote:
} I am trying read a text file and the fields are something like this:
} 
} abcd,wzab,23
} 
} I have used the following to split it up:
} ($word1,$word2,$number) = split (/\,/,$input_line);
} 
} I need to split up word1 and word2 so the output can be placed in the
} following variables:
} $w1_char1
} $w1_char2
} $w1_char3
} $w1_char4
} 
} $w2_char1
} $w2_char2
} $w2_char3
} $w2_char4
} 
} My questions is how do I do this?

Just as it says in the docs; you must have missed it while reading
them before posting here.  Split on the null pattern or the null
string:

split(//,$word1);

See the docs for details (look under the Help menu when MacPerl is in
front).

} 
} 
} Thanks in advance.
} 
} --
} Michael D. Kirkpatrick
} Vice-President
} Web Builders Internet Services Inc.
} http://www.webbuilders.com
} 

-- 
Paul Schinder
schinder@pobox.com

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org