Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Can't use string ("1") as an ARRAY ref while "strict refs

by seekinghelp12 (Novice)
on Dec 07, 2016 at 18:19 UTC ( [id://1177403]=perlquestion: print w/replies, xml ) Need Help??

seekinghelp12 has asked for the wisdom of the Perl Monks concerning the following question:

Hi wise monks. This is a peculiar situation where I can run this code in windows activePerl(5.8)/strawberry perl(5.24.0) with no issues but when I try to run it in linux, I get an error: method nas:list_task has returned an error: Can't use string ("1") as an ARRAY ref while "strict refs" in use at (re_eval 127) line 1. Linux perl version is 5.10.1. Can you provide some insights as to why this might be the issue?

I took a datadump in Windows of the returned result:

$VAR1 = bless( [ [ bless( { 'reservedDurationType' => '0', 'runningChildTaskId' => '', 'approvalUsers' => '', 'expensive' => '1', 'subTask' => '-1000', 'failureType' => '', 'approveByDate' => 'Tue Dec 06 06:00:00 MS +T 2016', 'systemTask' => '0', 'repeatType' => '1', 'taskCustom3' => '', 'deviceDataID' => '', 'completeDate' => 'Wed Dec 07 06:00:45 MST + 2016', 'result' => '-', 'taskType' => 'com.rendition.dib.CustomAct +ionsTask', 'repeatEndDate' => '', 'messageTo' => '', 'taskCustom1' => '', 'runASAP' => '0', 'repeatWeekday' => '', 'ticketNumber' => '', 'taskUserID' => '201', 'siteID' => '', 'parentTaskID' => '46812831', 'createDate' => 'Wed Dec 07 06:00:00 MST 2 +016', 'userGeneratedChange' => 'true', 'reservationEndDate' => 'Wed Dec 07 07:00: +00 MST 2016', 'coreID' => '1', 'saveTask' => 'true', 'priority' => '3', 'failedChildCount' => '', 'comments' => '-', 'taskData' => '-', 'retryCount' => '0', 'tag' => '', 'taskCustom2' => '', 'scheduleDate' => 'Wed Dec 07 06:00:00 MST + 2016', 'stopOnFail' => '0', 'durationStr' => '60', 'taskCustom4' => '', 'taskName' => 'TGreenLeeCiscoSwitchGet', 'duration' => '46', 'approvalStatus' => '2', 'repeatCount' => '', 'deviceGroupID' => '', 'csvData' => '', 'startDate' => 'Wed Dec 07 06:00:00 MST 20 +16', 'scheduleTaskID' => '46812861', 'approvalPriority' => '', 'status' => '2', 'repeatInterval' => '', 'saveFavoriteLink' => 'false', 'deviceID' => '4281', 'succeededChildCount' => '', 'runType' => 'Parallel', 'pendingChildCount' => '', 'taskCustom5' => '', 'saveTemplate' => 'false', 'lastModifiedDate' => 'Wed Dec 07 06:00:45 + MST 2016', 'subTasks' => '', 'csvGroupTask' => '0', 'taskCustom6' => '', 'reservedDuration' => '3600', 'retryInterval' => '300', 'resultConfigID' => '' }, 'Opsware::NAS::Client::ScheduleTaskVO_6_0 +_x' ), bless( { 'reservedDurationType' => '0', 'runningChildTaskId' => '', 'approvalUsers' => '', 'expensive' => '1', 'subTask' => '-1000', 'failureType' => '', 'approveByDate' => 'Tue Dec 06 06:00:00 MS +T 2016', 'systemTask' => '0', 'repeatType' => '1', 'taskCustom3' => '', 'deviceDataID' => '', 'completeDate' => 'Wed Dec 07 06:00:35 MST + 2016', 'result' => '-', 'taskType' => 'com.rendition.dib.CustomAct +ionsTask', 'repeatEndDate' => '', 'messageTo' => '', 'taskCustom1' => '', 'runASAP' => '0', 'repeatWeekday' => '', 'ticketNumber' => '', 'taskUserID' => '201', 'siteID' => '', 'parentTaskID' => '46812831', 'createDate' => 'Wed Dec 07 06:00:00 MST 2 +016', 'userGeneratedChange' => 'true', 'reservationEndDate' => 'Wed Dec 07 07:00: +00 MST 2016', 'coreID' => '1', 'saveTask' => 'true', 'priority' => '3', 'failedChildCount' => '', 'comments' => '-', 'taskData' => '-', 'retryCount' => '0', 'tag' => '', 'taskCustom2' => '', 'scheduleDate' => 'Wed Dec 07 06:00:00 MST + 2016', 'stopOnFail' => '0', 'durationStr' => '60', 'taskCustom4' => '', 'taskName' => 'TGreenLeeCiscoSwitchGet', 'duration' => '35', 'approvalStatus' => '2', 'repeatCount' => '', 'deviceGroupID' => '', 'csvData' => '', 'startDate' => 'Wed Dec 07 06:00:00 MST 20 +16', 'scheduleTaskID' => '46812881', 'approvalPriority' => '', 'status' => '2', 'repeatInterval' => '', 'saveFavoriteLink' => 'false', 'deviceID' => '4751', 'succeededChildCount' => '', 'runType' => 'Parallel', 'pendingChildCount' => '', 'taskCustom5' => '', 'saveTemplate' => 'false', 'lastModifiedDate' => 'Wed Dec 07 06:00:35 + MST 2016', 'subTasks' => '', 'csvGroupTask' => '0', 'taskCustom6' => '', 'reservedDuration' => '3600', 'retryInterval' => '300', 'resultConfigID' => '' }, 'Opsware::NAS::Client::ScheduleTaskVO_6_0 +_x' ), bless( { 'reservedDurationType' => '0', 'runningChildTaskId' => '', 'approvalUsers' => '', 'expensive' => '1', 'subTask' => '-1000', 'failureType' => '', 'approveByDate' => 'Tue Dec 06 06:00:00 MS +T 2016', 'systemTask' => '0', 'repeatType' => '1', 'taskCustom3' => '', 'deviceDataID' => '', 'completeDate' => 'Wed Dec 07 06:05:28 MST + 2016', 'result' => '-', 'taskType' => 'com.rendition.dib.CustomAct +ionsTask', 'repeatEndDate' => '', 'messageTo' => '', 'taskCustom1' => '', 'runASAP' => '0', 'repeatWeekday' => '', 'ticketNumber' => '', 'taskUserID' => '201', 'siteID' => '', 'parentTaskID' => '46812831', 'createDate' => 'Wed Dec 07 06:00:00 MST 2 +016', 'userGeneratedChange' => 'true', 'reservationEndDate' => 'Wed Dec 07 07:00: +00 MST 2016', 'coreID' => '1', 'saveTask' => 'true', 'priority' => '3', 'failedChildCount' => '0', 'comments' => '-', 'taskData' => '-', 'retryCount' => '0', 'tag' => '', 'taskCustom2' => '', 'scheduleDate' => 'Wed Dec 07 06:00:00 MST + 2016', 'stopOnFail' => '0', 'durationStr' => '60', 'taskCustom4' => '', 'taskName' => 'TGreenLeeCiscoSwitchGet', 'duration' => '329', 'approvalStatus' => '2', 'repeatCount' => '', 'deviceGroupID' => '', 'csvData' => '', 'startDate' => 'Wed Dec 07 06:00:00 MST 20 +16', 'scheduleTaskID' => '46812891', 'approvalPriority' => '', 'status' => '2', 'repeatInterval' => '', 'saveFavoriteLink' => 'false', 'deviceID' => '4781', 'succeededChildCount' => '0', 'runType' => 'Parallel', 'pendingChildCount' => '1', 'taskCustom5' => '', 'saveTemplate' => 'false', 'lastModifiedDate' => 'Wed Dec 07 06:05:28 + MST 2016', 'subTasks' => '', 'csvGroupTask' => '0', 'taskCustom6' => '', 'reservedDuration' => '3600', 'retryInterval' => '300', 'resultConfigID' => '' }, 'Opsware::NAS::Client::ScheduleTaskVO_6_0 +_x' ), bless( { 'reservedDurationType' => '0', 'runningChildTaskId' => '', 'approvalUsers' => '', 'expensive' => '1', 'subTask' => '0', 'failureType' => '', 'approveByDate' => 'Tue Dec 06 06:00:00 MS +T 2016', 'systemTask' => '0', 'repeatType' => '3', 'taskCustom3' => '', 'deviceDataID' => '', 'completeDate' => '', 'result' => '-', 'taskType' => 'com.rendition.dib.CustomAct +ionsTask', 'repeatEndDate' => '', 'messageTo' => '', 'taskCustom1' => '', 'runASAP' => '0', 'repeatWeekday' => '', 'ticketNumber' => '', 'taskUserID' => '201', 'siteID' => '', 'parentTaskID' => '', 'createDate' => 'Mon Dec 05 18:36:29 MST 2 +016', 'userGeneratedChange' => 'true', 'reservationEndDate' => 'Thu Dec 08 07:00: +00 MST 2016', 'coreID' => '1', 'saveTask' => 'true', 'priority' => '3', 'failedChildCount' => '', 'comments' => '-', 'taskData' => '-', 'retryCount' => '0', 'tag' => '', 'taskCustom2' => '', 'scheduleDate' => 'Thu Dec 08 06:00:00 MST + 2016', 'stopOnFail' => '0', 'durationStr' => '60', 'taskCustom4' => '', 'taskName' => 'TGreenLeeCiscoSwitchGet', 'duration' => '', 'approvalStatus' => '2', 'repeatCount' => '', 'deviceGroupID' => '1901', 'csvData' => '', 'startDate' => '', 'scheduleTaskID' => '46741711', 'approvalPriority' => '', 'status' => '1', 'repeatInterval' => '', 'saveFavoriteLink' => 'false', 'deviceID' => '', 'succeededChildCount' => '', 'runType' => 'Parallel', 'pendingChildCount' => '', 'taskCustom5' => '', 'saveTemplate' => 'false', 'lastModifiedDate' => 'Wed Dec 07 06:00:00 + MST 2016', 'subTasks' => '', 'csvGroupTask' => '0', 'taskCustom6' => '', 'reservedDuration' => '3600', 'retryInterval' => '300', 'resultConfigID' => '' }, 'Opsware::NAS::Client::ScheduleTaskVO_6_0 +_x' ), bless( { 'reservedDurationType' => '0', 'runningChildTaskId' => '', 'approvalUsers' => '', 'expensive' => '1', 'subTask' => '0', 'failureType' => '', 'approveByDate' => 'Tue Dec 06 06:00:00 MS +T 2016', 'systemTask' => '0', 'repeatType' => '1', 'taskCustom3' => '', 'deviceDataID' => '', 'completeDate' => 'Wed Dec 07 06:05:31 MST + 2016', 'result' => '-', 'taskType' => 'com.rendition.dib.CustomAct +ionsTask', 'repeatEndDate' => '', 'messageTo' => '', 'taskCustom1' => '', 'runASAP' => '0', 'repeatWeekday' => '', 'ticketNumber' => '', 'taskUserID' => '201', 'siteID' => '', 'parentTaskID' => '46741711', 'createDate' => 'Wed Dec 07 06:00:00 MST 2 +016', 'userGeneratedChange' => 'true', 'reservationEndDate' => 'Wed Dec 07 07:00: +00 MST 2016', 'coreID' => '1', 'saveTask' => 'true', 'priority' => '3', 'failedChildCount' => '1', 'comments' => '-', 'taskData' => '-', 'retryCount' => '0', 'tag' => '', 'taskCustom2' => '', 'scheduleDate' => 'Wed Dec 07 06:00:00 MST + 2016', 'stopOnFail' => '0', 'durationStr' => '60', 'taskCustom4' => '', 'taskName' => 'TGreenLeeCiscoSwitchGet', 'duration' => '331', 'approvalStatus' => '2', 'repeatCount' => '', 'deviceGroupID' => '1901', 'csvData' => '', 'startDate' => 'Wed Dec 07 06:00:00 MST 20 +16', 'scheduleTaskID' => '46812831', 'approvalPriority' => '', 'status' => '12', 'repeatInterval' => '', 'saveFavoriteLink' => 'false', 'deviceID' => '', 'succeededChildCount' => '11', 'runType' => 'Parallel', 'pendingChildCount' => '0', 'taskCustom5' => '', 'saveTemplate' => 'false', 'lastModifiedDate' => 'Wed Dec 07 06:05:32 + MST 2016', 'subTasks' => '', 'csvGroupTask' => '0', 'taskCustom6' => '', 'reservedDuration' => '3600', 'retryInterval' => '300', 'resultConfigID' => '' }, 'Opsware::NAS::Client::ScheduleTaskVO_6_0 +_x' ), bless( { 'reservedDurationType' => '0', 'runningChildTaskId' => '', 'approvalUsers' => '', 'expensive' => '1', 'subTask' => '-1000', 'failureType' => '', 'approveByDate' => 'Tue Dec 06 06:00:00 MS +T 2016', 'systemTask' => '0', 'repeatType' => '1', 'taskCustom3' => '', 'deviceDataID' => '', 'completeDate' => 'Wed Dec 07 06:00:06 MST + 2016', 'result' => '-', 'taskType' => 'com.rendition.dib.CustomAct +ionsTask', 'repeatEndDate' => '', 'messageTo' => '', 'taskCustom1' => '', 'runASAP' => '0', 'repeatWeekday' => '', 'ticketNumber' => '', 'taskUserID' => '201', 'siteID' => '', 'parentTaskID' => '46812831', 'createDate' => 'Wed Dec 07 06:00:00 MST 2 +016', 'userGeneratedChange' => 'true', 'reservationEndDate' => 'Wed Dec 07 07:00: +00 MST 2016', 'coreID' => '1', 'saveTask' => 'true', 'priority' => '3', 'failedChildCount' => '0', 'comments' => '-', 'taskData' => '-', 'retryCount' => '0', 'tag' => '', 'taskCustom2' => '', 'scheduleDate' => 'Wed Dec 07 06:00:00 MST + 2016', 'stopOnFail' => '0', 'durationStr' => '60', 'taskCustom4' => '', 'taskName' => 'TGreenLeeCiscoSwitchGet', 'duration' => '6', 'approvalStatus' => '2', 'repeatCount' => '', 'deviceGroupID' => '', 'csvData' => '', 'startDate' => 'Wed Dec 07 06:00:01 MST 20 +16', 'scheduleTaskID' => '46812931', 'approvalPriority' => '', 'status' => '3', 'repeatInterval' => '', 'saveFavoriteLink' => 'false', 'deviceID' => '7081', 'succeededChildCount' => '0', 'runType' => 'Parallel', 'pendingChildCount' => '1', 'taskCustom5' => '', 'saveTemplate' => 'false', 'lastModifiedDate' => 'Wed Dec 07 06:00:06 + MST 2016', 'subTasks' => '', 'csvGroupTask' => '0', 'taskCustom6' => '', 'reservedDuration' => '3600', 'retryInterval' => '300', 'resultConfigID' => '' }, 'Opsware::NAS::Client::ScheduleTaskVO_6_0 +_x' ), bless( { 'reservedDurationType' => '0', 'runningChildTaskId' => '', 'approvalUsers' => '', 'expensive' => '1', 'subTask' => '-1000', 'failureType' => '', 'approveByDate' => 'Tue Dec 06 06:00:00 MS +T 2016', 'systemTask' => '0', 'repeatType' => '1', 'taskCustom3' => '', 'deviceDataID' => '', 'completeDate' => 'Wed Dec 07 06:00:21 MST + 2016', 'result' => '-', 'taskType' => 'com.rendition.dib.CustomAct +ionsTask', 'repeatEndDate' => '', 'messageTo' => '', 'taskCustom1' => '', 'runASAP' => '0', 'repeatWeekday' => '', 'ticketNumber' => '', 'taskUserID' => '201', 'siteID' => '', 'parentTaskID' => '46812831', 'createDate' => 'Wed Dec 07 06:00:00 MST 2 +016', 'userGeneratedChange' => 'true', 'reservationEndDate' => 'Wed Dec 07 07:00: +00 MST 2016', 'coreID' => '1', 'saveTask' => 'true', 'priority' => '3', 'failedChildCount' => '0', 'comments' => '-', 'taskData' => '-', 'retryCount' => '0', 'tag' => '', 'taskCustom2' => '', 'scheduleDate' => 'Wed Dec 07 06:00:00 MST + 2016', 'stopOnFail' => '0', 'durationStr' => '60', 'taskCustom4' => '', 'taskName' => 'TGreenLeeCiscoSwitchGet', 'duration' => '21', 'approvalStatus' => '2', 'repeatCount' => '', 'deviceGroupID' => '', 'csvData' => '', 'startDate' => 'Wed Dec 07 06:00:01 MST 20 +16', 'scheduleTaskID' => '46812941', 'approvalPriority' => '', 'status' => '2', 'repeatInterval' => '', 'saveFavoriteLink' => 'false', 'deviceID' => '7501', 'succeededChildCount' => '0', 'runType' => 'Parallel', 'pendingChildCount' => '1', 'taskCustom5' => '', 'saveTemplate' => 'false', 'lastModifiedDate' => 'Wed Dec 07 06:00:21 + MST 2016', 'subTasks' => '', 'csvGroupTask' => '0', 'taskCustom6' => '', 'reservedDuration' => '3600', 'retryInterval' => '300', 'resultConfigID' => '' }, 'Opsware::NAS::Client::ScheduleTaskVO_6_0 +_x' ), bless( { 'reservedDurationType' => '0', 'runningChildTaskId' => '', 'approvalUsers' => '', 'expensive' => '1', 'subTask' => '-1000', 'failureType' => '', 'approveByDate' => 'Tue Dec 06 06:00:00 MS +T 2016', 'systemTask' => '0', 'repeatType' => '1', 'taskCustom3' => '', 'deviceDataID' => '', 'completeDate' => 'Wed Dec 07 06:00:19 MST + 2016', 'result' => '-', 'taskType' => 'com.rendition.dib.CustomAct +ionsTask', 'repeatEndDate' => '', 'messageTo' => '', 'taskCustom1' => '', 'runASAP' => '0', 'repeatWeekday' => '', 'ticketNumber' => '', 'taskUserID' => '201', 'siteID' => '', 'parentTaskID' => '46812831', 'createDate' => 'Wed Dec 07 06:00:00 MST 2 +016', 'userGeneratedChange' => 'true', 'reservationEndDate' => 'Wed Dec 07 07:00: +00 MST 2016', 'coreID' => '1', 'saveTask' => 'true', 'priority' => '3', 'failedChildCount' => '0', 'comments' => '-', 'taskData' => '-', 'retryCount' => '0', 'tag' => '', 'taskCustom2' => '', 'scheduleDate' => 'Wed Dec 07 06:00:00 MST + 2016', 'stopOnFail' => '0', 'durationStr' => '60', 'taskCustom4' => '', 'taskName' => 'TGreenLeeCiscoSwitchGet', 'duration' => '19', 'approvalStatus' => '2', 'repeatCount' => '', 'deviceGroupID' => '', 'csvData' => '', 'startDate' => 'Wed Dec 07 06:00:01 MST 20 +16', 'scheduleTaskID' => '46812951', 'approvalPriority' => '', 'status' => '2', 'repeatInterval' => '', 'saveFavoriteLink' => 'false', 'deviceID' => '7511', 'succeededChildCount' => '0', 'runType' => 'Parallel', 'pendingChildCount' => '1', 'taskCustom5' => '', 'saveTemplate' => 'false', 'lastModifiedDate' => 'Wed Dec 07 06:00:19 + MST 2016', 'subTasks' => '', 'csvGroupTask' => '0', 'taskCustom6' => '', 'reservedDuration' => '3600', 'retryInterval' => '300', 'resultConfigID' => '' }, 'Opsware::NAS::Client::ScheduleTaskVO_6_0 +_x' ), bless( { 'reservedDurationType' => '0', 'runningChildTaskId' => '', 'approvalUsers' => '', 'expensive' => '1', 'subTask' => '-1000', 'failureType' => '', 'approveByDate' => 'Tue Dec 06 06:00:00 MS +T 2016', 'systemTask' => '0', 'repeatType' => '1', 'taskCustom3' => '', 'deviceDataID' => '', 'completeDate' => 'Wed Dec 07 06:00:21 MST + 2016', 'result' => '-', 'taskType' => 'com.rendition.dib.CustomAct +ionsTask', 'repeatEndDate' => '', 'messageTo' => '', 'taskCustom1' => '', 'runASAP' => '0', 'repeatWeekday' => '', 'ticketNumber' => '', 'taskUserID' => '201', 'siteID' => '', 'parentTaskID' => '46812831', 'createDate' => 'Wed Dec 07 06:00:00 MST 2 +016', 'userGeneratedChange' => 'true', 'reservationEndDate' => 'Wed Dec 07 07:00: +00 MST 2016', 'coreID' => '1', 'saveTask' => 'true', 'priority' => '3', 'failedChildCount' => '0', 'comments' => '-', 'taskData' => '-', 'retryCount' => '0', 'tag' => '', 'taskCustom2' => '', 'scheduleDate' => 'Wed Dec 07 06:00:00 MST + 2016', 'stopOnFail' => '0', 'durationStr' => '60', 'taskCustom4' => '', 'taskName' => 'TGreenLeeCiscoSwitchGet', 'duration' => '21', 'approvalStatus' => '2', 'repeatCount' => '', 'deviceGroupID' => '', 'csvData' => '', 'startDate' => 'Wed Dec 07 06:00:01 MST 20 +16', 'scheduleTaskID' => '46812961', 'approvalPriority' => '', 'status' => '2', 'repeatInterval' => '', 'saveFavoriteLink' => 'false', 'deviceID' => '7521', 'succeededChildCount' => '0', 'runType' => 'Parallel', 'pendingChildCount' => '1', 'taskCustom5' => '', 'saveTemplate' => 'false', 'lastModifiedDate' => 'Wed Dec 07 06:00:21 + MST 2016', 'subTasks' => '', 'csvGroupTask' => '0', 'taskCustom6' => '', 'reservedDuration' => '3600', 'retryInterval' => '300', 'resultConfigID' => '' }, 'Opsware::NAS::Client::ScheduleTaskVO_6_0 +_x' ), bless( { 'reservedDurationType' => '0', 'runningChildTaskId' => '', 'approvalUsers' => '', 'expensive' => '1', 'subTask' => '-1000', 'failureType' => '', 'approveByDate' => 'Tue Dec 06 06:00:00 MS +T 2016', 'systemTask' => '0', 'repeatType' => '1', 'taskCustom3' => '', 'deviceDataID' => '', 'completeDate' => 'Wed Dec 07 06:02:30 MST + 2016', 'result' => '-', 'taskType' => 'com.rendition.dib.CustomAct +ionsTask', 'repeatEndDate' => '', 'messageTo' => '', 'taskCustom1' => '', 'runASAP' => '0', 'repeatWeekday' => '', 'ticketNumber' => '', 'taskUserID' => '201', 'siteID' => '', 'parentTaskID' => '46812831', 'createDate' => 'Wed Dec 07 06:00:01 MST 2 +016', 'userGeneratedChange' => 'true', 'reservationEndDate' => 'Wed Dec 07 07:00: +01 MST 2016', 'coreID' => '1', 'saveTask' => 'true', 'priority' => '3', 'failedChildCount' => '0', 'comments' => '-', 'taskData' => '-', 'retryCount' => '0', 'tag' => '', 'taskCustom2' => '', 'scheduleDate' => 'Wed Dec 07 06:00:01 MST + 2016', 'stopOnFail' => '0', 'durationStr' => '60', 'taskCustom4' => '', 'taskName' => 'TGreenLeeCiscoSwitchGet', 'duration' => '150', 'approvalStatus' => '2', 'repeatCount' => '', 'deviceGroupID' => '', 'csvData' => '', 'startDate' => 'Wed Dec 07 06:00:01 MST 20 +16', 'scheduleTaskID' => '46812981', 'approvalPriority' => '', 'status' => '2', 'repeatInterval' => '', 'saveFavoriteLink' => 'false', 'deviceID' => '8931', 'succeededChildCount' => '0', 'runType' => 'Parallel', 'pendingChildCount' => '1', 'taskCustom5' => '', 'saveTemplate' => 'false', 'lastModifiedDate' => 'Wed Dec 07 06:02:30 + MST 2016', 'subTasks' => '', 'csvGroupTask' => '0', 'taskCustom6' => '', 'reservedDuration' => '3600', 'retryInterval' => '300', 'resultConfigID' => '' }, 'Opsware::NAS::Client::ScheduleTaskVO_6_0 +_x' ), bless( { 'reservedDurationType' => '0', 'runningChildTaskId' => '', 'approvalUsers' => '', 'expensive' => '1', 'subTask' => '-1000', 'failureType' => '', 'approveByDate' => 'Tue Dec 06 06:00:00 MS +T 2016', 'systemTask' => '0', 'repeatType' => '1', 'taskCustom3' => '', 'deviceDataID' => '', 'completeDate' => 'Wed Dec 07 06:00:20 MST + 2016', 'result' => '-', 'taskType' => 'com.rendition.dib.CustomAct +ionsTask', 'repeatEndDate' => '', 'messageTo' => '', 'taskCustom1' => '', 'runASAP' => '0', 'repeatWeekday' => '', 'ticketNumber' => '', 'taskUserID' => '201', 'siteID' => '', 'parentTaskID' => '46812831', 'createDate' => 'Wed Dec 07 06:00:01 MST 2 +016', 'userGeneratedChange' => 'true', 'reservationEndDate' => 'Wed Dec 07 07:00: +01 MST 2016', 'coreID' => '1', 'saveTask' => 'true', 'priority' => '3', 'failedChildCount' => '0', 'comments' => '-', 'taskData' => '-', 'retryCount' => '0', 'tag' => '', 'taskCustom2' => '', 'scheduleDate' => 'Wed Dec 07 06:00:01 MST + 2016', 'stopOnFail' => '0', 'durationStr' => '60', 'taskCustom4' => '', 'taskName' => 'TGreenLeeCiscoSwitchGet', 'duration' => '20', 'approvalStatus' => '2', 'repeatCount' => '', 'deviceGroupID' => '', 'csvData' => '', 'startDate' => 'Wed Dec 07 06:00:01 MST 20 +16', 'scheduleTaskID' => '46812971', 'approvalPriority' => '', 'status' => '2', 'repeatInterval' => '', 'saveFavoriteLink' => 'false', 'deviceID' => '7531', 'succeededChildCount' => '0', 'runType' => 'Parallel', 'pendingChildCount' => '1', 'taskCustom5' => '', 'saveTemplate' => 'false', 'lastModifiedDate' => 'Wed Dec 07 06:00:20 + MST 2016', 'subTasks' => '', 'csvGroupTask' => '0', 'taskCustom6' => '', 'reservedDuration' => '3600', 'retryInterval' => '300', 'resultConfigID' => '' }, 'Opsware::NAS::Client::ScheduleTaskVO_6_0 +_x' ), bless( { 'reservedDurationType' => '0', 'runningChildTaskId' => '', 'approvalUsers' => '', 'expensive' => '1', 'subTask' => '-1000', 'failureType' => '', 'approveByDate' => 'Tue Dec 06 06:00:00 MS +T 2016', 'systemTask' => '0', 'repeatType' => '1', 'taskCustom3' => '', 'deviceDataID' => '', 'completeDate' => 'Wed Dec 07 06:05:04 MST + 2016', 'result' => '-', 'taskType' => 'com.rendition.dib.CustomAct +ionsTask', 'repeatEndDate' => '', 'messageTo' => '', 'taskCustom1' => '', 'runASAP' => '0', 'repeatWeekday' => '', 'ticketNumber' => '', 'taskUserID' => '201', 'siteID' => '', 'parentTaskID' => '46812831', 'createDate' => 'Wed Dec 07 06:00:00 MST 2 +016', 'userGeneratedChange' => 'true', 'reservationEndDate' => 'Wed Dec 07 07:00: +00 MST 2016', 'coreID' => '1', 'saveTask' => 'true', 'priority' => '3', 'failedChildCount' => '0', 'comments' => '-', 'taskData' => '-', 'retryCount' => '0', 'tag' => '', 'taskCustom2' => '', 'scheduleDate' => 'Wed Dec 07 06:00:00 MST + 2016', 'stopOnFail' => '0', 'durationStr' => '60', 'taskCustom4' => '', 'taskName' => 'TGreenLeeCiscoSwitchGet', 'duration' => '305', 'approvalStatus' => '2', 'repeatCount' => '', 'deviceGroupID' => '', 'csvData' => '', 'startDate' => 'Wed Dec 07 06:00:00 MST 20 +16', 'scheduleTaskID' => '46812901', 'approvalPriority' => '', 'status' => '2', 'repeatInterval' => '', 'saveFavoriteLink' => 'false', 'deviceID' => '4791', 'succeededChildCount' => '0', 'runType' => 'Parallel', 'pendingChildCount' => '1', 'taskCustom5' => '', 'saveTemplate' => 'false', 'lastModifiedDate' => 'Wed Dec 07 06:05:04 + MST 2016', 'subTasks' => '', 'csvGroupTask' => '0', 'taskCustom6' => '', 'reservedDuration' => '3600', 'retryInterval' => '300', 'resultConfigID' => '' }, 'Opsware::NAS::Client::ScheduleTaskVO_6_0 +_x' ), bless( { 'reservedDurationType' => '0', 'runningChildTaskId' => '', 'approvalUsers' => '', 'expensive' => '1', 'subTask' => '-1000', 'failureType' => '', 'approveByDate' => 'Tue Dec 06 06:00:00 MS +T 2016', 'systemTask' => '0', 'repeatType' => '1', 'taskCustom3' => '', 'deviceDataID' => '', 'completeDate' => 'Wed Dec 07 06:05:16 MST + 2016', 'result' => '-', 'taskType' => 'com.rendition.dib.CustomAct +ionsTask', 'repeatEndDate' => '', 'messageTo' => '', 'taskCustom1' => '', 'runASAP' => '0', 'repeatWeekday' => '', 'ticketNumber' => '', 'taskUserID' => '201', 'siteID' => '', 'parentTaskID' => '46812831', 'createDate' => 'Wed Dec 07 06:00:00 MST 2 +016', 'userGeneratedChange' => 'true', 'reservationEndDate' => 'Wed Dec 07 07:00: +00 MST 2016', 'coreID' => '1', 'saveTask' => 'true', 'priority' => '3', 'failedChildCount' => '0', 'comments' => '-', 'taskData' => '-', 'retryCount' => '0', 'tag' => '', 'taskCustom2' => '', 'scheduleDate' => 'Wed Dec 07 06:00:00 MST + 2016', 'stopOnFail' => '0', 'durationStr' => '60', 'taskCustom4' => '', 'taskName' => 'TGreenLeeCiscoSwitchGet', 'duration' => '316', 'approvalStatus' => '2', 'repeatCount' => '', 'deviceGroupID' => '', 'csvData' => '', 'startDate' => 'Wed Dec 07 06:00:00 MST 20 +16', 'scheduleTaskID' => '46812911', 'approvalPriority' => '', 'status' => '2', 'repeatInterval' => '', 'saveFavoriteLink' => 'false', 'deviceID' => '4801', 'succeededChildCount' => '0', 'runType' => 'Parallel', 'pendingChildCount' => '1', 'taskCustom5' => '', 'saveTemplate' => 'false', 'lastModifiedDate' => 'Wed Dec 07 06:05:16 + MST 2016', 'subTasks' => '', 'csvGroupTask' => '0', 'taskCustom6' => '', 'reservedDuration' => '3600', 'retryInterval' => '300', 'resultConfigID' => '' }, 'Opsware::NAS::Client::ScheduleTaskVO_6_0 +_x' ), bless( { 'reservedDurationType' => '0', 'runningChildTaskId' => '', 'approvalUsers' => '', 'expensive' => '1', 'subTask' => '-1000', 'failureType' => '', 'approveByDate' => 'Tue Dec 06 06:00:00 MS +T 2016', 'systemTask' => '0', 'repeatType' => '1', 'taskCustom3' => '', 'deviceDataID' => '', 'completeDate' => 'Wed Dec 07 06:05:15 MST + 2016', 'result' => '-', 'taskType' => 'com.rendition.dib.CustomAct +ionsTask', 'repeatEndDate' => '', 'messageTo' => '', 'taskCustom1' => '', 'runASAP' => '0', 'repeatWeekday' => '', 'ticketNumber' => '', 'taskUserID' => '201', 'siteID' => '', 'parentTaskID' => '46812831', 'createDate' => 'Wed Dec 07 06:00:00 MST 2 +016', 'userGeneratedChange' => 'true', 'reservationEndDate' => 'Wed Dec 07 07:00: +00 MST 2016', 'coreID' => '1', 'saveTask' => 'true', 'priority' => '3', 'failedChildCount' => '0', 'comments' => '-', 'taskData' => '-', 'retryCount' => '0', 'tag' => '', 'taskCustom2' => '', 'scheduleDate' => 'Wed Dec 07 06:00:00 MST + 2016', 'stopOnFail' => '0', 'durationStr' => '60', 'taskCustom4' => '', 'taskName' => 'TGreenLeeCiscoSwitchGet', 'duration' => '315', 'approvalStatus' => '2', 'repeatCount' => '', 'deviceGroupID' => '', 'csvData' => '', 'startDate' => 'Wed Dec 07 06:00:00 MST 20 +16', 'scheduleTaskID' => '46812921', 'approvalPriority' => '', 'status' => '2', 'repeatInterval' => '', 'saveFavoriteLink' => 'false', 'deviceID' => '4811', 'succeededChildCount' => '0', 'runType' => 'Parallel', 'pendingChildCount' => '1', 'taskCustom5' => '', 'saveTemplate' => 'false', 'lastModifiedDate' => 'Wed Dec 07 06:05:15 + MST 2016', 'subTasks' => '', 'csvGroupTask' => '0', 'taskCustom6' => '', 'reservedDuration' => '3600', 'retryInterval' => '300', 'resultConfigID' => '' }, 'Opsware::NAS::Client::ScheduleTaskVO_6_0 +_x' ) ], { '-soaperror' => 0, '-rows' => 14, '-statuscode' => '200', '-success' => 1, '-soapetext' => '', '-datatype' => 'collection:ScheduleTaskVO', '-statustext' => '200' } ], 'Opsware::NAS::Client::Result' );

#!/usr/bin/perl use Getopt::Long; use Pod::Usage; use Carp; use POSIX qw/strftime/; use Data::Dumper; use strict; #Export NA Library use Opsware::NAS::Client; #Declare Login Variables my($user,$pass,$host) = ('someuser', 'somepwd', 'somehost'); my $dttm = strftime('%Y:%m:%d:00:00:00',localtime); my $Diag_Date = $dttm; #Options GetOptions( "user=s" => \$user, "pass=s" => \$pass, "host=s" => \$host, 'help|h|?' => \my $help) or pod2usage(2); pod2usage(1) if $help; # open a CLI session my $nas = Opsware::NAS::Client->new(); my $res = $nas->login(-user => $user, -pass => $pass, -host => $host); #Handling login errors unless ($res->ok()) { printf STDERR ("*** error: %s\n", $res->error_message()); printf STDERR ("Did you supply valid Credentials?\n"); printf STDERR ("Please verify User/Password.\n"); exit(1); } my @listoftasks=("getSwitches","getFirewalls"); foreach my $specificTask (@listoftasks) { my $tasklist = $nas ->list_task( start => $Diag_Date, name => $specificTask, type => "Run Command Script" ); print Dumper($tasklist); }; $nas->logout(); # clean up undef $nas; #Inform Status print "\n\n\rStatus: Done!\n\n"; exit(0);

Replies are listed 'Best First'.
Re: Can't use string ("1") as an ARRAY ref while "strict refs
by choroba (Cardinal) on Dec 07, 2016 at 18:43 UTC
    I can't find Opsware::NAS::Client on CPAN, therefore I can't check its list_task method. Could you provide a link to its documentation and source? Do you run the same version of the library on both the machines?

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
      And yes, the version of library are exactly the same.
      I've uploaded it to: http://wikisend.com/download/620280/opsware-nas-client Thank you.
        The documentation seems OK, so it's probably a bug in the source. Try asking at their forum if you can't read and fix the source yourself.

        ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
Re: Can't use string ("1") as an ARRAY ref while "strict refs
by 1nickt (Canon) on Dec 07, 2016 at 18:26 UTC

    Have you looked to see what's in @listoftasks? Never mind, couldn't see it. Much better now that you've formatted the code and the data.


    The way forward always starts with a minimal test.
      yes, i'm sorry but i'm fairly new to perl and I can't see where there'd be value of "1". I posted the data dumper results.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1177403]
Approved by beech
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-03-28 12:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found