Skip to content

Instantly share code, notes, and snippets.

@Whiteknight
Created June 29, 2011 01:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Whiteknight/1052714 to your computer and use it in GitHub Desktop.
Save Whiteknight/1052714 to your computer and use it in GitHub Desktop.
function main[main]()
{
var curpf = getinterp()["packfile"];
var all_subs = curpf.all_subs();
for (var sub in all_subs)
say(sub);
all_subs[2]();
all_subs[3]();
}
function foo() {
say("in foo!");
}
function bar() {
say("in bar!");
}
function main[main]()
{
var curpf = getinterp()["packfile"];
var counts = curpf.constant_counts();
int pmc_count = counts[2];
say("PMC Constants");
for (int i = 0; i < pmc_count; i++) {
var c = curpf[i];
say(sprintf("\t%d: %s", [i, typeof(c)]));
}
int str_count = counts[1];
say("String Constants");
for (int i = 0; i < str_count; i++) {
string c = curpf[i];
say(sprintf("\t%d: '%s'", [i, c]));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment