Ok. Thanks, Paul and David.

I think I see how I can benefit from Text::Balanced but I now have my
start with PPI and can list the expressions.

Regards,
Lars

#!/usr/bin/perl

use strict;
use warnings;
use PPI;
use Data::Dumper;

my $file = shift or ( die("Need a file name!\n") );

my $document = PPI::Document->new( $file );

my $regex = $document->find('PPI::Token::Regexp');

# print Data::Dumper->Dump($regex),qq(\n);

print qq(\n$file :\n);

for my $expr ( @$regex ) {
    print qq(\t),$expr->content,qq(\n);
}

exit( 0 );

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to