App::SmokeBrew::Tools - Various utility functions for smokebrew
version 1.04
use strict; use warnings; use App::SmokeBrew::Tools; # Fetch a perl source tarball my $filename = App::SmokeBrew::Tools->fetch( $path_to_fetch, $where_to_fetch_to ); # Extract a tarball my $extracted_loc = App::SmokeBrew::Tools->extract( $tarball, $where_to_extract_to ); # Find the smokebrew directory my $dir = App::SmokeBrew::Tools->smokebrew_dir(); # Obtain a list of perl versions my @perls = App::SmokeBrew::Tools->perls(); # All perls >= 5.006 my @stables = App::SmokeBrew::Tools->perls( 'rel' ); my @devs = App::SmokeBrew::Tools->perls( 'dev' ); my @recents = App::SmokeBrew::Tools->perls( 'recent' ); my $perl = '5.13.0'; if ( App::SmokeBrew::Tools->devel_perl( $perl ) ) { print "perl ($perl) is a development perl\n"; }
App::SmokeBrew::Tools provides a number of utility functions for smokebrew.
fetch
Requires two mandatory parameters and one optional. The first two parameters are the path to fetch from a CPAN mirror and the file system path where you want the file fetched to. The third, optional parameter, is an arrayref of CPAN mirrors that you wish the file to fetched from.
Returns the path to the fetched file on success, false otherwise.
This function is a wrapper around File::Fetch.
extract
Requires two mandatory parameters, the path to a file that you wish to be extracted and the file system path of where you wish the file to be extracted to. Returns the path to the extracted file on success, false otherwise.
This function is a wrapper around Archive::Extract.
smokebrew_dir
Returns the path to where the .smokebrew directory may be found.
.smokebrew
perls
Returns a list of perl versions. Without a parameter returns all perl releases >= 5.006
Specifying rel as the parameter will return all stable perl releases >= 5.006
rel
stable
Specifying dev as the parameter will return only the development perl releases >= 5.006
dev
development
Specifying recent as the parameter will return only the stable perl releases >= 5.008009
recent
devel_perl
Takes one parameter a perl version to check.
Returns true if given perl is a development perl.
can_quadmath
Returns true if given perl is able to be built with quadmath.
quadmath
perl_version
Takes one parameter a perl version.
Returns the version with the perl- prefix.
perl-
smokebrew
Perl::Version
File::Fetch
Archive::Extract
Chris Williams <chris@bingosnet.co.uk>
This software is copyright (c) 2022 by Chris Williams.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install smokebrew, copy and paste the appropriate command in to your terminal.
cpanm
cpanm smokebrew
CPAN shell
perl -MCPAN -e shell install smokebrew
For more information on module installation, please visit the detailed CPAN module installation guide.