perl sort with pack

A sort solution that I came up with for a project at work, it was the first time I used a pack command in a sort :)

sub bundle_sort {
   my $pkg = caller;
   no strict 'refs';

   pack( 'C4' => ${"${pkg}::a"} =~ /Bu1[.](\d+)/ )
   cmp
   pack( 'C4' => ${"${pkg}::b"} =~ /Bu1[.](\d+)/ )
   ||
   pack( 'C4' => ${"${pkg}::a"} =~ /source (\d+)[.](\d+)[.](\d+)[.](\d+)/ )
   cmp
   pack( 'C4' => ${"${pkg}::b"} =~ /source (\d+)[.](\d+)[.](\d+)[.](\d+)/ )
   ||
   pack( 'C4' => ${"${pkg}::a"} =~ /(\d+)[.](\d+)[.](\d+)[.](\d+) source/ )
   cmp
   pack( 'C4' => ${"${pkg}::b"} =~ /(\d+)[.](\d+)[.](\d+)[.](\d+) source/ )
}