#!/usr/bin/perl use strict; use warnings; my %COLORS = ( red => undef, green => undef, blue => undef, ); sub change{ my($R,$G,$B) = @_; $COLORS{red} = $R; $COLORS{green} = $G; $COLORS{blue} = $B; } change(11); print $COLORS{red};