Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!think.com!mintaka!bloom-beacon!eru!hagbard!sunic!chalmers.se!appli!niklas From: niklas@appli.se (Niklas Hallqvist) Newsgroups: comp.lang.perl Subject: Re: ".." inside a variable Message-ID: <1362@appli.se> Date: 9 May 91 23:03:21 GMT References: <1180016@hpcc01.HP.COM> Organization: Applitron Datasystem AB, GOTHENBURG, SWEDEN Lines: 32 okamoto@hpcc01.HP.COM (Jeff Okamoto) writes: >I'm trying to get the .. construct to work when it is passed in as a command >line argument. What I am having trouble with is getting the .. to properly >expand. I've tried a bunch of ways to force the result into an array context, >but I'm obviously doing something wrong. >I've tried a number of variations on the following, to no avail: > $a = "'A0'..'A9'"; # Eventually will be shift(@ARGV); > eval "\@b = (\$a)"; >Can anyone offer any suggestions? What version of perl are you running? On my 4.003 the following perl-script works allright: #!/local/bin/perl $range = shift; eval "@array = $range"; print "@array\n"; When invoked as: foo "'A1'..'A9'" it prints: A1 A2 A3 A4 A5 A6 A7 A8 A9 That's what you wanted, wasn't it? Niklas