Re: Junctions as arguments (Pugs bug)
Ovid wrote: (reversed the message a bit) is 'b', any('a' .. 'h'), 'junctions should work'; This looks like a Test bug; it's doing something like: is 'b', 'a' # not ok is 'b', 'b' # ok is 'b', 'c' # not ok ... If you write: ok 'b' === any('a'..'h') The result is one passing test. That outputs something like the following on my system (Version: 6.2.13 (r14927)) any(VInt 1,VInt 2,VInt 3,VInt 4) any(VRef Scalar:0x2aa80e0) My question is, what is the expected output of say-ing a junction? Should say (1|2|3) randomly print 1, 2, or 3? Should say (123) say 1, then say 2, then say 3? I can understand it going either way (although I'd lean towards what Ovid is expecting), but it would be good to hear what others think before tests are committed. -- package JAPH;use Catalyst qw/-Debug/;($;=JAPH)-config(name = do { $,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //, ;$;]-[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;-setup;
Re: List assignment question
Mark J. Reed wrote: I distinctly recall having to do things like (my $a, undef, my $b) to avoid errors because you can't assign to undef. Maybe I'm just hallucinating. Maybe :) $ perl -Mstrict -e 'my ($a, undef, $b) = 1..3; print $a $b\n;' 1 3 This works as far back as v5.6.0 (which is the oldest I have around). -- package JAPH;use Catalyst qw/-Debug/;($;=JAPH)-config(name = do { $,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //, ;$;]-[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;-setup;
Re: List assignment question
Vincent Foley wrote: Hello everyone, I was toying around with Pugs and I tried the following Perl 5 list assignment my ($a, undef, $b) = 1..3; Which gave me the following error message: Internal error while running expression: *** Unexpected , expecting word character, \\, :, * or parameter name at interactive line 1, column 14 For reference, this sort of operation works if you write it on two lines, like: my ($a, $b); ($a, undef, $b) = 1..3; say $a is 1 and $b is 3; I'll look around in the source and see if I can make this work like perl5 (unless that's a bad idea for some reason). Regards, Jonathan Rockway -- package JAPH;use Catalyst qw/-Debug/;($;=JAPH)-config(name = do { $,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //, ;$;]-[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;-setup;