# creating an aspect package Aspect::Library::Parenthesize; use Aspect; use base 'Aspect::Modular'; sub get_advice { after { $_[0]->return_value( '('. $_[0]->return_value. ')' ) } pop; } # using the new aspect package main; use Aspect; use SomePackage; aspect Parenthesize => call 'SomePackage::value' & !cflow 'HatesParentheses::run' & cflow 'LikesParentheses::run';