| integral | Why don't you try using the actual reference. |
| Spaceknarf | hm wait let me see if I can get some simplified example code |
| rhalff | I can call an external function with $func(); or not ? s/external//g |
| Ani-_ | rhalff: no. func(); |
| rhalff | dynamic.. |
| Ani-_ | rhalff: the word 'dynamic' makes no sense in this context. |
| rhalff | the callback kind |
| integral | You have a subroutine reference in $func? Then you can use &{...}() and ...->(), the later being more favoured |
| rhalff | like call $variable_function(); integral: yeah the name of a subroutine |
| integral | perlbot, varvarname |
| perlbot | Why it's stupid to `use a variable as a variable name' - http://perl.plover.com/varvarname.html |
| integral | Don't do that dear, you'll hurt yourself. |
| Ani-_ | Perhaps you should explain what you really want to do... |
| integral | It's only a butter knife; stabbing myself with it won't hurt a bit! |
| rmah | integral: I could kill you with a butter knife. it would hurt a lot too. |
| rhalff | Ani-_: create an installer subroutine that excecutes the installer function based on the name of the installer, like call install_drupal() install_joomla() etc. |
| Ani-_ | rhalff: then use a hash table and use proper subroutine references. |
| rhalff | where drupal and joomla are in a variable like $type. Ani-_: what are proper subroutine references |
| Ani-_ | rhalff: as in: my %installers = (drupal => \&install_drupal, ...); if (exists $installers{$installer}) { $installers{installer}->(); } |
| integral | see perlref, perlreftut, perldsc, perllol, perldata, etc |
| rhalff | hmz if(exists $installer) { $installer=>(); } won't work ? if $installer = 'install_drupal' ? |
| Ani-_ | That is a bad idea. Do NOT do that. |
| Monie | I need help with parsing data from http://site.wii-battle.com/forums/viewonline.php I want my bot to get that then send to the channel whos online |
| alamar | when creating a socket using IO::Socket::INET and then adding the handle to and IO::Select object - what happens if the socket is being closed from the remote side? (is the handle automatically removed or is there some other way I can detect the closing?) |
| rhalff | hm ok |
| Ani-_ | alamar: it is not automatically removed. You ahve to remove it yourself. alamar: if you don't remove it then ->select(), ->can_raed(), ... will return instantly. |
| alamar | Ani-_: hm what's the best way to detect the close from the remote side? |
| Spaceknarf | I hate this my simplified version works as expected... |
| action | CPAN upload: sys-MON-Lite-0.02 by JNBROOKES |
| CPAN | upload: sys-MON-Lite-0.02 by JNBROOKES |
| action | CPAN upload: BBS-Perm-v0.0.2 by SUNNAVY |
| CPAN | upload: BBS-Perm-v0.0.2 by SUNNAVY |
| Ani-_ | alamar: What I do: I check if $socket->connected is false. If it is I remove it. In addition to that: if read/sysread returns 0 then I do a shutdown $some_socket, 0; # to tell the other side that I stopped readinig. |