develooper Front page | perl.perl5.porters | Postings from August 2001

[ID 20010827.004] qw// documentation says a list is created

Thread Next
Ren Maddox
August 27, 2001 08:32
[ID 20010827.004] qw// documentation says a list is created
Message ID:
This is a bug report for perl from,
generated with the help of perlbug 1.33 running under perl v5.6.1.

The documentation of qw// states that a list is created.  It needs
to be reworded in terms of context.  Here's one attempt:


               Evaluates to a sequence of comma-separated,
               single-quoted sub-strings extracted out of STRING,
               using embedded whitespace as the delimiters.

               In list context, it can be understood as being roughly
               equivalent to:

                   split(' ', q/STRING/, -1);

               the difference being that it happens at compile time.

               In scalar context, it evaluates to the final sub-string
               of the sequence.

               So this expression:

                   qw(foo bar baz)

               is semantically equivalent to this one:

                   ('foo', 'bar', 'baz')

               in both list and scalar contexts (evaluating to a list
               of the three elements in list context and 'baz' in
               scalar context).

               Some frequently seen examples:

                   use POSIX qw( setlocale localeconv )
                   @EXPORT = qw( foo bar baz );

               A common mistake is to try to separate the words
               with comma or to put comments into a multi-line
               "qw"-string.  For this reason, the "use warnings"
               pragma and the -w switch (that is, the "$^W" vari
               able) produces warnings if the STRING contains the
               "," or the "#" character.

Site configuration information for perl v5.6.1:

Configured by daves at Wed Jul  4 15:34:35 PDT 2001.

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
    osname=linux, osvers=2.2.12-20smp, archname=i686-linux-thread-multi
    uname='linux molotok 2.2.12-20smp #1 smp mon sep 27 10:34:45 edt 1999 i686 unknown '
    config_args='-des -Dcc=gcc -Dcf_by=ActiveState -Uinstallusrbinperl -Dusethreads -Duseithreads -Dinc_version_list=5.6.0/$archname 5.6.0 -Dprefix=/usr/local/ActivePerl-5.6'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
    useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    cc='gcc', ccflags ='-D_REENTRANT -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    cppflags='-D_REENTRANT -fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lpthread -lc -lposix -lcrypt -lutil
    perllibs=-lnsl -ldl -lm -lpthread -lc -lposix -lcrypt -lutil
    libc=/lib/, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:

@INC for perl v5.6.1:

Environment for perl v5.6.1:
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)

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