in reply to Re: Re: Re: File comparison problem!
in thread File comparison problem!

Yes it is the $t->get that is inserting the new line at the end. Is there any way to get around this? Or how could I remove the last line before comparison?
  • Comment on Re: Re: Re: Re: File comparison problem!

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: File comparison problem!
by ysth (Canon) on Dec 03, 2003 at 00:02 UTC
    my $filecontents = $t->get("1.0", "end"); chomp($filecontents); print TEMP $filecontents;
    or (if you want to eliminate multiple newlines, but leave at least one):
    my $filecontents = $t->get("1.0", "end"); $filecontents =~ s/\n+\z/\n/; print TEMP $filecontents;