| 1 | package App::CSE::File::TextTroff; | ||
| 2 | $App::CSE::File::TextTroff::VERSION = '0.016'; | ||
| 3 | use Moose; | ||
| 4 | extends qw/App::CSE::File/; | ||
| 5 | |||
| 6 | sub effective_object{ | ||
| 7 | my ($self) = @_; | ||
| 8 | |||
| 9 | # This could have been wrongly detected as text/troff when | ||
| 10 | # it is effectively application/x-perl | ||
| 11 | if( ( $self->content() || '' ) =~ /^(?:.*?)perl(?:.*?)\n/ ){ | ||
| 12 | return $self->requalify('application/x-perl'); | ||
| 13 | } | ||
| 14 | return $self; | ||
| 15 | } | ||
| 16 | |||
| 17 | |||
| 18 | __PACKAGE__->meta->make_immutable(); |