Re: Problem with Hashes
From: Sherm Pendley (spamtrap_at_dot-app.org)
Date: 11/19/04
- Next message: chris: "Re: script hangs waiting for key stroke"
- Previous message: news.west.cox.net: "Re: Bits of a number... why is this true?"
- In reply to: daniel kaplan: "Re: Problem with Hashes"
- Next in thread: daniel kaplan: "Re: Problem with Hashes"
- Reply: daniel kaplan: "Re: Problem with Hashes"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 19 Nov 2004 16:57:11 -0500
daniel kaplan wrote:
> have a variable of 'this kind'?
>
> well don't use it in 'this kind' context and the compiler will let you know,
> and boom problem found quickly.....but with Perl you can have @row, $row,
> $row[0], and so on and so on and it makes you have to be more digilent as
> the programmer....
Context is very important in Perl. Subroutines can find out what context
they were called in with wantarray(), and alter their return value(s)
accordingly. An array used in scalar context has a different value than
one used in list context. Etc.
It can be painful for a C programmer who's accustomed to strict typing,
but context is an idea that's central to Perl and it's well worth learning.
sherm--
-- Cocoa programming in Perl: http://camelbones.sourceforge.net Hire me! My resume: http://www.dot-app.org
- Next message: chris: "Re: script hangs waiting for key stroke"
- Previous message: news.west.cox.net: "Re: Bits of a number... why is this true?"
- In reply to: daniel kaplan: "Re: Problem with Hashes"
- Next in thread: daniel kaplan: "Re: Problem with Hashes"
- Reply: daniel kaplan: "Re: Problem with Hashes"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|