Newbie: String concatenation limited to 256 characters?

Discussion in 'Perl Misc' started by Piet, Sep 29, 2004.

  1. Piet

    Piet Guest

    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
    Piet, Sep 29, 2004
    #1
    1. Advertising

  2. Piet

    Joe Smith Guest

    Piet 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
    Joe Smith, Sep 29, 2004
    #2
    1. Advertising

  3. Piet

    Piet Guest

    (Piet) wrote in message news:<>...
    > 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
    Piet, Sep 30, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. walala
    Replies:
    3
    Views:
    4,784
    walala
    Sep 18, 2003
  2. M-One
    Replies:
    43
    Views:
    1,436
    Mark McIntyre
    Jul 16, 2003
  3. Phil C.
    Replies:
    3
    Views:
    221
    Joe Kaplan \(MVP - ADSI\)
    Feb 25, 2005
  4. JV
    Replies:
    0
    Views:
    229
  5. Piet
    Replies:
    2
    Views:
    103
    Paul Lalli
    Sep 29, 2004
Loading...

Share This Page