! Program Example from "Essential Fortran 90 & 95" by Loren P. Meissner
! Copyright 1996. Copying for sale requires permission from the author.
! Otherwise, distribution is permitted if these three lines are included.

  module E26M
    implicit none
    public :: Recursive_Print
  contains
    recursive subroutine Recursive_Print( )
      integer :: A, EoF
  ! start subroutine Recursive_Print
      read (unit = 2, fmt = *, iostat = EoF) A  ! Read first integer in remainder of list.
      if (EoF == 0) then
        write (unit = *, fmt = *) A  ! Print first integer.
        call Recursive_Print( )  ! Recursive print remainder of list.
      else  ! Do nothing if EoF /= 0.
      end if
      return
    end subroutine Recursive_Print
  end module E26M
