in reply to Re: space in front of lines
in thread space in front of lines

I tried all the suggestions.. including chomp does nothing, and removing the join line: $text = join(' ',@LINES); creates an empty file except for the number 70 which is strange. I think i may have to use a pattern matching operator to remove the spaces, but i'm not sure exactly where to insert it. -Lisa

Replies are listed 'Best First'.
Re: Re: Re: space in front of lines
by davorg (Chancellor) on Nov 06, 2002 at 07:43 UTC

    I think you misunderstood me. I'm not suggesting that you remove that line of code completely (obviously that's going to change the way your program works), just that if you ask Perl to join the lines separated by a space then you shouldn't be surprised if you get a space separating each lne :)

    If (as it seems) you want to join the lines, but not get the space separating them, then ask Perl to join them with an empty string as the separator.

    $text = join('', @LINES);
    --
    <http://www.dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

      thanx.. that did the trick.. wagging tail. -Lisa