in reply to Re^3: pipe to less crash
in thread pipe to less crash

The way my program works is that the user sees a list of files and they can choose one and it will open with less, but then once they exit less, I want them to be brought to the program.

Replies are listed 'Best First'.
Re^5: pipe to less crash
by Corion (Patriarch) on Jul 05, 2011 at 14:10 UTC

    I'm sorry that I was unclear in my response.

    In your code, you use the following statement:

    close LESS or die "can't close: status = $?";

    ... but you do not seem to want your program to die. So, a solution is to not call die instead:

    close LESS;