Escape the characters.
$target = $var1.'\<'.$var2.'\>';

See if those back slashes get you what you want to see.

Steve H.

-----Original Message-----
From: Notabene [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 05, 2001 11:36 PM
To: Perl Beginners
Subject: Assigning '<' & '>' as chars to a variable


Okay, I surrender...what's the trick to assigning the greater-than (<) and
the less-than (>) symbols, as characters, to a variable without triggering
all sorts of unwanted "Perlish" behavior?

I want to do something on the order of:

        $var1   = 'This is text ';
        $var2   = 'This is more text';
        $target = $var1.'<'.$var2.'>';

so that I can finally do:

        print $target; ## or otherwise manipulate the $target variable

and be able to see this result:

        This is text <This is more text>

I've tried "escaping" each of the two symbols but with no luck -- so what's
the trick and what am I doing wrong, here?

Thanks, all.


John--
[EMAIL PROTECTED]

Reply via email to