Code Comments
Programming Forum and web based access to our favorite programming groups.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
Post Follow-up to this messagePiet wrote: > 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. That's a bunch of baloney. Perl has no problem with large strings. Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\jms>perl -le "for($_='a';;$_=$_.$_){print length}" 1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576 2097152 4194304 8388608 16777216 33554432 67108864 ... -Joe
Post Follow-up to this messagepit.grinja@gmx.de (Piet) wrote in message news:<39cbe663.0409290921.1f67d3f9@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 Thanks for all your comments. In fact, the problem was, of course, NOT perl. How could it... My fault was that I didnīt check the original text output file of the parsing, only the contents that survived importing the text file into M$e...l. I apologize for that. Piet
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.