Hello,

  I run an executable that returns a small array of data.

my @ans = qx {"myexec"};

@ans contains the values,

Value    = 10000
Status   = 13
Options = 0x0a
Quality = 3

I use a map function to convert this array into a hash.

my %results = map {(split /=/)} @ans;

My questions are:

1. How to I get rid of the blanks on either side of the key and the value?
2. How do I also get rid of the CRLF in the value?


I want to be able to reference my hash using something like

if ($results{Status} == 9)
  {
   print "value, $results{Value}, is good";
  }

I may have a syntax error question too: i.e. do I need to double quote the key? e.g. if ($results{"Status"} == 9)

Any help would be greatly appreciated.

Thank you.


_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to