スクリプト -> 335.pl
/* C++のヘッダファイル foo.h */
#include <iostream>
#include <stdlib.h>
#include "common.h"
using namespace std;
namespace test{
class FooTest: public Test {
int total;
public:
Test();
~Test();
int foo(void);
int bar(int n, int m);
}; // End of class FooTest
}; // End of namespace test
実行方法
$ perl -Pn 335.pl < foo.h または、
$ ./335.pl < foo.h
18
test
iostream stdlib.h common.h
FooTest
int foo(void) int bar(int n, int m)
using namespace std int total
行数, namespace, includeファイル, メンバ関数, 変数の順に出力
