new issue
[andk-cpan-tools.git] / bin / bleadperl
bloba60d38d9f00fe031f22b4689cb4decfd1d773516
1 #!/usr/bin/perl
3 =head1 NAME
5 bleadperl -
7 =head1 SYNOPSIS
9 bleadperl Makefile.PL
10 bleadperl --branch=maint-5.10 -- -V:prefix
11 bleadperl -- -V:prefix
12 bleadperl --show
14 =head1 DESCRIPTION
16 Find the perl(s) in the specified branch (defaults to 'perl' which
17 stands for blead).
19 If the --show parameter is given, show them sorted by mtime.
21 Otherwise run the most recent with the arguments. If there are option
22 arguments, the ones after C<--> will be passed to perl.
24 =cut
26 use Getopt::Long;
27 use List::Util qw(reduce);
29 my %Opt;
30 GetOptions(\%Opt,
31 "branch=s",
32 "show!",
34 $Opt{branch} ||= "perl"; # maint-5.10, maint-5.8
35 my @cand = glob("/home/src/perl/repoperls/installed-perls/$Opt{branch}/p*/perl-*\@39999/bin/perl");
36 if ($Opt{show}) {
37 print map {"$_\n"} sort { -M $b <=> -M $a } @cand;
38 } else {
39 my $blead = reduce { -M $a < -M $b ? $a : $b } @cand;
40 exec $blead, @ARGV;