On Friday 13 July 2007 02:08:51 pm Christopher Heschong wrote:
> What about:
>
> my $vote = $bar and $foo;
>
Well, it's the same as:
$foo if my $vote = $bar;
Which is a useless use of $foo in void context.
--
package JAPH;use Catalyst qw/-Debug/;($;=JAPH)->config(name => do {
$,.=reverse q
On Jul 13, 2007, at 8:02 AM, Perrin Harkins wrote:
On 7/13/07, apv <[EMAIL PROTECTED]> wrote:
[% vote = Catalyst.user.votes({word => w.id}) IF
Catalyst.user_exists %]
Just FYI, you should never do this type of construct in perl. It will
break in bizarre ways. I doubt that's the issue with T
On Friday 13 July 2007 03:59:09 pm Jonathan Swartz wrote:
> [my $foo if 0 discussion]
> I have the same experience every few years, and I've never been able
> to understand why this can't simply be detected and at least flagged
> as an error or warning in the Perl compiler. Does anyone know?
>
> It
Perrin Harkins wrote:
On 7/13/07, J. Shirley <[EMAIL PROTECTED]> wrote:
As anecdotal evidence to its insidious behavior, I've personally been
involved in a 5 man debugging effort that took 13 days (not full days,
but probably an average of 3-4 hours a day * 5 people * 13 days) to
finally find th
On Jul 13, 2007, at 12:13 PM, Perrin Harkins wrote:
On 7/13/07, J. Shirley <[EMAIL PROTECTED]> wrote:
As anecdotal evidence to its insidious behavior, I've personally been
involved in a 5 man debugging effort that took 13 days (not full
days,
but probably an average of 3-4 hours a day * 5 p
On 7/13/07, J. Shirley <[EMAIL PROTECTED]> wrote:
As anecdotal evidence to its insidious behavior, I've personally been
involved in a 5 man debugging effort that took 13 days (not full days,
but probably an average of 3-4 hours a day * 5 people * 13 days) to
finally find the bug. Which was simpl
> On Fri, Jul 13, 2007 at 05:31:53PM +0100, Matt Lawrence wrote:
>> stephen joseph butler wrote:
>> >On 7/13/07, Matt Lawrence <[EMAIL PROTECTED]> wrote:
>> >>Perrin Harkins wrote:
>> >>> my $vote = $foo if ($bar); # <--- bad!
>> >>>
>> >>What's wrong with that? I find it a lot more readable than
On 7/13/07, Matt Lawrence <[EMAIL PROTECTED]> wrote:
Matt S Trout wrote:
> On Fri, Jul 13, 2007 at 05:31:53PM +0100, Matt Lawrence wrote:
>
>> stephen joseph butler wrote:
>>
>>> On 7/13/07, Matt Lawrence <[EMAIL PROTECTED]> wrote:
>>>
>> I can't replicate this behaviour. As far as I can tell, th
Matt S Trout wrote:
On Fri, Jul 13, 2007 at 05:31:53PM +0100, Matt Lawrence wrote:
stephen joseph butler wrote:
On 7/13/07, Matt Lawrence <[EMAIL PROTECTED]> wrote:
I can't replicate this behaviour. As far as I can tell, the postfix if
is identical to the block if I wrote above.
On Fri, Jul 13, 2007 at 05:31:53PM +0100, Matt Lawrence wrote:
> stephen joseph butler wrote:
> >On 7/13/07, Matt Lawrence <[EMAIL PROTECTED]> wrote:
> >>Perrin Harkins wrote:
> >>> my $vote = $foo if ($bar); # <--- bad!
> >>>
> >>What's wrong with that? I find it a lot more readable than
> >>
> >
On 7/13/07, Matt Lawrence <[EMAIL PROTECTED]> wrote:
I can't replicate this behaviour. As far as I can tell, the postfix if
is identical to the block if I wrote above.
perl -Mstrict -wle 'my $foo = 1 if 0; print defined $foo ? $foo : "undef"'
undef
Has the bug been fixed?
No. Here's a quit
stephen joseph butler wrote:
> If you want something one line, how about this:
>
> my $vote = $foo ? $bar : undef;
Which might be rendered in TT as:
[% vote = foo ? bar : '' %]
Since we don't have an explicit undef in TT (yet), I tend to use an
empty string; it seems to carry almost all the s
stephen joseph butler wrote:
On 7/13/07, Matt Lawrence <[EMAIL PROTECTED]> wrote:
Perrin Harkins wrote:
> my $vote = $foo if ($bar); # <--- bad!
>
What's wrong with that? I find it a lot more readable than
my $vote;
if ($bar) {
$vote = $foo;
}
It doesn't work this way, but suppose you wr
On 7/13/07, Matt Lawrence <[EMAIL PROTECTED]> wrote:
Perrin Harkins wrote:
> my $vote = $foo if ($bar); # <--- bad!
>
What's wrong with that? I find it a lot more readable than
my $vote;
if ($bar) {
$vote = $foo;
}
It doesn't work this way, but suppose you wrote this:
if ($bar) {
my $vo
On Friday 13 July 2007 10:33:59 am Matt Lawrence wrote:
> Perrin Harkins wrote:
> > my $vote = $foo if ($bar); # <--- bad!
>
> What's wrong with that? I find it a lot more readable than
>
> my $vote;
> if ($bar) {
> $vote = $foo;
> }
>
Only the fact that it makes perl do Bad Things :)
"my $
On Fri, Jul 13, 2007 at 04:33:59PM +0100, Matt Lawrence wrote:
> What's wrong with that? I find it a lot more readable than
>
> my $vote;
> if ($bar) {
>$vote = $foo;
> }
Check chapter 6 in PBP for the reasoning I'd parrot here if I could be
bothered to type it all myself.
--
Chisel Wright
Perrin Harkins wrote:
On 7/13/07, apv <[EMAIL PROTECTED]> wrote:
[% vote = Catalyst.user.votes({word => w.id}) IF Catalyst.user_exists %]
Just FYI, you should never do this type of construct in perl. It will
break in bizarre ways. I doubt that's the issue with TT, but don't
get in the habit.
On 7/13/07, apv <[EMAIL PROTECTED]> wrote:
[% vote = Catalyst.user.votes({word => w.id}) IF Catalyst.user_exists %]
Just FYI, you should never do this type of construct in perl. It will
break in bizarre ways. I doubt that's the issue with TT, but don't
get in the habit.
my $vote = $foo if ($
apv wrote:
> This does not:
>
> [% vote = Catalyst.user.votes({word => w.id}) IF Catalyst.user_exists
> %] [% IF vote %]
>You rated this “[% vote.rating %]”
> [% END %]
>
> and yields for all cases (and columns): You rated this ""
Try
[% SET vote = Catalyst.user.votes({word => w.id}) IF Cata
Maybe this is expected behavior (if so, I'd love to know why) and it
may give Aristotle a chance to remind us how awful TT2 is (but I
keed!), still maybe it's something worth noting.
This works:
[% IF Catalyst.user_exists %]
[% vote = Catalyst.user.votes({word => w.id}) %]
[% END %]
[% IF
20 matches
Mail list logo