#!/usr/bin/perl use warnings; use strict; use Data::Dumper; my %options; my $current_option; my $space; for (@ARGV) { if (/^-/) { $current_option = $_; $space = q(); # No space before the + first word. } else { $options{$current_option} .= $space . $_; $space = ' '; } } print Dumper \%options;
In reply to Re: easiest way to read multiple word command arguments
by choroba
in thread easiest way to read multiple word command arguments
by kcarpenter@soleo.com
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |