CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
tie()

 



yapp
User

Mar 3, 2002, 12:32 PM

Post #1 of 4 (593 views)
tie() Can't Post

Whoa. What kind of a function is this?
It seams to be replacing dbm_open

- What is the advantage?
- Does that also lock parts of a file, or everything
- Or is sysopen(FH, $file, $O_RDWR|O_CREAT) ... better to update a small file?
- How large will those tie() files be? (compared to flat-text i'm using now)

Yet Another Perl Programmer

_________________________________
~~> [url=http://www.codingdomain.com]www.codingdomain.com <~~
More then 3500 X-Forum [url=http://www.codingdomain.com/cgi-perl/downloads/x-forum]Downloads! Cool


mhx
Enthusiast / Moderator

Mar 3, 2002, 1:33 PM

Post #2 of 4 (591 views)
Re: [yapp] tie() [In reply to] Can't Post

Tying is a more general feature. It can do all you requested, but someone has to write the class.
You can use tie to bind a variable to a class. Whenever that variable is accessed, special methods in that class are being called to fetch a value from the variable or to store a value in it, for example.
All the details are in the [url=http://www.perldoc.com/perl5.6.1/pod/perltie.html]perltie manpage.

-- mhx

At last with an effort he spoke, and wondered to hear his own words, as if some other will was using his small voice. "I will take the Ring," he said, "though I do not know the way."

-- Frodo



yapp
User

Mar 4, 2002, 8:24 AM

Post #3 of 4 (581 views)
Re: [mhx] tie() [In reply to] Can't Post

Sounds great, but can you show me an example?
I don't have any clue what's going on.

Yet Another Perl Programmer

_________________________________
~~> [url=http://www.codingdomain.com]www.codingdomain.com <~~
More then 3500 X-Forum [url=http://www.codingdomain.com/cgi-perl/downloads/x-forum]Downloads! Cool


mhx
Enthusiast / Moderator

Mar 4, 2002, 8:43 AM

Post #4 of 4 (578 views)
Re: [yapp] tie() [In reply to] Can't Post

Have a look at [url=http://forums.perlguru.com/gforum.cgi?post=11921#11921]this post. I'm even combining tying and XS programming there, so this is two interesting topics at once. Wink

-- mhx

At last with an effort he spoke, and wondered to hear his own words, as if some other will was using his small voice. "I will take the Ring," he said, "though I do not know the way."

-- Frodo


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives