Hi Perl Monk,
I have a .h file with the different macro definition like given below snippet
{
#define thread 1
#define flag
#define code 0
#define const (100/5)
#define flag_condn 1
}
I need to extract only variable which is assigned with 1 or 0 or blank space, like my out put has to be
{
thread
flag
code
flag_condn
}
Here is my perl which I am not able to get properly in case of #define flag which has a blank space, I used split function,
while (<INPUT>) {
my @split_data = split(' ', $_);
if($split_data[2] == " "||$split_data[2]==1||$split_data[2] == 0){
print "$split_data[1]\n"
}
}
regards,
-Prassi