Name

getopt

Synopsis

getopt ('switches'[, \%opts])

switches is a string of the command-line options that take arguments. For each option, getopt sets $opt_ x (in which x is the switch) to the value entered as an argument. If \% optsis specified, it is a reference to a hash in which getopt sets the key to the name of the switch and the value to the argument (and the $opt_ variables are not set).

Get Perl in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.