Skip Menu |

This queue is for tickets about the CAD-Format-STL CPAN distribution.

Report information
The Basics
Id: 56138
Status: resolved
Priority: 0/
Queue: CAD-Format-STL

People
Owner: Nobody in particular
Requestors: boards [...] sheldrake.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: v0.0.1
Fixed in: v0.2.1



Subject: two bugs in CAD-Format-STL
Date: Tue, 30 Mar 2010 19:27:41 -0700
To: bug-CAD-Format-STL [...] rt.cpan.org
From: Mike Sheldrake <mike [...] sheldrake.net>
BUG 1 CAD::Format::STL, v0.0.1 STL.pm, line 387 open(my $fh, '>', $file) or should be open(my $fh, '>'. $file) or (dot instead of comma) BUG 2 CAD::Format::STL::part, v0.0.1 part.pm, lines 40 and 41: $self->add_facets(@facets) if(@facets); bless($self, $class); can be swapped to bless($self, $class); $self->add_facets(@facets) if(@facets); Otherwise $self isn't a blessed reference yet, so calling add_facets gives an error -Mike Sheldrake
Subject: Re: [rt.cpan.org #56138] two bugs in CAD-Format-STL
Date: Sat, 3 Apr 2010 16:56:19 -0700
To: bug-CAD-Format-STL [...] rt.cpan.org
From: Eric Wilhelm <enobacon [...] gmail.com>
# from Mike Sheldrake via RT # on Tuesday 30 March 2010 19:27: Show quoted text
>STL.pm, line 387 >    open(my $fh, '>', $file) or >should be >    open(my $fh, '>'. $file) or > >(dot instead of comma)
Hi Mike, This part is not a bug. What version of Perl are you running? Thanks, Eric -- perl -e 'srand; print join(" ",sort({rand() < 0.5} qw(sometimes it is important to be consistent)));' --------------------------------------------------- http://scratchcomputing.com ---------------------------------------------------
Subject: Re: [rt.cpan.org #56138] two bugs in CAD-Format-STL
Date: Sat, 03 Apr 2010 20:36:31 -0700
To: bug-CAD-Format-STL [...] rt.cpan.org
From: Mike Sheldrake <mike [...] sheldrake.net>
Eric - For a function as common as open(), I was pretty sure I knew how it worked. Turns out I learned open() back in Perl 4, when it only took one or two arguments. I was passing a file name string that already had '>' at the beginning (due to a careless copy-paste). With dot instead of comma, that worked well enough to get rid of the 'cannot open' error, so I though I had fixed your code. I was then unintentionally opening the file in append mode. When I fixed the filename to avoid that, it didn't occur to me that the filename was the only real problem from the beginning. I'll double check the documentation even for the simplest, most familiar functions before reporting any bugs in the future. By the way, thanks for all your CAD module work. CAD::Calc has been a wonderful toolbox for me. - Mike Sheldrake Eric Wilhelm via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=56138 > > > # from Mike Sheldrake via RT > # on Tuesday 30 March 2010 19:27: > >
>> STL.pm, line 387 >> open(my $fh, '>', $file) or >> should be >> open(my $fh, '>'. $file) or >> >> (dot instead of comma) >>
> > Hi Mike, > > This part is not a bug. What version of Perl are you running? > > Thanks, > Eric >