http://qs321.pair.com?node_id=373282

FoxtrotUniform has asked for the wisdom of the Perl Monks concerning the following question:

So I'm writing some code to perfect-shuffle two lists, and I want it to complain when it doesn't get lists of equal length. Which style is preferred?

# .. or warn is homomorphic to the .. or die idiom, and is # phrased like an assert. @foo == @bar or warn "perfect_shuffle: lists must have equal length\n"; # explicit if makes adding cleanup easier, and is phrased # like an error check. if(@foo != @bar) { warn "perfect_shuffle: lists must have equal length\n": }
Opinions?

Edit: s/scalar \@/\@/g;; thanks adrianh!

--
F o x t r o t U n i f o r m
Found a typo in this node? /msg me
% man 3 strfry