That won't work. The perl 'do' command only expects a filename. Instead, you can either define a subroutine in the file rather than have the file itself do something. IE, in the file if you put: sub foo { print "$_[0]\n"; } and then put these lines in the snmptrapd.conf file: perl do /path/to/script perl foo("hello world"); perl foo("now I am passing something different");