Strange issue with `CHOMP' not working...

I

Ignoramus20015

I have a mod_perl based website algebra.com. In a few places, it does
'chomp' when it reads various files.

It all worked fine for years and I had not touched any code lately,
especially nothing related to chomp.

In the last week or so, it broke for some reasons and chomp no longer
chomps lines, in at least a couple of pieces of code that I did not
touch.

As a result, my site did not work properly.

I suspect that perhaps I upgraded some perl modules such as
SpamAssassin, and possibly somehow that could have messed up the
behavior of chomp.

Any ideas as to why this is happening.

i
 
P

Paul Lalli

Ignoramus20015 said:
I have a mod_perl based website example.com. In a few places, it does
'chomp' when it reads various files.

It all worked fine for years and I had not touched any code lately,
especially nothing related to chomp.

In the last week or so, it broke for some reasons and chomp no longer
chomps lines, in at least a couple of pieces of code that I did not
touch.

As a result, my site did not work properly.

I suspect that perhaps I upgraded some perl modules such as
SpamAssassin, and possibly somehow that could have messed up the
behavior of chomp.

Any ideas as to why this is happening.

You have a syntax error on line 42.... ;-)

Seriously, nothing changed with chomp. FAR more likely, something
changed with your data. Please post a short-but-complete script, along
with sample input data, that exhibits the problem you are describing.

(URL changed, just in case this is a simple attempt at driving people
to the OP's website...)

Paul Lalli
 
P

Paul Lalli

prawn said:
Without any data, I can't say. I had the same issue today processing a
dos file on a unix box and:

my $s =~ s/\r\n$//; [1]

did the trick.

Only if "the trick" was generating warnings about trying to perform an
s/// operation on an undefined value. . .

Paul Lalli
 
X

xhoster

Ignoramus20015 said:
I have a mod_perl based website algebra.com. In a few places, it does
'chomp' when it reads various files.

It all worked fine for years and I had not touched any code lately,
especially nothing related to chomp.

In the last week or so, it broke for some reasons and chomp no longer
chomps lines, in at least a couple of pieces of code that I did not
touch.

As a result, my site did not work properly.

I suspect that perhaps I upgraded some perl modules such as
SpamAssassin, and possibly somehow that could have messed up the
behavior of chomp.

Any ideas as to why this is happening.

Maybe something related to binmode/utf.

Maybe people are starting to
use your website from non-IE browser and that causes problems because
different browsers use different eol.

Xho
 
I

Ignoramus20015

You have a syntax error on line 42.... ;-)

Seriously, nothing changed with chomp. FAR more likely, something
changed with your data. Please post a short-but-complete script, along
with sample input data, that exhibits the problem you are describing.

The one config file that used to be parsed fine, and now is not, is
dated Mar 2001:

-rw-r--r-- 1 ichudov ichudov 17 Mar 25 2001 flags

It has not changed.
(URL changed, just in case this is a simple attempt at driving people
to the OP's website...)

I probably have more people coming to my site per day than people
visiting this newsgroup in a year. So driving people to my site is not
an issue.

i
 
I

Ignoramus20015

Ignoramus20015 said:
I have a mod_perl based website algebra.com. In a few places, it does
'chomp' when it reads various files.

It all worked fine for years and I had not touched any code lately,
especially nothing related to chomp.

In the last week or so, it broke for some reasons and chomp no longer
chomps lines, in at least a couple of pieces of code that I did not
touch.

As a result, my site did not work properly.

I suspect that perhaps I upgraded some perl modules such as
SpamAssassin, and possibly somehow that could have messed up the
behavior of chomp.

Any ideas as to why this is happening.

i

Without any data, I can't say. I had the same issue today processing a
dos file on a unix box and:

my $s =~ s/\r\n$//; [1]

did the trick.

[1] It /think/ that it was that way round :)

I had to do the same thing as well, to replace a regexp. But I an
miffed and worried that other places where chomp is used, would not
work as well.

i
 
I

Ignoramus20015

Maybe something related to binmode/utf.

Maybe people are starting to
use your website from non-IE browser and that causes problems because
different browsers use different eol.

Well, the problems are with reading config files on my local disk, not
user submitted data. I just checked dates on some of them, they are
quite old and have not changed.

i
 
P

Paul Lalli

Ignoramus20015 said:
The one config file that used to be parsed fine, and now is not, is
dated Mar 2001:

-rw-r--r-- 1 ichudov ichudov 17 Mar 25 2001 flags

It has not changed.

Okay. So where is the short-but-complete script that demonstrates this
"not working"?

*Something* changed. It is not the implementation of chomp(). Only
*you* know what changed on your system. Until you can provide a
short-but-complete example of what's going wrong, how are you expecting
anyone else to help you?
I probably have more people coming to my site per day than people
visiting this newsgroup in a year. So driving people to my site is not
an issue.

Well aren't you special then.

Paul Lalli
 
I

Ignoramus20015

Okay. So where is the short-but-complete script that demonstrates this
"not working"?

*Something* changed. It is not the implementation of chomp(). Only
*you* know what changed on your system. Until you can provide a
short-but-complete example of what's going wrong, how are you expecting
anyone else to help you?

Perhaps someone else had a similar issue.

I am going to work on an example, I now clean the string with s///
after chomp, but added a sanity check to print a warning if it
contains \n or \r after chomp, but before regex. I'll run my website
for a while to see if that reproduces.

i
 
P

prawn

Paul said:
prawn said:
Without any data, I can't say. I had the same issue today processing a
dos file on a unix box and:

my $s =~ s/\r\n$//; [1]

did the trick.


Only if "the trick" was generating warnings about trying to perform an
s/// operation on an undefined value. . .

Paul Lalli

Heh. I forgot the untested caveat. For shame.
 
P

Peter J. Holzer

Ignoramus20015 said:
[...]
Well, the problems are with reading config files on my local disk, not
user submitted data. I just checked dates on some of them, they are
quite old and have not changed.

Maybe you restarted the server with wrong environment settings? I
managed to start qpsmtpd-forkserker with PERL_UNICODE set some time ago,
which had a rather surprising effect on the mails passed through it :)

Older versions of the HP-UX printing system also didn't like the LANG
variable being set (that's not written in perl, though).

hp
 
I

Ignoramus10782

Ignoramus20015 said:
I have a mod_perl based website algebra.com. In a few places, it
does 'chomp' when it reads various files.

It all worked fine for years and I had not touched any code lately,
especially nothing related to chomp.
[...]
Well, the problems are with reading config files on my local disk, not
user submitted data. I just checked dates on some of them, they are
quite old and have not changed.

Maybe you restarted the server with wrong environment settings? I
managed to start qpsmtpd-forkserker with PERL_UNICODE set some time ago,
which had a rather surprising effect on the mails passed through it :)

Older versions of the HP-UX printing system also didn't like the LANG
variable being set (that's not written in perl, though).

Thanks... The bug would show up after the server runs for a little
while. I think that my bug was that I was opening that file often, and
neglected to close it. That probably caused this strange behavior
after a while by overflowing something or other. Since I cleaned up
that module, the bug does yet have to manifest itself.

i
 
R

robic0

I have a mod_perl based website algebra.com. In a few places, it does
'chomp' when it reads various files.

It all worked fine for years and I had not touched any code lately,
especially nothing related to chomp.

In the last week or so, it broke for some reasons and chomp no longer
chomps lines, in at least a couple of pieces of code that I did not
touch.

As a result, my site did not work properly.
Sue the **** out of Larry Wall, then inkind, anybody who offers solutions
based on your post. Sue the mother fuckin shit out of them, all of them!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top