- or download this
Acklay
10
...
13
botany
2053
- or download this
#!/usr/local/bin/perl
use strict;
...
close $fh;
print Dumper(\%students_51,\%students_53);
- or download this
#OUTPUT:
...
'age' => '12'
}
};
- or download this
use Text::Table;
my $table_51 = Text::Table->new("NAME","AGE","TOPIC","CLASS");
- or download this
foreach my $key(keys %students_51){
#Direct interpolation to the add function of Text::Table
...
}
$table_51->add(' '); #ADD AN EMPTY Record
print $table_51;
- or download this
#OUTPUT:
...
Chiilak 17 2051
Blistmok 14 metaphysics 2051
Acklay 10 genetics 2051
- or download this
#Zuxu record
my @Zuxu_data = ("Zuxo"," "," ","2053"); #blanks serve as placeholders
+ here
- or download this
my $table_53 = Text::Table->new( "NAME\n-----", "AGE\n---", "TOPIC\n--
+---", "CLASS\n-----" );
...
print $table_53;
- or download this
#OUTPUT:
...
Lylek 2053
Massiff 13 botany 2053
Zuxo 2053
- or download this
#print the header for $table_53 and Massiff's record.
foreach(0,1,4){
print $table_53->table($_);
}
- or download this
#OUTPUT:
NAME AGE TOPIC CLASS
----- --- ----- -----
Massiff 13 botany 2053
- or download this
#show me 3 records starting from line 2
print $table_53->table(2,3);
- or download this
#OUTPUT:
Bith 12 anthropology 2053
Lylek 2053
Massiff 13 botany 2053
- or download this
my @headed_table = $table_53->table();
my @headless_table = $table_53->body();
...
print @headless_table;
print "+" x 50, "\n";
print @headed_table;
- or download this
#OUTPUT:
...
Massiff 13 botany 2053
Zuxo 2053
- or download this
print $table_53->body();
print "\n\n";
my $third_record = $table_53->body(2);
print $third_record;
- or download this
#OUTPUT:
...
Massiff 13 botany 2053 <----Third Record only
- or download this
#!/usr/local/bin/perl
use strict;
...
);
print $table_53;
- or download this
my @headless_51 = $table_51->body();
my @headless_53 = $table_53->body();
print "@headless_51 @headless_53";
- or download this
#OUTPUT:
...
Massiff 13 botany 2053
Zuxo 2053
- or download this
my $merged_tables = Text::Table->new("\tTABLE 51 ","\tTABLE 53");
$merged_tables->add($table_51->select(0,1,2,3),$table_53->select(3,2,1
+,0));
...
Blistmok 14 metaphysics 2051 2053 Lylek
Acklay 10 genetics 2051 2053 botany 13 Massiff
2053 Zuxo
- or download this
my $merged_name_age=Text::Table->new("\tAGES OF CLASSES","");
$merged_name_age->add($table_51->select(0,1),$table_53->select(0,1));
...
Acklay 10 Massiff 13
Zuxo
- or download this
my $class_topic=Text::Table->new("Subjects Of Classes","");
$class_topic->add($table_51->select(2,3),$table_53->select(2,3));
...
genetics 2051 botany 2053
2053
- or download this
# @Dlines = $table1->body();
# @DPlines = $table2->body();
...
$alignedTable->load([$D1, $D2]);
}
print $alignedTable;