in reply to Can't locate object method

use warnings;
use strict;

You will likely see the problem very quickly. Additionally your pound-bang (#!) seems like it might be incorrect, although you are apparently able to run it so it could be right and just different looking.