January 28th, 2013, 08:14 PM
Originally Posted by Rahul6990
Hi As per my understanding the script is:
1. Opening two files provided in the command line input($ARGV , $ARGV).
2. Reading each line in file one.
3. Searching if the file has "/CLS somedata"
4. replace ~F:CKL~X:.+? ~A with /CLS somedata ~A
5. write it to the second file.
You're kinda close, but not quite. Steps 3 and 4 are not what you said above.
HINT: If the line doesn't have /CLS somedata/..., then $str is not defined, but the undefined value is used in the replace string.
Also look carefully at what's being replaced. It isn't exactly what you said above. Note that $1 is being used in the replacement expression above.
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne