in reply to declaring an array within a package

The scalar $self is a reference to something if you mean to bless it into a class defined in your package. The statement $self = @_; sets it equal to the number of arguments. That is not the cause of the message, but it indicates you need to study perl references.

The statement $self->@File = <FILE>; is semantically incorrect. You may mean something like         $self->{'File'} = [<FILE>]; which puts a reference to an array of lines from the file into $self's 'File' data element.

Update: Oops, didn't check my memory against the question. sauoq++ is correct, of course. Doesn't change the argument, just the value $self gets.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: declaring an array within a package
by sauoq (Abbot) on Dec 19, 2003 at 00:23 UTC
    The statement $self = @_; sets it equal to the number of arguments.

    Well, that statement would, but that statement didn't appear in the OP's post. He had my ($self) = @_; which is list context and assigns the first element of @_ to $self.

    -sauoq
    "My two cents aren't worth a dime.";