in reply to What's magic so "magic"?
Tied variables, for example, have magic. When you read or write to a tied variable perl calls the code in the package the variable has been tied to. Many perl special variables are magic--for example $! is magic. When you read from it, perl goes and fetches the contents of errno, which is an integer that notes the last error a system call threw.
There's not much to know or learn about magic in general unless you want to go dive into the innermost guts of perl, in which case perlguts and perlapi are the place to go. Generally you'll use a specific type of magic, such as tying, rather than just magic in general.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: What's magic so "magic"?
by larsen (Parson) on Mar 15, 2003 at 16:38 UTC | |
by jand (Friar) on Mar 16, 2003 at 08:52 UTC | |
|
Re: Re: What's magic so "magic"?
by pg (Canon) on Mar 15, 2003 at 17:06 UTC | |
by jand (Friar) on Mar 16, 2003 at 16:51 UTC | |
by Elian (Parson) on Mar 16, 2003 at 16:25 UTC | |
by Aristotle (Chancellor) on Mar 16, 2003 at 19:10 UTC | |
by Elian (Parson) on Mar 16, 2003 at 19:20 UTC |