- or download this
sub getTypeName {
my $typeNum = shift;
...
die "$typeNum not valid\n";
}
}
- or download this
sub getTypeName {
my $typeNum = shift;
...
return $typeName;
}
- or download this
my $first = substr $line, 0, 2;
my $second = substr $line, 2, 4;
my $third = substr $line 10, 4;
- or download this
my ($first, $second, $junk, $third) = unpack "A2A4A4A4", $line;
- or download this
my ($first, $second, $third) = (unpack "A2A4A4A4", $line)[0,1,3];
# Or, you could do ...
my ($first, $second, $third) = ($line =~ /(.{2})(.{4})(.{4})(.{4})/)[0
+,1,3];
- or download this
my @colNames = qw(first second third);
my %hash;
@hash{@colNames) = (unpack "A2A4A4A4", $line)[0,1,3];