WorkerBee has asked for the wisdom of the Perl Monks concerning the following question:
I then grab the user entry via getopts and store in an arrayopen(FH, "config.txt"); $cfg->guess_syntax(\*FH)); my @tags = $cfg->param("Tags"); unlink $_ for @tags;
This works okay as long as only a single value is passed on the command line. Example:my @valid_tag = intersect(@user_tags, @hash_tags); if (@valid_tag == 0){ die " \n\n NOTICE: TAG MISSING OR INVALID \n \ +n\n"; } else{ chomp (@valid_tag); }
But, if I pass multiple values, the verification step fails Example:$ script.p, -c "test"
NOTICE: TAG MISSING OR INVALID$ script.pl -c "test page"
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Comparing Arrays
by davido (Cardinal) on Jul 16, 2013 at 03:49 UTC | |
Re: Comparing Arrays
by kcott (Archbishop) on Jul 16, 2013 at 05:33 UTC | |
Re: Comparing Arrays
by 5mi11er (Deacon) on Jul 16, 2013 at 03:47 UTC | |
Re: Comparing Arrays
by mtmcc (Hermit) on Jul 16, 2013 at 07:24 UTC |