in reply to Too many arguments for main::

The get_Origserver sub has been defined with an empty prototype which means that it Perl will not allow you to pass any arguments to it.

sub get_Origserver () {.....

This is probably accidental. Removing the empty brackets from the subs definition as in

sub get_Origserver {....

Or making the prototype so that it accepts (at least) a scalar argument as in

sub get_Origserver ($) { ....

should fix the problem.


Nah! Your thinking of Simon Templar, originally played by Roger Moore and later by Ian Ogilvy

Replies are listed 'Best First'.
Re^2: Too many arguments for main::
by tadman (Prior) on Oct 30, 2002 at 06:55 UTC
    I'd like to just insert that putting in prototypes is probably a Bad Thing. There are occasions when you need them, but for the most part, they're a deprecated nuisance. They can cause subtle errors, which are not pleasant to diagnose, because they perform an implicit scalar conversion to any passed arguments.

    In short, this original post is merely one example as to why prototypes are undesirable. If you don't want to find others, just avoid them wherever possible.