Seriously though, that's a shady thing to be doing, don't you think? You're exposing your script to the nuances of buffering. Nevertheless, your script isn't doing any writing, so buffering seems to not be at play here.
However, when I ran your script, I got the following message:
Can't locate object method "TIEARRAY" via package "Tie::File" at C:\Pe +rl\scripts\mytest.pl line 11.
...That's the error I got, until I remembered that you can't very well use Tie::Array without first having a line near the top of the script that says, "use Tie::Array;". Oops. Putting that line where it belongs in your script was all it took for it to "work".
Your riddle was made just a little more difficult to solve because you chose to tell us "I've got one machine where the script works, and one where it doesn't.", instead of helping us out by telling us what error and/or results you got. That would have been helpful information. Since I have to guess that your results were similar to mine, I have to wonder if the real riddle isn't how you got the script to work on the other machines without the important line, "use Tie::File;"
Update:
However, if by chance that isn't your problem, I would also look into the possibility of failing to convert your line endings when moving the script from a Windows environment to a Unix/Linux environment. That can cause a failure as well. Post your error message and we'll have a better idea of what's actually at play here. ...or don't post it and just keep us guessing. ;)
Dave
In reply to Re: Tie::File is sucking the life out of me
by davido
in thread Tie::File is sucking the life out of me
by GaijinPunch
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |