Hi, I have encounter a strange result couldn't figured out.
# Str with format "Mon MM HH", try to skip leading space in DD.
my $str = "Jan 8 11"; # Jan, 8th 11 o'clock
print substr($Str, 0,3) . substr($Str, 4,2)=~s/^\s+// . substr($Str, 7,2) . "\n";
The result is "Jan11", I expect "Jan811". what is going on?
If I separate it to one more step:
my $no_space = substr($Str, 4,2);
$no_space =~ s/^\s+//;
then use $no_space replace BOLD part, everything is fine. Could anyone fix the
problem. Thanks in advance.