Luinrandir wrote:
> OK.. maybe I'm trying to be too fancy.
> 
> the package is:
> ###################
> package Names;
> @Countries("Ireland","Wales");

The '@' sigil can only be in front of an array or a slice.  You probably meant:

@Countries = ( "Ireland", "Wales" );


> %Lord{Ireland}=("Bob","Tom");
> %Lord{Wales}=("Ted","Ned");

The '%' sigil can only be in front of a hash.  You probably meant:

$Lord{ Ireland } = [ "Bob", "Tom" ];
$Lord{ Wales }   = [ "Ted", "Ned" ];

Or:

%Lord = (
    Ireland => [ "Bob", "Tom" ],
    Wales   => [ "Ted", "Ned" ],
    );


> return 1;

You can only return fron a subroutine.  You probably meant:

1;


> #################
> the program is:
> ###################
> foreach $Country(@Names::Countries)
> {
>     print qq|$Names::$Lord{$Country}|;
                     ^^^
Another syntax error.  And you don't need to quote scalars.

    print $Names::Lord{ $Country };


> }
> ###################

perldoc perl

[snip]

           perlsyn             Perl syntax
           perldata            Perl data structures

           perldsc             Perl data structures intro
           perllol             Perl data structures: arrays of arrays

           perlmod             Perl modules: how they work
           perlmodlib          Perl modules: how to write and use
           perlmodstyle        Perl modules: how to write modules with style



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to