in reply to Re: Re: simple regex question
in thread simple regex question (parsing and saving a file)

No problem, just push every line you want to save to an array:

if (/Datasource:/) { print "\n\n", $_, "\n"; push @log, $_; }
Modify all if-Blocks like this. BTW, since you append a '\n' to every line you print, there is no need to chomp it off first.

pike