#!/usr/bin/perl # If all the world was apple pie, # And all the seas were ink, # If all the trees were bread and cheese, # What should we have for a drink? # - Mother Goose if (@world == $apple_pie and @seas == $ink) { if (@trees == ($bread and $cheese)) { $drink = <>; } }
MotherFoo

Replies are listed 'Best First'.
Re: Conditional Mother Goose
by theorbtwo (Prior) on Apr 16, 2002 at 17:58 UTC
      Thanks for the tip theorbtwo, definately a job for Quantum::Superpositions, a module I was unfamiliar with.

      Now I'm not sure about the Old Bird's logic though. I suppose I'll take her at her word that all trees should be bread _and_ cheese, disallowing bread-only and cheese-only trees.

      CheeseFoo

      #!/usr/bin/perl use Quantum::Superpositions; if (all(@the_world) == $apple_pie and all(@the_seas) == $ink) { if (all(@the_trees) == all($bread, $cheese)) { $drink = <>; } }