diff options
author | Richard Levitte <levitte@openssl.org> | 2016-02-25 00:17:59 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2016-02-26 09:00:25 +0100 |
commit | bdcd83e1272c84f3de576f793ba03fdc2c21a557 (patch) | |
tree | ce1ce0e41c8e414192c5c8366fc14f8e59bb4a36 /Configure | |
parent | 9666ffb33321ea9a5ef166d3a297bb46e40e587e (diff) |
Configure - neater looking add() and add_before()
They now default to " " as separator, but that can be overridden by
having a hash with parameters as last argument. The only currently
recognised parameter is `separator'.
The special separator `undef' will force the result to become a list
rather than a concatenated string.
Reviewed-by: Andy Polyakov <appro@openssl.org>
Diffstat (limited to 'Configure')
-rwxr-xr-x | Configure | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -1970,12 +1970,20 @@ sub _add { } } sub add_before { - my $separator = shift; + my $separator = " "; + if (ref($_[$#_]) eq "HASH") { + my $opts = pop; + $separator = $opts->{separator}; + } my @x = @_; sub { _add($separator, @x, @_) }; } sub add { - my $separator = shift; + my $separator = " "; + if (ref($_[$#_]) eq "HASH") { + my $opts = pop; + $separator = $opts->{separator}; + } my @x = @_; sub { _add($separator, @_, @x) }; } |