PerlingTheUK,
I do not understand what you are asking. If you would like to parse date/time strings that come in different formats, you should have a look at Date::Manip. If you are asking how to do some sort of templating then please try to rephrase your question. Break the problem into small pieces, put them in a logical order, and then present them to us in a digestible manner.
| [reply] |
L~R,
This is one date time string, with a very simple formatting, but as I have some other problems coming up soon, where I have to concatenate some values that might be only numbers with leading zeros, the behaviour I experience from concatenation which basically replaces 0 with space, surprises me a bit. So I am asking for someplace or explanation why this happens.
Cheers, PerlingTheUK
| [reply] |
#!/usr/bin/perl
use strict;
use warnings;
while ( <DATA> ) {
chomp;
print format_it( split " " , $_ ), "\n";
}
sub format_it {
my $formatted;
for ( @_ ) {
$formatted .= length $_ == 1 ? '0' . $_ : $_;
}
return $formatted;
}
__DATA__
3 2 61
13
333
5
7
8
| [reply] [d/l] |