Chas Owens wrote:
On 5/1/06, Rance Hall <[EMAIL PROTECTED]> wrote:

assume the following code:

my $output = qx{systemcall};

assume that the output of the systemcall looks something like this

name\n
value\n

snip

what like to do is get the name/value pairs into a hash of some sort

snip

Why are you using a scalar?  This is the perfect place to use an array:

my @output = qx(systemcall};
chomp(@output);
my %hash = @output; #first val becomes key, second val, third key,
fourth, val, etc.


What a great question: Why was I using a scalar?

Two points:

1. I never found any documentation that suggested such a thing was possible.

2. Being new at this more often than not my errors are syntax related. I'd like to get that out of the way so that when I try something and it doesn't work, the reason is obvious, right now it isn't and I'm spending alot of time checking things that are correct in order to find the things that aren't.

Thanks for the hint, that will help quite a bit.


--
Rance Hall
System Administrator
Nebraska Turkey Growers
1-308-468-5711, ext. 106
[EMAIL PROTECTED]



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to