The requirement is
perl prg.pl --product --param Product1 --from FilePath
where --product
specifies the reference to the function that has to accept the parameter Product1
, and the FilePath
is the path of the file to be searched for the product.
GetOptions('product=s'=>\&getproduct, 'param=s'=>\$param,'from=s'=>\$from);
In spite of this, while running the Perl program, it gives an error that the values product and from are uninitialized. Can you help me solve this issue?