Unexpected initial null in return from split()

From: Craig M. Votava (craig_at_lucent.com)
Date: 01/30/04


Date: Fri, 30 Jan 2004 12:57:05 -0600

Folks-

I'm trying to do something fairly that should be
fairly easy, and obvious:
------------------------------------------------
my %info = split(/magic/, `pkginfo -l SUNWarc`);
print $info{VERSION};
------------------------------------------------
My problem is: what magic will make this work?

Here's my closest solution (using arrays for debugging):
---------------------------------------------------------
use Data::Dumper;
my @info = split(/^\s+(\S+:)\s+/m, `pkginfo -l SUNWarc`);
print STDERR Dumper(\@info);
---------------------------------------------------------

In my environment, info[0] is null, all the rest of the
array is exactly what I would expect. WHERE IS THIS INITIAL
NULL COMING FROM!!! Grrrr, I'm frustrated.

Any help is very much appreciated!

Thanks

-Craig Votava
Lucent Technologies
craig@lucent.com