develooper Front page | perl.perl6.language | Postings from June 2005

Hyper-concat

Thread Next
From:
Thomas Klausner
Date:
June 14, 2005 13:21
Subject:
Hyper-concat
Message ID:
20050614203240.GE25103@domm2.zsi.at
Hi!

While playing around with some japh-obfus (which turned into my first commit
to Pugs, yay!) I spotted this

say <a b c> >>~<< <1 2 3>;
# prints a1b2c3

my $string=<a b c> >>~<< <1 2 3>;
say $string;
# prints a1 b2 c3

I suppose this is caused by some context things. C<say> imposes list context
(as print in Perl 5), but the assignment imposes scalar context.

But where do the spaces in the second example come from?

(sorry if this question is obvious/FAQ, but I'm just starting Perl6/Pugs
stuff (finally...))


-- 
#!/usr/bin/perl                               http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About