#!/usr/bin/perl use strict; use warnings; use Text::CPP; my $MyData = ; my $reader = new Text::CPP( Language => 'STDC99', Options => {}, Builtins => { foo => 'this', bar => 'that', }, ); $reader->read('/root/Desktop/file.c'); while (my $token = $reader->token) { print "Token: $token\n"; } $reader->data->{MyKey} = $MyData; __DATA__ #ifdef pathtest 38. This should appear. #else #define pathtest 37. This should appear. #include test.txt 39. This should appear. #undef pathtest #endif