home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!hri.com!noc.near.net!bigboote.WPI.EDU!bigboote.wpi.edu!john
- From: john@sekrit.WPI.EDU (John Stoffel)
- Newsgroups: comp.lang.perl
- Subject: Re: beginner's split question
- Message-ID: <JOHN.93Jan28164901@sekrit.WPI.EDU>
- Date: 28 Jan 93 21:49:00 GMT
- References: <1k9930INNdcr@life.ai.mit.edu>
- Organization: Worcester Polytechnic Institute
- Lines: 25
- NNTP-Posting-Host: sekrit.wpi.edu
- In-reply-to: kenneths@ai.mit.edu's message of 28 Jan 93 18:36:16 GMT
-
- >>>>> On 28 Jan 93 18:36:16 GMT, kenneths@ai.mit.edu (Kenneth J. Schneider) said:
-
-
- Kenneth> if i want to split $_ into foo, what is wrong with:
-
- Kenneth> $foo = split(/\./, $_);
-
- One problem, $foo will have the number of items found with the split.
- What I think you want is:
-
- @foo = split(/\./o);
-
- to print them out on individual lines do:
-
- for (@foo) { print "$_\n"; }
-
- Randall will now reduce the above line to a one character program. *grin*
-
- John
-
- --
- Youth of today! Join me in a mass rally for traditional mental attitudes!
- -------------------------------------------------------------------------------
- john@wpi.wpi.edu | Work Station Specialist | Worcester Polytechnic Institute
- John Stoffel | 508-831-5512 (work) | Worcester, MA 01609
-