I tried matching
~m/module(\s+)ARGV[1](\s+)\(/ --> (generic code)but is not working.The same is able to match when i provide hardcoded value instead of passing from the command line.
~m/module(\s+)data_tx_dig(\s+)\(/ -->(hardcoded code).Please help me fix this.
i tried ~m/module(\s+)$ARGV[1](\s+)\(/ but still not working..I know ARG[0] and ARG[1] are first and second arguments ,ARG[1] was intentionally given in my script.
Wait... so you want to pass the word to be matched as the first of the second parameter? The match operator contains "$ARGV[0]", which you also use as filename in the "open" function. Additionally, this: chomp($ARG[1]); should probably be: chomp($ARGV[1]);
Why are you opening a file - open(FH1,"<$ARGV[0]"); , when you are not reading from it - while(<>){ - this reads from STDIN...