App-HPGL2Cadsoft
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/App/HPGL2Cadsoft.pm view on Meta::CPAN
use strict
; # Keep Perl::Critic happy, althoug this is covered my the Modern::Perl too...
package App::HPGL2Cadsoft;
$App::HPGL2Cadsoft::VERSION = '0.01';
use Modern::Perl;
use Moose;
use IO::File;
use Grid::Coord;
use namespace::autoclean;
use Carp;
use Carp qw/croak carp/;
has scaling_factor => (
is => 'ro',
isa => 'Num',
default => 342.3151,
);
has input_file => (
is => 'ro',
isa => 'Str',
required => '1',
);
has output_file => (
is => 'ro',
isa => 'Str',
);
has '_bbox' => (
is => 'rw',
isa => 'Grid::Coord',
init_arg => undef,
);
has '_hpgl' => (
is => 'rw',
isa => 'Str',
init_arg => undef,
);
has '_hpgl_lines' => (
is => 'rw',
);
# Actions that need to be run after the constructor
sub BUILD {
my $self = shift;
# Add stuff here
my $hpgl;
my $fh = IO::File->new( "< " . $self->input_file );
if ( defined $fh ) {
# Slurp the file into the variable
while (<$fh>) {
$hpgl .= $_;
}
}
else {
die "Could not open file '" . $self->input_file . "' for reading";
view all matches for this distributionview release on metacpan - search on metacpan
( run in 2.450 seconds using v1.00-cache-2.02-grep-82fe00e-cpan-48ebf85a1963 )