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

[perl #58264]

Thread Next
johannes valks
August 22, 2008 14:19
[perl #58264]
Message ID:
# New Ticket Created by  johannes valks 
# Please include the string:  [perl #58264]
# in the subject line of all future correspondence about this issue. 
# <URL: >

Hello there - I have something which looks like a bug or something that I use wrong.
It is about regular expressions where you use a lookahead.
Here is the simply script:
#!O:/Perl/bin/perl.exe#-----------------------------------------------------------------------------        print "Content-type: text/html;\n\n";
        $text='******hello world!';        $text=~/\G\**/gc;               # ignore the stars...        $first=$text=~/\G(?=\w+)/gc;    # is there a word at \G? YES
                                        # - perl returns 1...        $second=$text=~/\G(?=\w+)/gc;   # is there a word at \G? YES                                        # - but perl returns undef!!!
        print "<p>first=$first; second=$second</p>";#-----------------------------------------------------------------------------
I repeat the same expression - but the second time perl return undef!!!
Why????????? A bug????
Here is info about my version (perl -v):
#-----------------------------------------------------------------------------This is perl, v5.6.1 built for MSWin32-x86-multi-thread(with 1 registered patch, see perl -V for more detail)
Copyright 1987-2001, Larry Wall
Binary build 633 provided by ActiveState Corp. http://www.ActiveState.comBuilt 21:33:05 Jun 17 2002
Perl may be copied only under the terms of either the Artistic License or tGNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found onthis system using `man perl' or `perldoc perl'.  If you have access to theInternet, point your browser at, the Perl Home Page.#-----------------------------------------------------------------------------
And more  (perl -V):
#-----------------------------------------------------------------------------Summary of my perl5 (revision 5 version 6 subversion 1) configuration:  Platform:    osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread    uname=''    config_args='undef'    hint=recommended, useposix=true, d_sigaction=undef    usethreads=undef use5005threads=undef useithreads=define usemultiplicity=define    useperlio=undef d_sfio=undef uselargefiles=undef usesocks=undef    use64bitint=undef use64bitall=undef uselongdouble=undef  Compiler:    cc='cl', ccflags ='-nologo -O1 -MD -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT  -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DPERL_MSVCRT_READFIX',    optimize='-O1 -MD -DNDEBUG',    cppflags='-DWIN32'    ccversion='', gccversion='', gccosandvers=''    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234    d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10    ivtype='long', ivsize=4, nvtype='double', nvsize=!
 8, Off_t='off_t', lseeksize=4    alignbytes=8, usemymalloc=n, prototype=define  Linker and Libraries:    ld='link', ldflags ='-nologo -nodefaultlib -release  -libpath:"O:/Perl\lib\CORE"  -machine:x86'    libpth="O:\Perl\lib\CORE"    libs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib  comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib msvcrt.lib    perllibs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib  comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib uuid.libwsock32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib msvcrt.lib    libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl56.lib  Dynamic Linking:    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '    cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -release  -libpath:"O:/Perl\lib\CORE"  -machine:x86'
Characteristics of this binary (from libperl):  Compile-time options: MULTIPLICITY USE_ITHREADS PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS  Locally applied patches:        ActivePerl Build 633  Built under MSWin32  Compiled at Jun 17 2002 21:33:05  @INC:    O:/Perl/lib    O:/Perl/site/lib    .#-----------------------------------------------------------------------------
Greetings, Johannes Valks
Doe de quiz, upload je foto en download gratis jouw topsporter Wink!
Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About