in reply to Getopt in perl

But why the $iPid will be 1 always when I run the perl script
Because getopts('f:p'); means p is a boolean flag, and f takes an argument.