| Jmax- | "Even though it looks like a regular function call, it isn't: you can't take a reference to it, such as the incorrect \&CORE::open might appear to produce." |
| pstickne | can't you just no strict and &{"foo"}? |
| revdiablo | If you want to execute arbitrary code, use eval. If you want to set a variable to refer to a piece of code later, use coderefs. |
| Jmax- | yes, &$foo should work, but i dunno if it works on open for example |
| guest1234 | apparently doesnt |
| pstickne | hmm |
| revdiablo | It doesn't work on builtins AFAIK |
| guest1234 | i tried $foo = 'readpipe'; $foo->(@arg); doesnt work |
| pstickne | trying random... wait ;) |
| revdiablo | A lot of builtins use special-case call syntax anyway |
| pstickne | you could use the indirect notation I suppose... |
| guest1234 | which is..? |
| revdiablo | guest1234: Not "standard" syntax |
| guest1234 | could you give an example of special-case call syntax please? |
| Jmax- | eval: $foo = 'print'; &$foo('dong1', 'dong2'); |
| buubot | Jmax-: Error: Undefined subroutine &main::print called at eval line 1. |
| revdiablo | print { $filehandles{foo} } "bar"; |
| guest1234 | hmm |
| revdiablo | sort byvalue keys %hash; That's a special case that bites people from time to time The 'sort SUBNAME LIST' form |
| guest1234 | so referring built-in subs using a symbolic ref is not possible? |
| revdiablo | That is correct |
| guest1234 | hmm |
| revdiablo | Why do you keep asking repeatedly? |
| guest1234 | i just wanted to make sure if its possible or not i thought if its not possible, ill stop banging my head :/ sorry for the persistence just wasnt sure what the general consensus was here |
| pstickne | I don't think I'll ever completely understand Perl :( |
| sili | if you told us what the problem, we might be able to give you a solution |
| revdiablo | guest1234: No worries. Just remember that it's not really necessary either |
| sili | it's not impossible to reach a builtin with its name in a string |
| guest1234 | its not? |
| revdiablo | eval |
| sili | we already said: eval |
| simcop2387 | eval: $foo = \&CORE::print; {$foo}("Testing"); |