in reply to output to a single line

Most likely, your $var1 and/or $var2 are not clean. Somewhere there is(are) returns.

This helps to visually inspect your strings: (just pass your $var1, $var2 as parameters)

use strict; use warnings; inspect("abcd\n123"); sub inspect { (my $copy = shift) =~ s/([^[:print:]])/sprintf " (0x%02x) ", ord $ +1/ge; print $copy; }

If your $var1 and $var2 are read from terminal or a file, you might want to chomp them.

Replies are listed 'Best First'.
Re: Re: output to a single line
by Aragorn (Curate) on Jan 19, 2004 at 09:06 UTC
    Ooh, very slick :-). In cases like this, I just throw some < and > characters around a string.

    Arjen