Thank you very much, where can I read more about: local $/ = ''; # enables "paragraph mode"
It doesn't seem to be in the Learning Perl book. or I just missed it. Thanks again! Brian > -----Original Message----- > From: Gunnar Hjalmarsson [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 14, 2004 4:45 PM > To: [EMAIL PROTECTED] > Subject: Re: re-format database file > > > Brian Volk wrote: > > I have a database file, some_sch.txt that is arranged like this: > > > > username1 > > First Last > > Some Community Sch > > 1000 S Adams St > > Town, Indiana 12345 U.S.A. > > > > username2 > > First Last > > Some Community Sch > > 1000 S Adams St > > Town, Indiana 12345 U.S.A. > > > > username3 > > First Last > > Some Community Sch > > 1000 S Adams St > > Town, Indiana 12345 U.S.A. > > > > I want the file to look like this: > > > > username1 First Last sch_name 1000 S Adams St > Town,Indiana > > 12345 U.S.A. > > username2 First Last sch_name 1000 S Adams St > Town,Indiana > > 12345 U.S.A. > > username3 First Last sch_name 1000 S Adams St > Town,Indiana > > 12345 U.S.A. > > > > I don't know how to create a loop that will assign each > scalar variable > > to the next line (field). > > This, I think, is an easier approach: > > local $/ = ''; # enables "paragraph mode" > while (<IN>) { > my @rows = split /\n/; > print join("\t", @rows), "\n"; > } > > -- > Gunnar Hjalmarsson > Email: http://www.gunnar.cc/cgi-bin/contact.pl > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > <http://learn.perl.org/> <http://learn.perl.org/first-response> > > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>