S_Shrum has asked for the wisdom of the Perl Monks concerning the following question:
After a bit of experimenting I came up with the following syntax:
my $label_colnum = &column_exists( \@data, $_[1] || 0 );Basically the line reads: test that the 2nd param passed to this sub (or 0 if it is undef) column exists in @data; if so, take the returned result of &column_exists and set $label_colnum equal to it.
&column_exists tests to see if the passed column number exists in @data. If the column does exist, it returns back the same column number; if it fails, it returns back a -1.
My question: How can I set this line up to DIE (or call another sub) if the value returned by &column_exists is -1?
TIA
======================
Sean Shrum
http://www.shrum.net
|
|---|