On Wed Mar 02 00:03:42 2016, plokinom@gmail.com wrote: > Am 02.03.2016 um 05:32 schrieb Linda Walsh (via RT): > > > > Every once in a while, I start filling an array using > > "qw()", when I run into, not too infrequently, a desire > > to have a var or expression as a "word". Paths can be > > a good example: > > > > my short_paths=[ qw( sysfs sys_classes netclass > > sysmods) ]; > > my spth_vals =[qqw( /sys $sysfs/class > > $sys_classes/net $sysfs/module ) ]; > > It's not core perl, but Quote::Code (available for perl 5.14+) lets > you > write this: > > use Quote::Code; > my $pth_vals = [qcw( > /sys {$sysfs}/class {$sys_classes}/net {$sysfs}/module > )]; Also, if you *know* that your strings contain no wildcards, you can do <foo bar $baz> (or </sys $sysfs/class $sys_classes/net $sysfs/module>), and it won’t even go out to the filesystem, though it is marginally slower than qw and Quote::Code (at least in theory; I have not measured it). -- Father Chrysostomos --- via perlbug: queue: perl5 status: open https://rt.perl.org/Ticket/Display.html?id=127640Thread Previous