Re: Please explain the one string

2010-07-13 Thread Chas. Owens
On Mon, Jul 12, 2010 at 15:21, redtigra wrote: > Rob, > > GREAT thanks, your explanantion is very detailed and very clear. Looks > like I don't have a clear understanding regarding -n option, so I have > something for reading for the evening :) snip When trying to understand what Perl is doing be

Re: Please explain the one string

2010-07-13 Thread redtigra
Rob, GREAT thanks, your explanantion is very detailed and very clear. Looks like I don't have a clear understanding regarding -n option, so I have something for reading for the evening :) > If you > want to have a decent solution that others can understand and read put this > in a small script wh

Re: Please explain the one string

2010-07-12 Thread Rob Coops
On Sun, Jul 11, 2010 at 10:45 PM, redtigra wrote: > Folks, > > would you please explain me one string of code I could node > understand? > Here it is: > $ perl -ne 'chomp; $fmt = "%-10s %-10s %s\n"; > > if ($ARGV eq "name") {$x{$_}++} > > elsif (/^ALTER TABLE (.*)/ and defin

Please explain the one string

2010-07-12 Thread redtigra
Folks, would you please explain me one string of code I could node understand? Here it is: $ perl -ne 'chomp; $fmt = "%-10s %-10s %s\n"; > if ($ARGV eq "name") {$x{$_}++} > elsif (/^ALTER TABLE (.*)/ and defined $x{$1}) {$in=1; $tbl=$1} > elsif ($in and /^ADD\s*\(\s