*gpio_fsel = \&Device::BCM2835::gpio_fsel; #### #!/usr/bin/env perl use strict; use warnings; use Device::BCM2835; ... *gpio_fsel = \&Device::BCM2835::gpio_fsel; ... my $inputcmd = ...; ... gpio_fsel(RPI_V2_GPIO_P1_07, $inputcmd); ... #### my %rpi_v2_gpio_p1 = ( 3 => RPI_V2_GPIO_P1_03, 5 => RPI_V2_GPIO_P1_05, 7 => RPI_V2_GPIO_P1_07, ..., 40 => RPI_V2_GPIO_P1_40, ); ... gpio_fsel($rpi_v2_gpio_p1{$_}, $inputcmd) for 3, 5, 7, ..., 40;