… | |
… | |
2095 | C<PERL_ANYEVENT_STRICT=1> in your environment while developing programs |
2095 | C<PERL_ANYEVENT_STRICT=1> in your environment while developing programs |
2096 | can be very useful, however. |
2096 | can be very useful, however. |
2097 | |
2097 | |
2098 | =item C<PERL_ANYEVENT_DEBUG_SHELL> |
2098 | =item C<PERL_ANYEVENT_DEBUG_SHELL> |
2099 | |
2099 | |
2100 | If this env variable is set, then its contents will be interpreted by |
2100 | If this env variable is nonempty, then its contents will be interpreted by |
2101 | C<AnyEvent::Socket::parse_hostport> (after replacing every occurance of |
2101 | C<AnyEvent::Socket::parse_hostport> and C<AnyEvent::Debug::shell> (after |
2102 | C<$$> by the process pid) and an C<AnyEvent::Debug::shell> is bound on |
2102 | replacing every occurance of C<$$> by the process pid). The shell object |
2103 | that port. The shell object is saved in C<$AnyEvent::Debug::SHELL>. |
2103 | is saved in C<$AnyEvent::Debug::SHELL>. |
2104 | |
2104 | |
2105 | This happens when the first watcher is created. |
2105 | This happens when the first watcher is created. |
2106 | |
2106 | |
2107 | For example, to bind a debug shell on a unix domain socket in |
2107 | For example, to bind a debug shell on a unix domain socket in |
2108 | F<< /tmp/debug<pid>.sock >>, you could use this: |
2108 | F<< /tmp/debug<pid>.sock >>, you could use this: |
2109 | |
2109 | |
2110 | PERL_ANYEVENT_DEBUG_SHELL=/tmp/debug\$\$.sock perlprog |
2110 | PERL_ANYEVENT_DEBUG_SHELL=/tmp/debug\$\$.sock perlprog |
|
|
2111 | # connect with e.g.: socat readline /tmp/debug123.sock |
2111 | |
2112 | |
|
|
2113 | Or to bind to tcp port 4545 on localhost: |
|
|
2114 | |
|
|
2115 | PERL_ANYEVENT_DEBUG_SHELL=127.0.0.1:4545 perlprog |
|
|
2116 | # connect with e.g.: telnet localhost 4545 |
|
|
2117 | |
2112 | Note that creating sockets in F</tmp> is very unsafe on multiuser |
2118 | Note that creating sockets in F</tmp> or on localhost is very unsafe on |
2113 | systems. |
2119 | multiuser systems. |
2114 | |
2120 | |
2115 | =item C<PERL_ANYEVENT_DEBUG_WRAP> |
2121 | =item C<PERL_ANYEVENT_DEBUG_WRAP> |
2116 | |
2122 | |
2117 | Can be set to C<0>, C<1> or C<2> and enables wrapping of all watchers for |
2123 | Can be set to C<0>, C<1> or C<2> and enables wrapping of all watchers for |
2118 | debugging purposes. See C<AnyEvent::Debug::wrap> for details. |
2124 | debugging purposes. See C<AnyEvent::Debug::wrap> for details. |