develooper Front page | perl.perl5.porters | Postings from March 2016

[perl #127640] RFE: "qqw( $var/x $var/y word3 $var4=word4 )"

Thread Next
Linda Walsh
March 2, 2016 04:32
[perl #127640] RFE: "qqw( $var/x $var/y word3 $var4=word4 )"
Message ID:
# New Ticket Created by  Linda Walsh 
# Please include the string:  [perl #127640]
# in the subject line of all future correspondence about this issue. 
# <URL: >

This is a bug report for perl from,
generated with the help of perlbug 1.39 running under perl 5.16.3.

[Please describe your issue here]

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 ) ];
or the standard config path depency chain:

: ${prefix:=/}
: ${bootprefix:=${prefix}}
: ${eprefix:=${prefix}usr}
:	${bindir=$eprefix/bin}
:	${sbindir:=$eprefix/sbin}

In the 1st example one would want to loop through short_paths, then
assign corresponding spth_vals.  Just as in any other list,
terms are evaluated left-to-right.

I wondered whether it was worth it keeping the "qqw" terms "simple", or
allow any code option. -- or if something like  "xw" would be used
for "executable 'words'", so one could combine a path eval like:

my  ($sysfs, $sys_classes, $netclass, $sys_modules);
my chk_paths=[ XW(	$sysfs=/sys $sys_classes=$sysfs/class 
										$netclass=$sys_classes/net $sys_modules=$sysfs/module)];
(Xw = liberal "qqw" or Xw=more specific "xw" --- though not sure
of the latter's benefits, off hand).

Anyway, am I just missing this feature, or is it something
that might make sense since on the perlop page, it seems word
list not allowing interpolation begs for a form that would.

Is there any reason wny it would be a good idea?

[Please do not change anything below this line]
Site configuration information for perl 5.16.3:

Configured by law at Wed Jan 22 12:58:58 PST 2014.

Summary of my perl5 (revision 5 version 16 subversion 3) configuration:
    osname=linux, osvers=3.12.0-isht-van, archname=x86_64-linux-thread-multi-ld
    uname='linux ishtar 3.12.0-isht-van #1 smp preempt wed nov 13 16:50:51 pst 2013 x86_64 x86_64 x86_64 gnulinux '
    hint=previous, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=define
    usemymalloc=n, bincompat5005=undef
    cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-g -O2',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    ccversion='', gccversion='4.8.1 20130909 [gcc-4_8-branch revision 202388]', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='long double', nvsize=16, Off_t='off_t', lseeksize=8
    alignbytes=16, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags ='-g -fstack-protector -fPIC'
    libpth=/usr/lib64 /lib64
    libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    libc=/lib/, so=so, useshrplib=true,
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/home/perl/perl-5.16.3/lib/x86_64-linux-thread-multi-ld/CORE'
    cccdlflags='-fPIC', lddlflags='-shared -g -O2 -fstack-protector -fPIC'

Locally applied patches:

@INC for perl 5.16.3:

Environment for perl 5.16.3:
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PERL5OPT=-Mutf8 -CSA -I/home/law/bin/lib
    PERL_BADLANG (unset)

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About