develooper Front page | perl.perl5.porters | Postings from February 2000

[ID 20000204.007] problem using different delimiters on regex -d

Thread Next
From:
Mark.Edwards
Date:
February 4, 2000 20:23
Subject:
[ID 20000204.007] problem using different delimiters on regex -d
Message ID:
B77264E2385CD3119B5B00A0C9C56C040BA98D@albex02.sunh.com

hello -

i have noticed that using different delimiters on regex calls will give
different results.  please run the following program to illustrate.  the
data file "temp.txt is also included.
please note the difference between m//, m##, m^^    and the m?? - the
question marks do not
seem to work.


thank you,  mark edwards


> cat  test.txt
12345678901234567890
12345678901234567890

> cat  test.pl

$my_regex = q(.{20});

open (temp , "<test.txt");

my $i=0;
while (<temp>) {
        print "number $i\n"; $i++;

        print "regex is true with pound characters\n"
            if ( m#$my_regex# ) ;

        print "regex is true with question mark characters\n"
            if ( m?$my_regex? ) ;

        print "regex is true with forward slash characters\n"
            if ( m/$my_regex/ ) ;

        print "regex is true with up carat characters\n"
            if ( m^$my_regex^ ) ;
};


> perl -V
Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=hpux, osvers=11.00, archname=PA-RISC2.0
    uname='hp-ux chromium b.11.00 u 9000899 1685432391 unlimited-user
license '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='-O', gccversion=
    cppflags='-D_HPUX_SOURCE -Aa'
    ccflags ='-D_HPUX_SOURCE -Aa'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=undef, longlongsize=, d_longdbl=define, longdblsize=16
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='ld', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib/pa1.1 /lib /usr/lib /usr/ccs/lib
    libs=-lnsl -lnm -lndbm -ldld -lm -lc -lndir -lcrypt
    libc=/lib/libc.sl, so=sl, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef, ccdlflags='-Wl,-E
-Wl,-B,deferred '
    cccdlflags='+z', lddlflags='-b -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Built under hpux
  Compiled at May 27 1999 09:19:55
  @INC:
    /home/medwards/perl/lib/5.00503/PA-RISC2.0
    /home/medwards/perl/lib/5.00503
    /home/medwards/perl/lib/site_perl/5.005/PA-RISC2.0
    /home/medwards/perl/lib/site_perl/5.005
    .










Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About