Re: commify_series script in cookbook page 94
- From: rvtol+news@xxxxxxxxxxxx (Dr.Ruud)
- Date: Mon, 31 Mar 2008 02:02:36 +0200
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."
.
- Follow-Ups:
- Re: commify_series script in cookbook page 94
- From: Richard Lee
- Re: commify_series script in cookbook page 94
- References:
- Interpolate variable in a __DATA__ block
- From: Trudge
- Re: Interpolate variable in a __DATA__ block
- From: Gunnar Hjalmarsson
- Re: Interpolate variable in a __DATA__ block
- From: Trudge
- Re: Interpolate variable in a __DATA__ block
- From: Chas. Owens
- commify_series script in cookbook page 94
- From: Richard Lee
- Interpolate variable in a __DATA__ block
- Prev by Date: Re: sort without ignoring hyphens
- Next by Date: Re: commify_series script in cookbook page 94
- Previous by thread: Re: commify_series script in cookbook page 94
- Next by thread: Re: commify_series script in cookbook page 94
- Index(es):
Relevant Pages
|