in reply to Calling a subroutine within a conditional

The message you are seeing is a warning. It arises only if you have look_through_file declared with a prototype; for example:

sub look_through_file($$) { ...

There are three ways to deal with this:

  1. Move the definition of sub look_through_file to before the code where it is called (the while loop) — as recommended by daxim, above.
  2. Leave the definition where it is, but add a declaration before the calling code:
    sub look_through_file($$);
  3. Omit the prototype altogether. Unless you have a really good reason for including it, a prototype is usually a bad idea anyway.

See Prototypes. Hope that helps,

Athanasius <°(((><contra mundum

Replies are listed 'Best First'.
Re^2: Calling a subroutine within a conditional
by AnomalousMonk (Archbishop) on Sep 03, 2012 at 23:39 UTC