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 18.104.22.168 with 'public' being the default read-only community string for SNMP queries:
snmpget -v2c -c public yourhostname .22.214.171.124.126.96.36.199 or snmpget -v2c -c public yourhostname .188.8.131.52.184.108.40.206.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 .220.127.116.11.18.104.22.168.0`;
Hope this gets you started.
= Uwe =