[^\s]+ won't match anything: perl 5.8.0 bug or screwed up machine?

Discussion in 'Perl Misc' started by S P Arif Sahari Wibowo, Jul 2, 2006.

  1. Hi!

    I have this one machine that I help maintain remotely have its
    perl 5.8.0 exhibit peculiar behaviour: the pattern [^\s]+ will
    not match anything.

    Observe this example:

    $ cat bug.pl
    #!/usr/bin/perl -w

    while(<>) {
    print "You type:".$_;
    if(/([^\s]+)/) {
    print "[$1] (".length($1).")\n";
    }
    else {
    print "NONE\n";
    }
    }
    $ echo foo bar | ./bug.pl
    You type:foo bar
    NONE
    $

    As comparison, I copied that small program to different systems,
    one running newer (v5.8.5) and others run older (v5.6.1) perl.
    The result in these systems are different with the first system:

    $ echo foo bar | ./bug.pl
    You type:foo bar
    [foo] (3)
    $

    Any idea what happen?

    I tried reinstall linux from fresh rpm in the first system, but
    the result stand. Then I updated to the one from Fedora Legacy
    project, but it make no difference.

    I have no comparable system either the distribution version nor
    the perl version, so I cannot say for sure what is wrong here.

    More info:

    $ uname -a
    Linux rinjani 2.6.10-rinjani #1 Thu Dec 30 11:22:45 CST 2004 i686 i686 i386 GNU/Linux
    $ rpm -q perl
    perl-5.8.0-90.0.13.legacy
    $ cat /etc/*release*
    Red Hat Linux release 9 (Shrike)
    $ perl -v

    This is perl, v5.8.0 built for i386-linux-thread-multi
    (with 2 registered patches, see perl -V for more detail)

    Copyright 1987-2002, Larry Wall

    Perl may be copied only under the terms of either the Artistic License or the
    GNU General Public License, which may be found in the Perl 5 source kit.

    Complete documentation for Perl, including FAQ lists, should be found on
    this system using `man perl' or `perldoc perl'. If you have access to the
    Internet, point your browser at http://www.perl.com/, the Perl Home Page.

    $ perl -V
    Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
    Platform:
    osname=linux, osvers=2.6.8-1.521smp, archname=i386-linux-thread-multi
    uname='linux jan'
    config_args='-des -Doptimize=-O2 -g -pipe -march=i386 -mcpu=i686 -Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux -Dvendorprefix=/usr -Dsiteprefix=/usr -Dotherlibdirs=/usr/lib/perl5/5.8.0 -Duseshrplib -Dusethreads -Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef'
    useithreads=define usemultiplicity=
    useperlio= d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=un uselongdouble=
    usemymalloc=, bincompat5005=undef
    Compiler:
    cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
    optimize='',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -I/usr/include/gdbm'
    ccversion='', gccversion='3.2.2 20030222 (Red Hat Linux 3.2.2-5)', gccosandvers=''
    gccversion='3.2.2 200302'
    intsize=r, longsize=r, ptrsize=5, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long'
    k', ivsize=4'
    ivtype=, nvtype='double'
    o_nonbl', nvsize=, Off_t='', lseeksize=8
    alignbytes=4, prototype=define
    Linker and Libraries:
    ld='gcc'
    l', ldflags =' -L/usr'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lgdbm -ldb -ldl -lm -lpthread -lc -lcrypt -lutil
    perllibs=
    libc=/lib/libc-2.3.2.so, so=so, useshrplib=true, libperl=libper
    gnulibc_version='2.3.2'
    Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so', d_dlsymun=undef, ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE'
    cccdlflags='-fPIC'
    ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/perl5', lddlflags='s Unicode/Normalize XS/A'


    Characteristics of this binary (from libperl):
    Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
    Locally applied patches:
    MAINT18379
    SPRINTF0 - fixes for sprintf formatting issues - CVE-2005-3962
    Built under linux
    Compiled at Jan 28 2006 08:04:14
    @INC:
    /usr/lib/perl5/5.8.0/i386-linux-thread-multi
    /usr/lib/perl5/5.8.0
    /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
    /usr/lib/perl5/site_perl/5.8.0
    /usr/lib/perl5/site_perl
    /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
    /usr/lib/perl5/vendor_perl/5.8.0
    /usr/lib/perl5/vendor_perl
    /usr/lib/perl5/5.8.0/i386-linux-thread-multi
    /usr/lib/perl5/5.8.0
    S P Arif Sahari Wibowo, Jul 2, 2006
    #1
    1. Advertising

  2. S P Arif Sahari Wibowo

    Dr.Ruud Guest

    S P Arif Sahari Wibowo schreef:

    > perl 5.8.0 exhibit peculiar behaviour: the pattern [^\s]+ will
    > not match anything.


    Workaround: \S+

    --
    Affijn, Ruud

    "Gewoon is een tijger."
    Dr.Ruud, Jul 2, 2006
    #2
    1. Advertising

  3. On Sun, 2 Jul 2006, Dr.Ruud wrote:
    > S P Arif Sahari Wibowo schreef:
    >> perl 5.8.0 exhibit peculiar behaviour: the pattern [^\s]+
    >> will not match anything.

    >
    > Workaround: \S+


    Actually I will need other character in that brackets, e.g.
    [^\s\<\@]+ something like that. Can you tell me how your
    workaround works in that case?

    Thanks!

    --
    (Stephan Paul) Arif Sahari Wibowo
    _____ _____ _____ _____
    /____ /____/ /____/ /____
    _____/ / / / _____/ http://www.arifsaha.com/
    S P Arif Sahari Wibowo, Jul 2, 2006
    #3
  4. On Sun, 2 Jul 2006, Todd W wrote:
    > Give us some sample data please. Then we can help.


    I did. I'll repost my original posting, then.

    --
    (Stephan Paul) Arif Sahari Wibowo
    _____ _____ _____ _____
    /____ /____/ /____/ /____
    _____/ / / / _____/ http://www.arifsaha.com/
    S P Arif Sahari Wibowo, Jul 2, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Richard Fagen
    Replies:
    0
    Views:
    410
    Richard Fagen
    Aug 28, 2003
  2. KK
    Replies:
    1
    Views:
    326
    Ken Cox [Microsoft MVP]
    Feb 23, 2005
  3. My site is screwed

    , Aug 25, 2005, in forum: ASP .Net
    Replies:
    8
    Views:
    420
    =?Utf-8?B?d2JyaWFud2hpdGU=?=
    Aug 29, 2005
  4. Just Another Victim of the Ambient Morality

    Ruby in Steel won't work, am I just screwed?

    Just Another Victim of the Ambient Morality, Aug 13, 2006, in forum: Ruby
    Replies:
    0
    Views:
    97
    Just Another Victim of the Ambient Morality
    Aug 13, 2006
  5. S P Arif Sahari Wibowo
    Replies:
    1
    Views:
    103
    Joe Smith
    Jul 2, 2006
Loading...

Share This Page