On Thu, 7 Jun 2001, Byron Rendar wrote:

> my $input    = <STDIN>;
>   my $username = chop( $input );
> print "$username";
>
> Why are double quotes around $username a "bad" thing in the print statement?

Who said they are?  In your example the double quotes aren't necessary,
but they are required if you want to be able to interpolate that variable
in a more complex string:

print "User name = $username\n";

Of course you could also do

print "User name = ", $username, "\n";

or

print "User name = " . $username . "\n";

I'm lazy and hate typing all of those commas and dots. :-)

-- Brett

Brett W. McCoy
Software Engineer
Broadsoft, Inc.
240-364-5225
[EMAIL PROTECTED]


Reply via email to