Maybe I've got a funky version of perl. When I run both your snippets I get answers different from yours. For the first program I get...
greg@sparky:~/test$ cat enlil1 #!/usr/bin/perl use Data::Dumper; use strict; use warnings; my $ref=\(1..3); my $oth_ref = \(1,2,3); print Dumper $ref,$oth_ref greg@sparky:~/test$ ./enlil1 $VAR1 = [ 1, 2, 3 ]; $VAR2 = \3;
...and for the second...
greg@sparky:~/test$ cat enlil2 #!/usr/bin/perl use Data::Dumper; use strict; use warnings; my @array = \(1 .. 3, 5 ..9); my @array2 = \(1,2,3,5,6,7,8,9); my @array3 = (\(1 ..3),\(5,6,7,8,9)); print Dumper \@array,\@array2,\@array3; greg@sparky:~/test$ ./enlil2 $VAR1 = [ [ 1, 2, 3 ], [ 5, 6, 7, 8, 9 ] ]; $VAR2 = [ \1, \2, \3, \5, \6, \7, \8, \9 ]; $VAR3 = [ [ 1, 2, 3 ], \5, \6, \7, \8, \9 ];
Here's what my 'perl -V' looks like...
greg@sparky:~/test$ perl -V Summary of my perl5 (revision 5.0 version 8 subversion 0) configuratio +n: Platform: osname=linux, osvers=2.4.21, archname=i486-linux uname='linux midas 2.4.21 #6 sat jun 14 22:48:45 pdt 2003 i686 unk +nown unknown gnulinux ' config_args='-de -Dprefix=/usr -Dcccdlflags=-fPIC -Darchname=i486- +linux' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultipl +icity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FIL +E_OFFSET_BITS=64', optimize='-O3', cppflags='-fno-strict-aliasing' ccversion='', gccversion='3.2.3', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=1 +2 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', + lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -lgdbm -ldb -ldl -lm -lc -lcrypt -lutil perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil libc=/lib/libc-2.3.2.so, so=so, useshrplib=false, libperl=libperl. +a gnulibc_version='2.3.2' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynami +c' cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: USE_LARGE_FILES Built under linux Compiled at Aug 19 2003 15:52:31 @INC: /usr/lib/perl5/5.8.0/i486-linux /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i486-linux /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl .


-- All code is 100% tested and functional unless otherwise noted.

In reply to Re^2: list references by sleepingsquirrel
in thread list references by sleepingsquirrel

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.