Scott wrote:

   > Hmm.  C<when> seems to be synonymous with C<if> (almost)
   >
   >    when ($foo) { ... }             # Does this mean if ($_ eq $foo)?
   >     if  ($foo) { ... }

A C<when> is an <if> whose "other half" is specified by a surrounding C<given>.


   > However ...
   >
   > > A C<next> within a C<when>'s block causes control to jump to the next
   > > statement in the innermost surrounding <given>'s block.
   >
   > What happens to C<next> within stand-alone C<when> statements? Do
   > C<when> statements never stand alone?

That's correct. I'd expect:

        die "Ungoverned 'when' statement (where's the 'given'???)"

I think C<when> and C<if> are no more synonymous than C<foreach> and C<while>
and I doubt people will have much difficulty keeping them straight.

Damian

Reply via email to