in reply to DWIM on sub input
Just means that your_subroutine can get on with doing it's thing _split_colours and do the fiddly colour spltting. Just a thought.sub _split_colours { my $color = shift; [ map { s/[^\d.-]//g; $_ ||= 0; $_ < 0 ? 0 : $_ / 255 } (split(/\s*,\s*/, $color, 4), (0) x 3)[0..2] ]; } sub your_subroutine { my($color, ...) = ( _split_colours($_[0]), @_[1 .. $#_] ); ...
_________
broquaint
|
|---|