On 14 June 2010 23:46, Lyle <[email protected]> wrote:

> Hi All,
>   This technique came up at one of the meets. I just used this piece of
> code in a project:-
> my $length = ($#import_fields, $#csv_fields)[ @csv_fields >
> @import_fields];
>   Is it advisable though from a maintenance and readability point of view?
>
> Lyle
>
> _______________________________________________
> BristolBathPM mailing list
> [email protected]
> http://mailman.bristolbath.org/mailman/listinfo/bristolbathpm
>

my $length= @csv_fields > @import_fields ? $#csv_fields : $#import_fields

is probably a better known idiom.  I wasn't aware of List::Util but that
looks better still
_______________________________________________
BristolBathPM mailing list
[email protected]
http://mailman.bristolbath.org/mailman/listinfo/bristolbathpm

Reply via email to