1AnyData::Format::Fixed(U3s)er Contributed Perl DocumentatAinoynData::Format::Fixed(3)
2
3
4
6 AnyData::Format::Fixed - tiedhash & DBI/SQL access to Fixed length data
7
9 use AnyData;
10 my $table = adHash( 'Fixed', $filename,'r',{pattern=>'A20 A2'} );
11 while (my $row = each %$table) {
12 print $row->{name},"\n" if $row->{country} =~ /us|mx|ca/;
13 }
14 # ... other tied hash operations
15
16 OR
17
18 use DBI
19 my $dbh = DBI->connect('dbi:AnyData:');
20 $dbh->func('table1','Fixed', $filename, {pattern=>'A20 A2'},'ad_catalog');
21 my $hits = $dbh->selectall_arrayref( qq{
22 SELECT name FROM table1 WHERE country = 'us'
23 });
24 # ... other DBI/SQL operations
25
27 This is a parser for fixed length record files. You must specify an
28 unpack pattern listing the widths of the fields e.g. {pattern=>'A3 A7
29 A20'}. You can either supply the column names or let the module get
30 them for you from the first line of the file. In either case, they
31 should be a comma separated string.
32
33 Please refer to the documentation for AnyData.pm and DBD::AnyData.pm
34 for further details.
35
37 copyright 2000, Jeff Zucker <jeff@vpservices.com> all rights reserved
38
39
40
41perl v5.12.0 2001-07-17 AnyData::Format::Fixed(3)