Hello folks.
I was pulling in a line of data and unpacking it into an array. I was then going to perform some function on the condition that there was any non-space data in two of these array elements. What I had done was:
if(@array[3..4] =~ /\S/) {
do stuff;
}
For some odd reason, this was not working. In order to see if I could do this, I had gone directly into the interpreter (dos prompt, type perl) and populated an array and tried out the code. It all worked as I expected, and that's why I used it. For some reason though, I am unable to do this from a script on another Win2k box. I have to write it out as:
if( ($array[3] =~ /\S/) or ($array[4] =~ /\S/) ){
do stuff;
}
That works. That's fine. But I'm not happy either way =)
Does anyone know why such a thing would work in the interpreter and not through a script?
Awaiting wisdom,
-=rev=-