Hi and thanks for your time and effort, I really appreciate it. Your answer seems to do what I need in this case and is straightforward - very good for a newbie. I should actually delete the bit where I use the subroutine to create 5 step files, as it's confusing - it doesn't serve any purpose in my script, it's just my attempt to use "touch" and not forget how I did it. I will try your code now and thanks again so much :)
I had tried implementing a file counter but I can see now what I was doing wrong, I didn't think about using elsif and I got lost in continuous elses and ifs and failed to do it properly.
Regarding your comment about the ugly bit in my code, I completely agree. The problem is that I'm a coding newbie and the project I'm working on needs enormous scripts that I try to write myself, although I've never studied anything related to computers. I'm extremely pressured for time (and I won't mention my stress levels, lol) and although I did prefer your solution, it would mean that I would have to go and read on what glob does and I simply don't have the time to do it, and in this case it's ok since my ugly solution worked. However I had already printed and included your recommendation in my perl folder, where I keep corrections and solutions for future use, maybe for a future project. My supervisors just wouldn't be happy if I went back to make stuff prettier - as long as they work it's ok and I have to move forward, as I have deadlines to keep all the time :(
Again thank you very much for your time and answer, it looks really helpful.
In reply to Re^2: check for latest file, remove and touch file?
by fasoli
in thread check for latest file, remove and touch file?
by fasoli
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |