Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Newbie: String concatenation limited to 256 characters?
Hello,
I have written a small script that parses an (ugly) HTML file line by
line and converts the relevant information to CSV. During parsing, I
heavily use string concatenation to glue together parts of text that
belong together (but might be separated in the original file by tags
or newlines). In the code, the expression
$oldstring = $oldstring.$newstring
occurs very often.
Frequently, the strings get longer than 256 characters. At this point,
the string concatenation refuses to add anything to $oldstring. How is
it possible to avoid that?
Thanks in advance for answers on  a (maybe very newbish) question
Piet

Report this thread to moderator Post Follow-up to this message
Old Post
Piet
09-30-04 01:05 AM


Re: Newbie: String concatenation limited to 256 characters?
pit.grinja@gmx.de (Piet) wrote in news:39cbe663.0409290925.2e735196
@posting.google.com:

> Hello,
> I have written a small script that parses an (ugly) HTML file line by
> line and converts the relevant information to CSV. During parsing, I
> heavily use string concatenation to glue together parts of text that
> belong together (but might be separated in the original file by tags
> or newlines). In the code, the expression
> $oldstring = $oldstring.$newstring
> occurs very often.
> Frequently, the strings get longer than 256 characters. At this point,
> the string concatenation refuses to add anything to $oldstring. How is
> it possible to avoid that?
> Thanks in advance for answers on  a (maybe very newbish) question
> Piet

Your post appeared twice. Please don't post multiple copies of the same
question.

You'll need to provide a short self-contained script that still exhibits
the problem to support such an outrageous claim.

#! perl

use strict;
use warnings;


my $str = 'a';

$str .= 'a' for (1 .. 999_999);

print length($str), "\n";

__END__



--
A. Sinan Unur
1usa@llenroc.ude.invalid
(remove '.invalid' and reverse each component for email address)


Report this thread to moderator Post Follow-up to this message
Old Post
A. Sinan Unur
09-30-04 01:05 AM


Re: Newbie: String concatenation limited to 256 characters?
"Piet" <pit.grinja@gmx.de> wrote in message
news:39cbe663.0409290925.2e735196@posting.google.com...
> Hello,
> I have written a small script that parses an (ugly) HTML file line by
> line and converts the relevant information to CSV. During parsing, I
> heavily use string concatenation to glue together parts of text that
> belong together (but might be separated in the original file by tags
> or newlines). In the code, the expression
> $oldstring = $oldstring.$newstring
> occurs very often.
> Frequently, the strings get longer than 256 characters. At this point,
> the string concatenation refuses to add anything to $oldstring. How is
> it possible to avoid that?
> Thanks in advance for answers on  a (maybe very newbish) question
> Piet

You've misdiagnosed your problem.  Perl is very capable of dealing with
arbitrarily long strings.  Therefore, the strings are being cut off by
something else.  My guess would be a fixed length database field that
you might be storing them in.   Since you didn't provide any code, we
have no way of pointing to you to what your actual problem is.

Paul Lalli



Report this thread to moderator Post Follow-up to this message
Old Post
Paul Lalli
09-30-04 01:05 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Miscellaneous archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:40 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.