http://www.perlmonks.org?node_id=1018801


in reply to Router Backup.pl failing (operator error no doubt)

I think the syntax error may actually be on line 42:
chop ($status=\Q$snmpset $oid s $rtr.cfg\Q);

If I comment out that line, I no longer get the syntax error. Maybe the \Q should really be backticks (qx)?

chop ($status=`$snmpset $oid s $rtr.cfg`);

Replies are listed 'Best First'.
Re^2: Router Backup.pl failing (operator error no doubt)
by rmagin (Initiate) on Feb 15, 2013 at 14:04 UTC

    Thanks toolic, I thought it was a tick issue also. I tried the commenting out and saw that it ran clean on check but failed on execution

    I then tried placing the ticks so that the old progression should be calling the variable it still started spitting errors but this time from line 28. Too frustrating for what I don't actually want anyway.

    I have decided this is not what I want anyway. I used to have a super simple perl script that just called an EXPECT script and the router-file so that the EXPECT can telnet from a router-file into all the various equipment we have and send via tftp the configs down and then the perl moved it to its various sub directory dated and named so that if someone did an edit they could just run the expect script to their own router file to do repeated sequential downloads of one router if they are doing many edits...or they could run the script calling the entire router-file...

    I think I will just have to find my old harddrives and see if I can find it. It is not something I would expect someone to already have ready made, after all it took me a good bit to get the scripts right and sanity checked and I hate reinventing the wheel. Thank you again for taking a look, rmagin