Re: implementing "protected" in OO perl
From: Shawn Corey (shawn.corey_at_sympatico.ca)
Date: 01/16/05
- Next message: A. Sinan Unur: "Re: how can I use perl to do a windows "postmessage" ?"
- Previous message: Martin Kissner: "Re: Need help with Perl and MySQL database data load"
- In reply to: SNeelakantan_C_at_zaplet.com: "implementing "protected" in OO perl"
- Next in thread: xhoster_at_gmail.com: "Re: implementing "protected" in OO perl"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 16 Jan 2005 15:58:18 -0500
SNeelakantan_C@zaplet.com wrote:
> Is there a way of making a certain variable 'protected' so that only
> methods in derived classes may access it? I would prefer a mechanism
> that doesn't wrap the variable in a method call since performance would
> slow down by an order of magnitude.
>
> -Shanker
>
Short answer no and yes. See perldoc -f my
'my' limits the variable's scope to the file (among other things) so if
your object is in a single file, this will work.
--- Shawn
- Next message: A. Sinan Unur: "Re: how can I use perl to do a windows "postmessage" ?"
- Previous message: Martin Kissner: "Re: Need help with Perl and MySQL database data load"
- In reply to: SNeelakantan_C_at_zaplet.com: "implementing "protected" in OO perl"
- Next in thread: xhoster_at_gmail.com: "Re: implementing "protected" in OO perl"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Loading