if ($self->datatype->[$_] =~
/^(?:TINYINT|MEDIUMINT|SMALLINT|INT|INTEGER|BIGINT|FLOAT|DOUBLE)$/) {
$hr_returnvalue->{$CurrentColumnName} *= 1;
# Multiply by 1 to create a numeric value.
}
####
C:\test>perl -MDevel::Peek -E"my $x = '12345'; Dump $x; $x *=1; Dump $x"
SV = PV(0x6cf50) at 0xc74e8
REFCNT = 1
FLAGS = (PADMY,POK,pPOK)
PV = 0x67758 "12345"\0
CUR = 5
LEN = 8
SV = PVIV(0xaf018) at 0xc74e8
REFCNT = 1
FLAGS = (PADMY,IOK,pIOK)
IV = 12345
PV = 0x67758 "12345"\0
CUR = 5
LEN = 8
####
for( 0 .. $#{$self->columns} ) {
$CurrentColumnName = $self->columns->[$_];
if( !(defined $self->flatfield_start->[$_]
and defined $self->flatfield_length->[$_] )
) {
# Field is missing interface_start, interface_length or both, skip it.
next;
}
if ($self->datatype->[$_] =~
/^(?:TINYINT|MEDIUMINT|SMALLINT|INT|INTEGER|BIGINT|FLOAT|DOUBLE)$/
) {
$hr_returnvalue->{$CurrentColumnName} = 0 +
substr( $textinput,
$self->flatfield_start->[$_], $self->flatfield_length->[$_] );
}else {
$hr_returnvalue->{$CurrentColumnName} =
substr( $textinput,
$self->flatfield_start->[$_], $self->flatfield_length->[$_] );
$hr_returnvalue->{ $CurrentColumnName } =~
s/^\s*(.*?)\s*$/$1/; # Trim whitespace
}
# Fill empty fields with that field's default value, if such a value is defined