in reply to Can Perl Turn A String Into A Virtual File?

If you're looking to be more ambiguous (bonus!), the way to go would be to implement as mentioned by the others:
while(@lines) { ... }
Then, if you want to use a file, you can do
@lines = <MYFILE>;
or for a string
@lines = split /\n/, $string;
prior to executing the loop. Setting up a string to work via a file handle is a little extreme, unless you need it to work in both cases and the files you are working with are too large to be worth reading in in a single gulp. This is one of the things the IO::String is supposed to do, and the thing you would need to do to use the form you originally proposed. But IO::String, according to its documentation, does not yet have this feature implemented! So, unless have huge files, just go with the the way of the array.