To all,
Please excuse by previous message...I was in a big hurry and I did not detail my problem. Thanks for the interest you had.
I have the following situation. A first program creates files in directory "D". A second program reads files from "D". Unfortunatly, the script in second program cannot deal with trailing spaces, so I created a perl script to open files in "D", remove the trailing spaces and write back to a file. I want to write back to the same file, but it was crashing on the file handle (cannot write to file or something like that...). I have just tried it again on another computer (other perl?) and it works!!!
A small explanation on $line =~ s! {2,}$!!;
I use ! instead of /. This syntax replaces 2 or more trailing spaces by nothing.
Thanks to all
Please excuse by previous message...I was in a big hurry and I did not detail my problem. Thanks for the interest you had.
I have the following situation. A first program creates files in directory "D". A second program reads files from "D". Unfortunatly, the script in second program cannot deal with trailing spaces, so I created a perl script to open files in "D", remove the trailing spaces and write back to a file. I want to write back to the same file, but it was crashing on the file handle (cannot write to file or something like that...). I have just tried it again on another computer (other perl?) and it works!!!
A small explanation on $line =~ s! {2,}$!!;
I use ! instead of /. This syntax replaces 2 or more trailing spaces by nothing.
Thanks to all