develooper Front page | perl.perl5.porters | Postings from May 2012

[perl #112914] suppress warning on using unquoted strings in {} in slices too

Thread Previous | Thread Next
From:
Father Chrysostomos via RT
Date:
May 14, 2012 14:34
Subject:
[perl #112914] suppress warning on using unquoted strings in {} in slices too
Message ID:
rt-3.6.HEAD-4610-1337031256-141.112914-15-0@perl.org
On Mon May 14 14:07:44 2012, uri@stemsystems.com wrote:
> On 05/14/2012 04:46 PM, Father Chrysostomos via RT wrote:
> 
> <offlist>
> 
> >
> > Don’t tell anyone I said this (oops! is this list public? :-), but
> you
> > can omit the qw if you use angle brackets as the delimeter, if you
> think
> > qw is too ugly:
> >
> > $hash{<foo bar baz>}
> >
> > It’s actually using the glob operator, which splits the pattern on
> > spaces, and returns each segment that contains no metacharacters
> unchanged.
> 
> wouldn't that be really slow as glob has to read the dir to see if
> there
> are files with those names? maybe it won't as there are no metachars

Your latter statement is correct.  In fact, in 5.16, once File::Glob is
loaded, glob should be about the same speed as split.

> (i
> never use glob - read_dir from file::slurp is my friend). also i think
> that would trigger pseudo multilevel hashes (using $; as the token
> separator) and i doubt that is wanted.

I meant @hash{...}, not $hash{...}.

> 
> besides all this, linda w seems to be wacko. not understanding => and
> wanting multiple token quoting? and how hard is qw() to type? jeez.

Well @hash{<foo bar>} looks prettier than @hash{qw<foo bar>}, doesn’t it?

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: rejected
https://rt.perl.org:443/rt3/Ticket/Display.html?id=112914

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About