Reputation: 7735
[root@dev-test test]$ perl -e "%hash=(key,1);print 1 if exists $hash{key};"
exists argument is not a HASH or ARRAY element at -e line 1.
The above works if I put it in a file,but why command line fails?
Upvotes: 0
Views: 90
Reputation: 67900
Works for me (windows). Perhaps in your OS you need to use single quotes? Looks like linux/unix, and double quotes expand variables prefixed with the $
dollar sign.
Upvotes: 1