I wrote a Perl program "transfer.pl" and the input parameter is the hash value (the key and the value are strings). The code segment is:
my %transfers = ();
if (!GetOptions("transfer=s" => \%transfers))
{
Usage();
exit(1);
}
I used the windows system. On the command line, I typed:
perl tranfer.pl --transfer "table = %s"="[TableName=%s]"
I hope the key is table = %s
and the value is [TableName=%s]
, but it seems Getopt::Long always finds the first =
so the key is table
and the value is %s=[TableName=%s]
.
When I typed
perl tranfer.pl --transfer "table \= %s"="[TableName\=%s]"
The key is table \
, the value is %s=[TableName\=%s]
.
I want to know how to bypass the "=" in my string value and make the code do what I expect?
Thank you very much!