Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Bench this BBcode

by SFLEX (Chaplain)
on Sep 09, 2010 at 12:47 UTC ( [id://859502]=perlmeditation: print w/replies, xml ) Need Help??

I am one of the many authors that have wrote and/or are maintaining a BBcode module for the Perl community. A few days ago I released version 2.10 of AUBBC then started to poke my nose around to see what the other BBcode modules where doing.

Well what I found was all these modules that do BBcode to HTML also. BBCode::Parser Parse::BBCode HTML::BBCode HTML::BBReverse. Thanks to Parse::BBCode for the bench.pl to show me that my BBcode had some major speed issues and didn't work with the bench.pl at first (had to fix the $VERSION variable) and that other BBcode modules still have security issues and lack BBcode tag support.

So I fixed AUBBC and now its at version 2.20 staying competitive with the other BBcodes with security, supported tags and now Speed! If I was going to rate my own module VS the others I would be #1 or at least in the top 3. Thats my honest opinion.

Like some of the other BBcode authors I like to see change's in a better direction for all the modules. I see it as these and other modules holding the Perl community's reputation by how well all the modules work. In some sense maintaining the modules library is the integrity of Perl. Because if we ask the question, what if a Perl developer finds the worst module out of the bunch? Lets just hope they didn't end their search there.

I can see that for my module to stay competitive I have to fix any issues it has and give as much support as I can, but I haven't seen a few other BBcode authors update in a few years and I know they have bugs and know about them.

If any other BBcode author would like me to help them or anyone can help me fix "-withoutworldwriteables" on my module, I'm sure it would be fun. Any other comments just post them...

Replies are listed 'Best First'.
Re: Bench this BBcode
by tinita (Parson) on Sep 09, 2010 at 16:32 UTC
    If I was going to rate my own module VS the others I would be #1 or at least in the top 3
    Still, it is considered impolite to rate your own module on cpanratings, even if you don't give it all five stars.

    If you have proposals what I could improve with Parse::BBCode, I'd be glad to hear them.

    update: s/unpolite/impolite/
    A reply falls below the community's threshold of quality. You may see it by logging in.
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Bench this BBcode
by VinsWorldcom (Prior) on Sep 09, 2010 at 13:41 UTC

    I've gotten the ""-withoutworldwriteables" appended to some of my modules upon PAUSE upload. I develop on Windows and it doesn't understand rw-r--r-- versus rw-rw-rw-. PAUSE does not like rw-rw-rw- and will 'attempt' to redo your TAR-GZ upload to a rw-r--r-- (without world writeables) TAR-GZ.

    You can make sure you develop on *nix or some flavor that understands rw-r--r-- before you package (TAR-GZ) your module. Alternatively, I upload my modules as "my-module-0.01-w.tar.gz". I wait for PAUSE to send me the error email saying it redid my package to "my-module-0.01-w-withoutworldwriteables.tar.gz" and that it's available for a short time at the provided link. I download the module back to my local PC, rename to "my-module-0.01.tar.gz" and re-upload back to PAUSE.

    Quite a convoluted process, and some cleanup is needed (remove the "my-module-0.01-w.tar.gz" and "my-module-0.01-w-withoutworldwriteables.tar.gz" from PAUSE). But it does give me nicely named modules on CPAN.

    I did find a Perl script that was supposed to go into the tarball and fix the issue on Windows platforms, but I couldn't get it to work for me. Maybe you'll have better luck with it: Fix CPAN uploads for world writable files

      If its any help to you, I edited bart's code to not work in a command prompt. The only thing is you have to set the values of the variables in the code.
      #!perl use Archive::Tar; $Archive::Tar::DO_NOT_USE_PREFIX = 1; use strict; my %opt = ( 'quickfix' => 1, # quick fix - with out world writeables 'verbose' => 1, # print some text when working 'output' => 'Fixed_Archive.tar.gz', # rename file to ); my $dist = 'C:\Path\to\with-out-world-writeables.tar.gz'; # Path and F +ile to fix print 'Starting the Fix File: '.$dist."\n".' and rename to '.$opt{outp +ut}."\n" if $opt{verbose}; my $fixes; my $tar = Archive::Tar->new; $tar->read($dist); my @files = $tar->get_files; foreach my $file (@files) { my $fixedmode = my $mode = $file->mode; my $filetype = ''; if($file->is_file) { $filetype = 'file'; if($opt{quickfix}) { $fixedmode &= ~2; } elsif(substr(${ $file->get_content_by_ref }, 0, 2) eq '# +!') { $fixedmode = 0775; } else { $fixedmode = 0664; } } elsif($file->is_dir) { $filetype = 'dir'; if($opt{quickfix}) { $fixedmode &= ~2; } else { $fixedmode = 0775; } } else { next; } next if $mode eq $fixedmode; $file->mode($fixedmode); $fixes++; print "\nChange mode %03o to %03o for %s '%s'\n", $mode, $fixe +dmode, $filetype, $file->name if $opt{verbose}; } if($fixes) { $dist = $opt{output} if $opt{output}; $tar->write($dist, 9); print "\nFile '$dist' saved.\n" if $opt{verbose}; }

      I just tested it on PAUSE and it works.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://859502]
Approved by moritz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-06-20 04:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.