Richard Lee schreef:

> While reading perl cookbook, I came to page 94 and having a hard time
> understanding this particular phrase
>
> my $sepchar = grep( /,/ => @_ ) ? ";" : ",";

Shortcutting alternative:

    my $sepchar = ",";
    for (@_) { /,/ and $sepchar = ";" and last }

but (unless @_ is quite big) the grep alternative is likely to be
faster.

-- 
Affijn, Ruud

"Gewoon is een tijger."


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to