|
Answer» Hello every one
I just tried out one more THING and get stuck and needed ur help plaease help me regarding following issue.
I have a test.txt file like follows: [.cpp file] a.cpp b.cpp c.cpp [end]
[.h file] a.h n.h [end]
now i want to right the perl script which parser the file so that i can complie the .cpp file correctally.(i already have the method to complie it), and need to copy header files at one place(already have method for it)
just want to know how we can use CONFIG parser module in this.
Thanks for HELPIF you want to use a module, you can search CPAN. one of them is Config::IniFiles. install and play with it. read its documentation. however, you can also do it without a parser module. Code: [SELECT]while (<>){ if (/\[end\]/ ){ $flag=0 } if ( /\[.cpp file\]/ ){ $flag=1;NEXT} $flag && print $_ ; }
output: Code: [Select]# perl test.pl file.ini a.cpp b.cpp c.cpp
thanks for reply , i tried to play with that module.Quote from: roohi on April 21, 2009, 02:29:59 AM thanks for reply , i tried to play with that module.
if it doesn't suit your needs, search CPAN for Parser or Config (or other search terms) and see if you can find others that's suitable for you.
|