in reply to Passing / evaluating / dieing on one line...
If you want the calling code to die if the value is -1, the following will probably work:sub column_exists { my ( $ArrayRef, $Column ) = @_; return ( $ArrayRef->[$Column] || $ArrayRef->[0] ); }
my $label_colnum = &column_exists( \@data, 1 ) if ( $label_colnum == -1 ) { die "Something bad!"; }
--t. alex
"Here's the chocolates, and here's the flowers. Now how 'bout it, widder hen, will ya marry me?" --Foghorn Leghorn
|
|---|