Darkwing99, when you refer to "real LF" it makes me twitch. There is no such thing as a fake LF, hence no real LF neither. You problem is due to the fact that platform handle newlines differently (I guess you figured that out by now). In binary there is no such thing as a newline...
For clarity's sake...
unix: \n
win: \r\n
mac: \r
thendal, I don't know why it didn't replace the newlines on the remote server but I do know that the code s/\n/'***'/g will replace any newlines to '***'. If it didn't substitute it's because of something else. A perl program should be...
well, that's very ugly. Nothing to laugh at if you want my opinion. To read a single dir use the readdir() function. If you need to traverse a tree use the File::Find module. for a regex that matches 8 digits use /^\d{8}\..*$/.
Good luck!
I have a fair idea of what the problem is. By now it's clear that the problem is in the script that transfers the files. It does something to those files that cause them to just hang if you try to run them. So, my question was if those files beeing transfered were execuables (binaries), and...
When you open a file (or do any external operation) it's wise to check if it succeeded. What if for some reason the file your script tries to open suddenly disappears? You just can't have your script continue executing as if nothing was wrong. So in other words always check the status and...
I'm sorry but it's not being clear to me what kind of apps you are transfering. Are those apps binaries? i.e. .exe files? If so then make sure you set the file handle to binmode when reading the file and trasnfering the file. BTW, did you write that trasfering perl script yourself?
In my previous message I said "I understand the part that it's the script that transfer that has problems but rather the script being transfered." but meant "I understand the part that it's not the script that transfer that has problems but rather the script being transfered."
ok... again. "The retreived application will not run." is no more useful than "The application then won't run." What is the error? I understand the part that it's the script that transfer that has problems but rather the script being transfered. Start transferring small...
"The application then won't run." is not very helpful to us. You ought to get some kind of errors, which would be a lot more useful to us. Also, to find out if the problem is in the transfer or has to do with the box itself simply chekc what the script looks like once transfered on...
I rarely walk back the tree using "..". It's prone to some errors. It's better with the full path IMHO. What is the status of your open statement if you check thr $! variable?
You better do it in two regexes like you have. It's more efficient. I'm surprised that O'Reilly gives a regex like Paul gave. It has to read the entire string whereas with the two regex method it only looks at the beginning and then at the end. To make it all in one line you can do like...
Just to make it clear, the HTTP_REFERRER key Haunter is refering to is part of the %ENV hash. So $ENV{HTTP_REFERRER} is how you acess it. And is set only when there is a referer. That's why you didn't see it with the code Haunter gave for walking the %ENV hash earlier.
Doh! Wullie is right. Can't put the domain name in the SSI tag. Stupid me. Been so long since I've made SSI scripts. Sorry if that stumped you for a while. :/
You open the original file and open a target file. You read from the original and put the character where it needs to be and print the result to the target file. If it needs to be put every 2000 characters you can set $/ to \2000 and do something like ...
print TARGET "${_}char"...
Don't expect people to know PHP. I have absolutely no idea what a REDIRECT_ variable would be good for. From the little information you give I can only deduce that the variable contains a location to redirect. In my opinion this is useless as the programmer decides where to redirect if...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.