It's not the most eloquent way to put it, and it's still got some code structure instead simply flowing, but I've never tried this before. It's venting/jest.
#!/usr/bin/perl use strict; open (BLACKBOARD, "+>blackboard"); #look around no strict; use less 'time'; my $hand = 'reluctant'; @chalk = 'obsolete'; sub cheat {print BLACKBOARD "I will not use Perl in C class\n";} until ($caught) { use warnings; &cheat; $teacher_enters = int(rand(10)); if ($teacher_enters == 1) { no warnings; $caught = "red handed"; close BLACKBOARD; delete @chalk[1,2,4]; } else {redo} } die "You are not to use Perl in C class, start the assignment again!";

Replies are listed 'Best First'.
Re: From C++ class
by BioLion (Curate) on Oct 06, 2009 at 08:37 UTC

    Possible cheat routine?

    sub cheat{ use LWP::Simple; my $cheatsheet = get("http://perldoc.perl.org/perlcheat.html"); unless ($cheatsheet){ die "Failed to get help!" }; study $cheatsheet; unless ($cheatsheet =~ m/Inline::CPR/g){ use Tiny::Try; try( &{ $cheatsheet = get("http://search.cpan.org/~sisyphus/Inline-0.45/C/C-Co +okbook.pod") } ); } return $cheatsheet; undef $cheatsheet; ## you can never clear your tracks }

    I don't know if this even compiles, but it is my first attempt at a poem too!

    Just a something something...