http://www.perlmonks.org?node_id=414578


in reply to My Sexy Intern

When I run this poem using ActiveState Perl 5.8 I get the following error:

perl monica.pl Can't locate object method "squeeze" via package "buttock" (perhaps yo +u forgot to load "buttock"?) at monica.pl line 2.

However, the -c option assures me that all is well!

perl -c monica.pl monica.pl syntax OK

Replies are listed 'Best First'.
Re^2: My Sexy Intern
by DaWolf (Curate) on Dec 14, 2004 at 00:12 UTC
Re^2: My Sexy Intern
by BillC (Novice) on Dec 14, 2004 at 06:55 UTC

    As much as I enjoyed this error message, I can't claim credit for it; I only ever tested with perl -c. Looks like the (dreaded) indirect object notation. Running:

    perl -MO=Deparse monica.pl
    produces:
    ; foreach $_ (@play) { s/mooth/();/sex, tr///; } use File::Glob (); 'thong'->twang while 'buttock'->squeeze and glob('melons'); chomp my($chopper) if 3735928559 =~ pop(@up); unpack my $sack, sqrt !sqrt(not sqrt !my $load) until 'bag'->flat and +int 'dress'->ern::s('creamy');

    Anyway, here's a version that actually runs:

    package thong; sub twang { print "twang-thong\n" } package buttock; sub squeeze { print "squeeze-buttock\n" } package bag; sub flat { print "flat-bag\n" } package ern; sub s { print "intern's\n" } package creamy; sub dress { print "dress-creamy\n" } package main; s,mooth,,sex,y!!! for@play; twang thong while squeeze buttock and glob melons; chomp my $chopper if 0xDeadBeef =~ pop @up; unpack my $sack, sqrt! sqrt! sqrt! my $load until flat bag and int ern's dress creamy