The exact code would depend on whether your ASA is configured for SNMPv2 or SNMPv3. Which SNMP version is configured on this device?
For a PERL script you would need some PERL modules or have the SNMP utilities installed, which you could then call from within the PERL script or simply call the SNMP client from a SHELL script. The exact syntax of the SNMP query depends on the installed SNMP package on the systems issuing the query. You could always read the man page (man snmpget) or run a query with the -h switch (snmpget -h) to find out how to build your query. I would need more info as to how the SNMPv3 agent on the ASA is configured to build a proper example of the SNMPv3 query.
This simple SNMPv2 example is for NetSNMP package version 188.8.131.52 with 'public' being the default read-only community string for SNMP queries:
snmpget -v2c -c public yourhostname .184.108.40.206.220.127.116.11 or snmpget -v2c -c public yourhostname .18.104.22.168.22.214.171.124.0
and should return the ASA's uptime since the last restart.
Inside the PERL script you would write the query to a string and then print the string to the screen:
$uptime = `snmpget -v2c -c public yourhostname .126.96.36.199.188.8.131.52.0`;
Hope this gets you started.
= Uwe =