Dave, Split will give you an array from a delimited list. Ie.
@chunks = split(/,/, <FILE>); # where file is name,address,city I think what you want is something like this: (untested) $_ = <FILE>; my(@chunks) =~ /H(\d10{10})\.([A-Z])/; print $chunks[0], $chunks[1]; =+=+=+=+=+=+=+=+=+=+ James Schappet Schappet.com -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dave Ball Sent: Monday, March 08, 2004 10:18 AM To: [EMAIL PROTECTED] Subject: [Perl-unix-users] Confused about split Hello, maybe someone can shed some light on a problem I'm having. I'm trying to split a file into pieces like the one listed below. What I key it on is H110704567.CRD and it changes for each account. The only thing that is consistent is the placement and it begins with "H" followed by 10 digits and a 3 letter extension. I'm using the code below and no matter how I put it I can never get the H110704567.CRD included in the split. I tried parens as well too. When I finally get it working there will be a loop that prints out all of the elements. Any help will be greatly appreciated! open (FILE, "rn410rpt.txt"); while (<FILE>) { local $/ = undef; @chunks = split(/H\d{10}\.[A-Z]/, <FILE>); print $chunks[0]; H110704567.CRD 1MISC-CREDITS 101 1107077467 Company 12-01-03 1 stuff more stuff MISC 138,412,674.24 19GT __________________________________ Do you Yahoo!? Yahoo! Search - Find what you're looking for faster http://search.yahoo.com _______________________________________________ Perl-Unix-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs _______________________________________________ Perl-Unix-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs