in reply to Re: (Ovid) Re: need nextline() sub
in thread need nextline() sub

Zaxo was on the money with readline() - all i needed was to get underneath the abstraction of the <FH> operator.

The spaceship operator (<>) is just a wrap around the readline function. You can get the same behaviour like this:

sub next_line { return scalar <FH>; }

Another remark, it might be worth setting $/ before using readline. That way you don't get unexpected behaviour if someone fiddled with it. So put something like this at the start of your sub:

local $/ = "\n";

-- Hofmator