in reply to Again on "can't use string as hash as HASH ref while "strict refs" in use"
Hello guys,
first of all thank you very much for your help, much appreciated.
I tried to run the Dumper and got the following output:
$VAR1 = { 'cfg' => bless( { 'devicecount' => 2, 'sshpass' => '/home/cfgbackup/bin/sshpass' +, 'version' => '$Id: 1.3$', 'task' => { '1' => 'ip', '2' => 'name' }, 'default' => { 'passwd' => 'XXXX', 'KH' => '/tmp/known_hosts.1 +0823', 'destination' => '/home/cfg +backup/cfg', 'cryptpwd' => 'XXXXX', 'remotefile' => 'running-co +nfig', 'logdir' => '/home/cfgbacku +p/log', 'rcsdir' => '/home/cfgbacku +p/cfg/RCS', 'logfile' => '/home/cfgback +up/log/cfgbackup.log', 'username' => 'XXXXXX' }, 'device' => { 'ip' => '192.168.0.1', 'name' => 'switch' }, 'devices' => [ 'ip', 'name' ], 'bindir' => '/home/cfgbackup/bin' }, 'CFGBACKUP' ), 'devfail' => 2, 'devok' => 0, 'starttime' => 'Wed Aug 26 08:21:23 2015', 'task' => {} };
The error that I get when I run the script is:
Can't use string ("192.168.0.1") as a HASH ref while "strict refs" in +use at ./cfg_backup line 203.
The data for the devices are taken from a xml file that is read via XML::Simple.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Again on "can't use string as hash as HASH ref while "strict refs" in use"
by Corion (Patriarch) on Aug 26, 2015 at 14:19 UTC | |
|
Re^2: Again on "can't use string as hash as HASH ref while "strict refs" in use"
by stevieb (Canon) on Aug 26, 2015 at 14:27 UTC | |
|
Re^2: Again on "can't use string as hash as HASH ref while "strict refs" in use"
by poj (Abbot) on Aug 26, 2015 at 15:31 UTC |