I have this simple piece of code here:
foreach my $key (keys %$structure)
{
$key =~ s/\r?$//;
$structure->{$key} =~ s/\r?$//;
}
This is a part of my trimming function, which takes in a reference to an object. This object (a hash, in our case) was previously initialized from the keyboard.
The problem is that each typed argument has an \r at the end, which is not very cool for outputting the structure. And even though I'm trying to substitute the \r with a regex, it just won't work. Why is that?