Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Perl 6 FAQ

by lidden (Curate)
on Oct 18, 2007 at 00:30 UTC ( [id://645622] : note . print w/replies, xml ) Need Help??

in reply to Perl 6 FAQ
in thread Are programmers getting too lazy for perl?

From that FAQ:
my $int1 = 0; my $int2 = 42; my $string = "turbo"; say ?$int1; # no output say ?$int2; # a 1 say +$string; # no output - no number parsed from string
Is that correct? I thougt false changed from '' to 0 so the first marked 'no output' should print '0'.
What about the last one? I would have expected that one too to print 0.

Replies are listed 'Best First'.
Re^2: Perl 6 FAQ
by Anonymous Monk on Dec 11, 2007 at 08:47 UTC
    That may just have been what Pugs did at the time I wrote it. :-) Looking at the Synopsis now, I'm not convinced it's right. I'm not sure what the Synopsis used to say, mind... For the first one, I'm pretty sure that should be a 0. That's provided that bools stringify to 0 and 1. For the third one, undef (thus nothing printed) makes sense to me, in that parsing a string with no numeric value in it is different to parsing one that contains "0". But I'm now struggling to find anything to say that this is really the case. If anyone here knows The Real Answer, I'll happily update the FAQ from that. Otherwise I'll defer to the language list and get an answer there. :-) Thanks for the feedback, Jonathan