Play with little porker, whimsically? (6)
I believe the answer is:
hamlet
'play' is the definition.
(play by William Shakespeare)
I cannot understand how the remainder of the clue works.
(Other definitions for hamlet that I've seen before include "(Hero of) play" , "Shakespearean tragedy" , "DOG" , "Danish king in play" , "Danish role" .)