Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Newbie: String concatenation limited to 256 characters?

Reply
Thread Tools

Newbie: String concatenation limited to 256 characters?

 
 
Piet
Guest
Posts: n/a
 
      09-29-2004
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
 
Reply With Quote
 
 
 
 
A. Sinan Unur
Guest
Posts: n/a
 
      09-29-2004
http://www.velocityreviews.com/forums/(E-Mail Removed) (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
(E-Mail Removed)d
(remove '.invalid' and reverse each component for email address)

 
Reply With Quote
 
 
 
 
Paul Lalli
Guest
Posts: n/a
 
      09-29-2004
"Piet" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
256 + 256 = 384 !!??! Ike Computer Support 23 05-26-2006 06:56 PM
How Many VarBinary for each Ascii Char Aes Encrypted KeySize=256,BlockSize=256 Phil C. ASP .Net Security 3 02-25-2005 04:28 PM
Newbie: String concatenation limited to 256 characters? Piet Perl Misc 2 09-30-2004 06:11 AM
TRADE 256 Compact Flash and Reader for 256 SD Jim Spencer Digital Photography 3 10-10-2003 09:51 PM
Calloc of "unsigned char my_bytes[256][256]" M-One C Programming 43 07-16-2003 09:47 PM



Advertisments