in reply to Re: Using number "0" as an input argument
in thread Using number "0" as an input argument
If by "number" you mean an integer device number, the following technique for getting a list of results for regex captures should help. It is documented among other places here: http://perldoc.perl.org/perlrequick.html#Extracting-matches
use warnings; use strict; my ($device) = defined($ARGV[0]) ? $ARGV[0] =~ /^\s*(\d+)\s*$/ : ''; print "Device #$device\n";
|
|---|