Looking at the Asterisk::AGI docs, maybe try calling ReadParse() early in the script to read in anything from stdin? (From the docs) # pull AGI variables into %input %input = $AGI->ReadParse();