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

[ID 20000307.006] $1, $2 and the '..' operator

Thread Previous
Aaron Harsh
March 7, 2000 11:33
[ID 20000307.006] $1, $2 and the '..' operator
Message ID:
This is a bug report for perl from,
generated with the help of perlbug 1.26 running under perl 5.00502.

[Please enter your report here]

It looks like $<digit> vars don't appear to interact cleanly
with the '..' operator.  For example, this script:

    #!/usr/bin/perl -w

    use strict;

    my $foo = "A-C";
    if ($foo =~ s/^(\w+)-(\w+)//) {
        print join(",", $1 .. $2), "\n";

    my $bar = "A-C";
    if ($bar =~ s/^(\w+)-(\w+)//) {
        my $baz = $1 . $2;
        print join(",", $1 .. $2), "\n";

gives this output on my system:

    Argument "A" isn't numeric in flop at ./ line 6.
    Argument "C" isn't numeric in flop at ./ line 6.
    Argument "A" isn't numeric in flop at ./ line 6.
    Argument "C" isn't numeric in flop at ./ line 6.

Note that the script gives the expected results on line 13.

[Please do not change anything below this line]

Site configuration information for perl 5.00502:

Configured by ajh at Sat Oct 17 22:33:23 PDT 1998.

Summary of my perl5 (5.0 patchlevel 5 subversion 2) configuration:
    osname=linux, osvers=2.0.34, archname=i686-linux-thread
    uname='linux 2.0.34 #7 sat oct 17 19:11:23 pdt 1998 i686 unknown '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define useperlio=undef d_sfio=undef
    cc='cc', optimize='-O2', gccversion=
    cppflags='-D_REENTRANT -Dbool=char -DHAS_BOOL'
    ccflags ='-D_REENTRANT -Dbool=char -DHAS_BOOL'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lpthread -lc -lposix -lcrypt
    libc=, 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 5.00502:

Environment for perl 5.00502:
    LANG (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)

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