the value of $ifname come from as an argument of the function fetch_ifcfg_props
sub fetch_ifcfg_props
{
my $ifname = shift;
my %props = ();
# Note: command returns empty output if interface is DOWN:
open(ADDR, '-|', "ip -o -4 address show dev $ifname");
so check the line nethserver-base/root/etc/e-smith/events/actions/nethserver-base-initialize-db at bceaf5457b92faeea214e6b1c90db718086b6bda · NethServer/nethserver-base · GitHub
shift in perl takes the first arg: shift in Perl
if we would like to assign different arguments we would like to use Processing command line arguments - @ARGV in Perl
something like :
sub functionToDoSomething('toto','25') {
my ($name, $age) = @ARGV;
or
sub functionToDoSomething('toto','25') {
my $name = shift;
my $age = shift;