Forum Moderators: mack

Message Too Old, No Replies

Perl Code

Missing Something!

         

jimijoe

11:02 pm on Jan 2, 2004 (gmt 0)

10+ Year Member



Hi,

When I write:
print "Tom paid $105.65 for his book.\n";

It shows as:
Tom paid .65 for his book.

$105 disappeared!

How should I write it to see "$" and all other Signs correctly?

Thanks,

andrew_m

11:04 pm on Jan 2, 2004 (gmt 0)

10+ Year Member



print "Tom paid \$105.65 for his book.\n";

add backslash in front.

jimijoe

12:14 am on Jan 3, 2004 (gmt 0)

10+ Year Member



Thanks,
It works fine.

txbakers

12:18 am on Jan 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




The $ character delcares a variable, and the . is a concatenator in Perl