in reply to Re^4: How to remove underscore at the end of the line?
in thread How to remove underscore at the end of the line?
It is real hard to believe that when passed the empty string as prefix it would have an underscore at the end of it ya know, your example leaves a whole lot to be desired
This $prefix=~ s/_$//;takes one underscore off the end. To take all underscores off the end you would need $prefix=~ s/_$//g; or $prefix=~ s/_+$//;. But that wasnt what you asked was it? you should have asked how to remove ALL underscores from the end.
Now why might there be more than one underscore at the end of $prefix? well dont you add one when you say ir($prefix . $file .'_', $dir . '/' . $file); and if $file already had one at the end you just made it two didnt you?
so if you dont want an underscore at the end of $prefix then just why do you add one when you call ir()? i would love to hear that explanation.....
another explanation i would like to hear is what good the $$ prototype is doing for you, can you explain why you need it?
and what is going to happen if you ever hit a file with TWO dots in it?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: How to remove underscore at the end of the line?
by Anonymous Monk on Mar 17, 2017 at 07:07 UTC | |
by huck (Prior) on Mar 17, 2017 at 08:37 UTC |