Skip to content

Instantly share code, notes, and snippets.

@ejhayes
Created December 1, 2011 01:36
Show Gist options
  • Save ejhayes/1412615 to your computer and use it in GitHub Desktop.
Save ejhayes/1412615 to your computer and use it in GitHub Desktop.
sub versions {
my ($s) = @_;
# get a summary of the actions for this build (in some cases all versions will be the same)
my $sth = BS::db::action->db_Main->prepare(<<SQL);
select max(action_id) from actions where build_id = ? group by branch_id, revision, storm_branch_id, storm_revision, build_id;
SQL
$sth->execute($s->id);
return BS::db::action->sth_to_objects($sth);
}
<%
# version information
my ($status) = join '', map { $_->branch->name . $_->revision } $build->versions;
$Response->Write("<li>$a</li>");
%>
@jdrago999
Copy link

Hi -

That would be:

my ($status) = map { $_->branch->name . $_->revision } $build->versions;

Or:

my $status = join '', map { $_->branch->name, $_->revision } $build->versions;

Also, variables '$a' and '$b' are considered magical, since they are autovivified in sort BLOCK expressions like my @sorted_by_name = sort { $a->name cmp $b->name } @list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment