Re: join lines

2009-11-18 Thread Dr.Ruud
Jackie Jackie wrote: > Ruud: #!/usr/bin/perl -w use strict; local $/ = "\n\n"; my @data = map [ map [ split /\n/ ], split /\n&\n/ ], ; > > This time the code worked. Please explain it to me. Try this version, and find out yourself: #!/usr/bin/perl -w use strict; use Data::Dumper; local $/

RE: join lines

2009-11-18 Thread Hack, Gabi (ext)
oops. It must be of course: local $/ = ''; sorry, gabi -Original Message- From: Hack, Gabi (ext) Sent: Wednesday, November 18, 2009 8:57 AM To: Dr.Ruud; beginners@perl.org Subject: RE: join lines Dr.Ruud wrote: > local $/ = "\n\n"; shorter: local $\ = 

RE: join lines

2009-11-17 Thread Hack, Gabi (ext)
Dr.Ruud wrote: > local $/ = "\n\n"; shorter: local $\ = ''; # set record separator to blank line gabi -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: join lines

2009-11-17 Thread Jackie Jackie
Thanks This time the code worked. Please explain it to me. From: Dr.Ruud To: beginners@perl.org Sent: Sun, November 15, 2009 9:43:09 PM Subject: Re: join lines Jackie Jackie wrote: > Desired output: > name1&firstname1&adresse1 > name2&am

Re: join lines

2009-11-17 Thread Dr.Ruud
Jackie Jackie wrote: Desired output: name1&firstname1&adresse1 name2&firstname2&adresse2 name3&firstname3&adresse3 name4&firstname4&adresse4 name5&firstname5&adresse5 etc. #!/usr/bin/perl -w use strict; local $/ = "\n\n"; my @data = map [ map [ split /\n/ ], split /\n&\n/ ], ; for my $d

Re: join lines

2009-11-16 Thread Jim Gibson
On 11/16/09 Mon Nov 16, 2009 1:23 PM, "Jackie Jackie" scribbled: > What this means > > if( ! length() ) It means evaluate the expression '! length()' in a scalar context, interpret the value as a logical expression, and branch accordingly. ! is the not operator. length() is the length ope

Re: join lines

2009-11-16 Thread Jackie Jackie
! length() ) From: Shawn H Corey To: Jackie Jackie Cc: beginners@perl.org Sent: Sun, November 15, 2009 3:51:04 PM Subject: Re: join lines Jackie Jackie wrote: > I tried to adapt this code to obtain my desired output. I need help. My logic > is > &

Re: join lines

2009-11-15 Thread Shawn H Corey
Jackie Jackie wrote: > I tried to adapt this code to obtain my desired output. I need help. My logic > is > > While > if lines are not empty {do} > if lines are empty {do} > > While > if lines are not empty {do} > else for empty lines{do} > > I am new to programming. I have problem with logic

Re: join lines

2009-11-15 Thread John W. Krahn
Jackie Jackie wrote: I tried to adapt this code to obtain my desired output. I need help. My logic is While if lines are not empty {do} if lines are empty {do} While if lines are not empty {do} else for empty lines{do} I am new to programming. I have problem with logic and syntax. So please

join lines

2009-11-15 Thread Jackie Jackie
I tried to adapt this code to obtain my desired output. I need help. My logic is While if lines are not empty {do} if lines are empty {do} While if lines are not empty {do} else for empty lines{do} I am new to programming. I have problem with logic and syntax. So please explain to me how I so