----- Original Message ----- From: "Tómas Guðmundsson" <[EMAIL PROTECTED]> To: "Janek Schleicher" <[EMAIL PROTECTED]> Sent: Tuesday, July 30, 2002 8:41 AM Subject: Re: Help, I suppose.
> okey, I made it a hash now. And everything works and that's nothing but > cool! > > But what do I do to make it more than just the phone number so if I ask of > Fred it shows his > number, address, e-mail, and such ? > > my %phone_book = qw( > Fred [EMAIL PROTECTED] 0123 fred'sstreet 34 > ); > I know perl always search for the key and then returns the value but how do > I make the value more than one word? > > ----- Original Message ----- > From: "Janek Schleicher" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, July 30, 2002 5:48 AM > Subject: Re: Help, I suppose. > > > > Drieux wrote at Tue, 30 Jul 2002 02:51:27 +0200: > > > > > > > On Monday, July 29, 2002, at 04:05 , Tómas Guðmundsson wrote: [..] > > >> my $phone_book = qw{ > > ^ > > >> Fred 0123 > > >> John 4567 > > >> Bill 8901 > > >> }; > > > > > > you might want to think of using a hash here > > > instead of a straight array, hence > > > > > > my %phone_book = ( > > > Fred => 0123, > > > John => 4567, > > > Bill => 8901, > > > ); > > > > Or if you are too lazy too retype so much, > > you can simply change the $ to a % and everything is fine. > > > > But note > > 0123 > > is an octal number, > > so when it is used as integer, > > it's interpreted as 83. > > > > However, the error doesn't occur when you simply change the $ to a % :-)) > > > > > > Cheerio, > > Janek > > > > > > -- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]