in reply to Problems with my DB lookup script

Note that in the data dumper output (the $VAR1 = ...) section, you have multiple entries with escaped ' characters. I believe your issue is that when you pass your list, you are double quoting it, as opposed to the sample you provided. It looks to me like you'll get the results you are looking for with:

$EVENT->{'slots'}->{'NTSD_VALUES'} = lookup_NTSD_val('[Cover],[UseSubType],[Building],[Network],[Environment],[AssetNo],[Primary_IP_Address],[ServiceID],[OS],[Team]', '[ServerComp]', "left([ServerName], $L) = '$hostN'");

See the docs on string interpolation. As a side note, for future code you may want to look into DBI and using placeholders to simplify your life and to return more useful diagnostics when you query your database.

Replies are listed 'Best First'.
Re^2: Problems with my DB lookup script
by Mych (Initiate) on Apr 27, 2009 at 15:23 UTC

    Kenneth,

    Thanks for taking time to go through my post... You hit the nail on the head... $VAR1 now returns:

    $VAR1 = { '[SvrStatus]' => 'DEVELOPMENT', '[ApproxUsers]' => 151, '[AsstNo]' => 'AS012345', '[ServerLocation]' => 'XDC 1 5 34', '[OSVersion]' => '5.0', '[ServerServiceNo]' => 'CD123DC321', '[ServerDescription]' => 'App Server', '[IPAddress1]' => 'XXX.XXX.XXX.XXX', '[ServerDomain]' => 'XYZ' };

    Now all I have to do is figure out how to split this up into the individual fields. I need them to be assigned to:

    $EVENT->{'slots'}->{'NTSD_SvrStatus'} $EVENT->{'slots'}->{'NTSD_ApproxUsers'} $EVENT->{'slots'}->{'NTSD_AsstNo'}etc...

    Onwards and upward...

    Many thanks

    Mych

    I have not failed... just found 100 ways that don't work YET!