Leser: 1
3 Einträge, 1 Seite |
1 2 3 4 5 6 7 8 9 10
# t_domains inventory my @domains = cast2db::Class_t_domains->inventory('10.10.1.50'); my $obj; foreach (@domains) { $obj = cast2db::Class_t_domains->retrieve($_); print $obj->domain; }
1
2
3
4
5
6
7
8
9
10
DBD::Pg::st execute failed: ERROR: syntax error at or near "primary" at character 27
[for Statement "SELECT essential, domain, primary
FROM t_domains
WHERE id_t_domains=?
" with ParamValues: 1='4'] at /usr/lib/perl5/vendor_perl/5.8.8/DBIx/ContextualFetch.pm line 52.
DBD::Pg::st execute failed: ERROR: syntax error at or near "primary" at character 27
[for Statement "SELECT essential, domain, primary
FROM t_domains
WHERE id_t_domains=?
" with ParamValues: 1='4'] at /usr/lib/perl5/vendor_perl/5.8.8/DBIx/ContextualFetch.pm line 52.
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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
package cast2db::Class_t_domains; use strict; # Class::DBI use base qw(cast2db::Class_db_configure); # table cast2db::Class_t_domains->table('t_domains'); # tuples cast2db::Class_t_domains->columns( All => qw/id_t_domains domain/, Primary => qw/id_t_domains/, Essential => qw/domain/, #Others => qw//, ); sub inventory { my $self = shift; my $inet_addr = shift || $self; my $domain; my @domains; my $id_t_domains; my @id_t_domains; open (NSLOOKUP, "-|", "nslookup $inet_addr") or die; while(<NSLOOKUP>){ if (/^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\.in-addr\.arpa\sname\s=\s\w+\.(.*)\.$/) { push (@domains,$1); } } close(NSLOOKUP); # uniq @domains = keys %{{ map { $_ => 1 } @domains }}; # ;.) Hardcore Perl @domains || push(@domains, 'unknown'); # get @id_t_domains foreach $domain (@domains) { $id_t_domains = cast2db::Class_t_domains->find_or_create( domain => $domain ); push(@id_t_domains,$id_t_domains); } # return id's return @id_t_domains; }
1
2
3
4
5
6
$VAR1 = bless( {
'__triggers' => {},
'_class_trigger_results' => [],
'id_t_domains' => '4'
}, 'cast2db::Class_t_domains' );
Can't retrieve a reference at ./cast2.pl line 34
redpantyhose+2008-09-01 12:00:41--[...]
Erhalte ich folgendes:
Code: (dl )1
2
3
4
5
6DBD::Pg::st execute failed: ERROR: syntax error at or near "primary" at character 27
[for Statement "SELECT essential, domain, primary
FROM t_domains
WHERE id_t_domains=?
" with ParamValues: 1='4'] at /usr/lib/perl5/vendor_perl/5.8.8/DBIx/ContextualFetch.pm line 52.
[...]
[...]
3 Einträge, 1 Seite |