To amplify Fastolfe's point ... your grep grabs everything in the array, for the simple reason that the line immediately preceding it sets $zero_arg equal to $ARGV[0] (you thus get every line which is such that the first argument passed to the script is the same as the first argument passed to the script). If your first argument is the thing you're looking for in the file, this is obviously no good. use $_ as Fastolfe suggests, that's the "default variable".
Philosophy can be made out of anything. Or less -- Jerry A. Fodor
In reply to RE: Answer: compare what is in ARGV0 to a file
by arturo
in thread compare what is in ARGV[0] to a file
by dallok
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |