On Wednesday, June 5, 2002, at 08:31 , Theuerkorn Johannes wrote:
> Ok, found one easy solution: as I need to parse the whole file anyway, i
> am removing all newline by doing:
>
> if (open(LOG,"$fileName")) {
>
> open (temp1,"$temp");
> while (<LOG>)
> {
> chomp;
> my $line =$_;
> $lastline .= "$line" ;
> }
> print temp1 "$lastline";
>
> So I get a new file temp1 which I can parse as usual.
I personally would avoid creating a temp file in the process
and would instead read in the $fileName - and find the stuff
that I need and 'use it' in the code.... unless you
really need to create a new file that will be used elsewhere.
> Only Problem: when joining the Lines to one line I get ^M where used to
> be the newline char...
[..]
http://www.wetware.com/drieux/pbl/RegEx/eolOut.txt
provides way that this can be done...
so I would be working all of the sneek and peek
that I recommend in
http://www.wetware.com/drieux/pbl/RegEx/paraHablarRegular.txt
all inside of the
while(<LOG>) {
....
}
then again I would also do something of the form
open(LOG,"$fileName") or webSafeWhine($thisAngst);
which is mostly implied in your
if(open(LOG,"$fileName")) {
} else {
# have problem with LOG here
}
ciao
drieux
http://www.wetware.com/drieux/pbl/
--------------
This space left intentionally blank.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]