#!/usr/bin/perl -w

use strict;

use Alzabo::Create;

my ($re, $schema) = @ARGV;

unless ( defined $re && defined $schema )
{
    print "Usage: alzabo_grep  regex  schema\n";
    exit;
}

my $s = Alzabo::Create::Schema->load_from_file( name => $schema );

print "\n";

$re = qr/$re/;
foreach my $t ( $s->tables )
{
    foreach my $c ( $t->columns )
    {
        print $t->name . ' . ' . $c->name . "\n"
            if $c->name =~ /$re/;
    }
}

print "\n";


syntax highlighted by Code2HTML, v. 0.9.1