Hi Xie,

This is due to the default value of special variable $" which is the
separator used between list elements when an array variable is interpolated
into a double-quoted string. Its default value is space.
If you write $"="" before printing output will be v1v2v3 for both cases.
Similarly $"="a" will print v1av2av3.

Thanks
Sanket Vaidya 


-----Original Message-----
From: xie ningde [mailto:n.d.ningde...@gmail.com] 
Sent: Tuesday, December 30, 2008 10:20 AM
To: beginners@perl.org
Subject: about "print"

I'm a new perl user. I was trying to print an array by using print @array
and print "@array". Is it supposed to output the same thing? I got the
different output. EX: @array=qw/v1 v2 v3/, the output for print @array will
be v1v2v3 while it will be v1 v2 v3 in the other case. The difference is one
is seperated by whitespace while the other is not. Could anyone explain why
this happen? Thanks alot.

Cid


http://www.patni.com
World-Wide Partnerships. World-Class Solutions. 
_____________________________________________________________________ 

This e-mail message may contain proprietary, confidential or legally privileged 
information for the sole use of the person or entity to whom this message was 
originally addressed. Any review, e-transmission dissemination or other use of 
or taking of any action in reliance upon this information by persons or 
entities other than the intended recipient is prohibited. If you have received 
this e-mail in error kindly delete this e-mail from your records. If it appears 
that this mail has been forwarded to you without proper authority, please 
notify us immediately at netad...@patni.com and delete this mail.
_____________________________________________________________________

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to