Hi Gary,
On Wed, Apr 25, 2001 at 03:26:31PM +0100, Gary Stainburn
([EMAIL PROTECTED]) spew-ed forth:
> I know this is gonna be a daft one, but can anyone explain why the
> following code generates the output below.
>
> print "argv=$ARGV[0]\n";
> my($dealer,$system,$dtype,$ref)=split(".",$ARGV[0]);
> print"dealer=${dealer}\nsystem=${system}\ndtype=${dtype}\nref=${ref}\n";
split takes a /PATTERN/, so you would want:
my($dealer,$system,$dtype,$ref)=split(/\./,$ARGV[0]);
You may be confusing it with the params C<join> takes, which takes an EXPR and
not a PATTERN.
Cheers,
Kevin
Writing CGI Applications with Perl - http://perlcgi-book.com
--
"If you understand what you're doing, you're not learning anything."
-- Abraham Lincoln