in reply to Is this code correct
sub info() { my ( $nick, $reply ) = @_; }
That doesn't make sense. sub info() declares info as a subroutine, which doesn't accept any arguments. Inside that subroutine you want to pass arguments to $nick and $reply.
See:
#!/usr/bin/perl use strict; use warnings; sub foobar() { my ( $foo, $bar ) = @_; print "foo: $foo\nbar: $bar\n"; } foobar( 1, 2 );
This results in:
Too many arguments for main::foobar at prot.pl line 11, near "2 )" prot.pl had compilation errors.
Please see perldoc perlsub; section Prototypes for details.
|
|---|