in reply to IF condition that doesnt work
My problem its when i need to check the line using ReGex, i have the check if the lines named (hwUserField7) exists, and if dont, it must use the data store in hwUserField3 to look for in the has i had readed from the file, then must write the value referenced from this key in the hash as a new line. My problem its i dont able to put into the if contition of the flag to check if exists the line.
Please note that in your code, the conditions use "hwAssetUserField7" and "hwAssetUserField3".
Also, you are reading that XML file line by line and testing each for the whole pattern "<tag>data</tag>". Is it possible that the opening tag to be in one line of the file and the closing tag to be in another? Then you should slurp the entire file and then perform the IFs.
BTW, if both matching tags are always in the same line, you can use if (cond3) {...} elsif (cond7) {...}.
Instead of uncompressing->processing->recompressing files, I would open files through a pipe, to get data uncompressed on the fly, and do the same to the output:
open(LEEXML, "7z.exe e -so $tmp5|") or die; open(ESCRIBEXML, "|7z.exe a -si -tgzip $xml_out") or die;
It will save space on disk, but I'm not sure if this performs.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: IF condition that doesnt work
by Tanktalus (Canon) on Dec 23, 2009 at 22:55 UTC | |
|
Re^2: IF condition that doesnt work
by Sombrerero_loco (Beadle) on Dec 29, 2009 at 10:24 UTC |