* Aristotle Pagaltzis <pagalt...@gmx.de> [2009-01-02 23:00]:
> That way, you get this combination:
>
>     sub pid_file_handler ( $filename ) {
>         # ... top half ...
>         yield;
>         # ... bottom half ...
>     }
>
>     sub init_server {
>         # ...
>         my $write_pid = pid_file_handler( $options<pid_file> );
>         become_daemon();
>         $write_pid();
>         # ...
>     }

It turns out that is exactly how generators work in
Javascript 1.7:
https://developer.mozilla.org/en/New_in_JavaScript_1.7

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

Reply via email to