Is calling a function only twice a good use of recursion?
Yes, every function which calls itself is considered a recursive function.

Recursion is really useful when traversing trees and such.

As I don't fully understand Perl, I can't really tell whether this case is proper use of recursion, perhaps also provide the intent of your code.

UPDATE

If you simply want to see whether data is passing (or not passing) through a queue, I wouldn't find recursion to be a suitable implemention.

I would expect a function which returns either true or false after a given amount of time, or immediately when data is passing through.

Consider the following pseudo code:

function isDataPassing( queue, time )
{
   headOfQueue = queue.peek();
   dataPassing = false;
   while ( timePassed &lt; time )
   {
       if ( headOfQueue != queue.peek() )
       {
           dataPassing = true;
           break;
       }
   }

   return dataPassing;
}


I can't help you with how you would go about implementing this in Perl. StackOverflow is a better location to ask such a question.