in reply to search array for item, move to next item

I think Getopt::Long might be able to help:
use strict; use warnings; use Data::Dumper; use Getopt::Long; my $args = 'data=company.com -iR 12345 -iL mylink -iF 2d'; @ARGV = split /\s+/, $args; my %opt; GetOptions(\%opt, 'iR=i', 'iL=s', 'iF=s'); print 'opt hash ', Dumper(\%opt); print 'ARGV ', Dumper(\@ARGV); __END__ opt hash $VAR1 = { 'iR' => 12345, 'iL' => 'mylink', 'iF' => '2d' }; ARGV $VAR1 = [ 'data=company.com' ];