Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. # For some reason, this was raising hell after adding
  2. # use namespace::autoclean;
  3. my $percent_captions = sub {
  4. my @left = @_[ 0 .. $#_ - 1 ];
  5. my @right = @_[ 1 .. $#_ ];
  6. return "< $_[0]%", pairwise {"$a to $b%"} @left, @right;
  7. };
  8.  
  9. my @pcts = ( 1, 5, 10, 25, 50, 75, 100 );
  10. my @pct_captions = $percent_captions->(@pcts);
  11.  
  12.  
  13. # So, I replaced it with this.
  14. my @pcts = ( 1, 5, 10, 25, 50, 75, 100 );
  15. my @pct_captions = (
  16. "< $pcts[0]%",
  17. map "$pcts[$_-1] to $pcts[$_]%", 1..$#pcts
  18. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement