/usr/share/perl5/Poet/App/Command/script.pm is in libpoet-perl 0.16-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | package Poet::App::Command::script;
$Poet::App::Command::script::VERSION = '0.16';
use File::Spec::Functions qw(rel2abs);
use Poet::Tools qw(write_file);
use Poet::Moose;
use Poet::Types;
extends 'Poet::App::Command';
method abstract () {
"Create a Poet script";
}
method usage_desc () {
return "poet script <script-name>";
}
method execute ($opt, $args) {
$self->usage_error("takes one argument (script name)") unless @$args == 1;
my ($path) = @$args;
my $poet = $self->initialize_environment();
$path =~ s|^bin/||;
$path = rel2abs( $path, $poet->bin_dir() );
die "'$path' already exists, will not overwrite" if -e $path;
write_file( $path, $self->script_template() );
chmod( 0775, $path );
print "$path\n";
}
method script_template () {
'#!/usr/local/bin/perl
use Poet::Script qw($conf $poet);
use strict;
use warnings;
';
}
1;
|