4 ms·
I have to work with a legacy Perl codebase most weeks and I've been ignoring Perl 6 because upgrading our interpreter version is difficult for a bunch of reason
by drwoland 11y ago
I have to work with a legacy Perl codebase most weeks and I've been ignoring Perl 6 because upgrading our interpreter version is difficult for a bunch of reasons to boring to go into.
I'd been naively holding out a hope that Perl 6 would improve things so I clicked on the Perl 6 for Perl 5 programmers link from perl6.org.
They added code block interpolation to strings:
#!/usr/bin/env perl6
my $number = 3;
say( "{ $number * 4 }" ); # prints 12
- leejo 11y agoYou can do that already in perl 5: > perl -E 'my $i = 1; say "@{[ sin $i ]}";' 0.841470984807897 perl 6 will improve things, it has a huge feature set.
- Mithaldu 11y agoThis is little different from something like: #!/usr/bin/env perl6 my $number = 3; printf( "%s\n", $number * 4 ); # prints 12 What is your complaint?
- ab5tract 11y agoReally? printf is cool and useful for it's own domain. But there is a reason that languages provide interpolation. And the simplest possible example above is not one of those reasons.
- Mithaldu 11y agoYou imply, but fail to make any actual points or explanations.
- ab5tract 11y agoI'm not going to bother convincing you that printf is not the highest form of string interpolation. Seems like you've got your bases covered pretty well.
- Mithaldu 11y agoI never said printf is the highest form, nor did i imply it. If you think i did imply that, and you consider it to be ridiculous, then it would behoove you to ask if i did mean to imply that or not; instead of assuming that your interpretation of my words is fact and i am being ridiculous. I consider printf an acceptable form of string interpolation, nothing more.
- mj41 11y agohttp://www.slideshare.net/Ovid/perl-6-for-mere-mortals http://www.slideshare.net/Ovid/perl-6-for-mere-mortals