File: alzabo_grep

package info (click to toggle)
libalzabo-perl 0.86-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,116 kB
  • ctags: 767
  • sloc: perl: 14,549; makefile: 46
file content (29 lines) | stat: -rw-r--r-- 459 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/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";