<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On 2007/04/08, at 14:30, KLEBER wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Caro Marco ,</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Agradeço sua atenção.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Em perl , é possível definir um numero de identificação de processo para uma</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">determinada rotina ?</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Se fôr possível<SPAN class="Apple-converted-space">  </SPAN>, ficaria simples fazer o que preciso.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Pôr exemplo (<SPAN class="Apple-converted-space">  </SPAN>pensando alto ) :</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">#</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "># Rotina de autorização de usuario</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">#</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Define pid com 250</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">testa se pid 250 está disponível</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Se não disponível =&gt; aguarda disponibilidade</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Se disponível =&gt; executa rotina</DIV></BLOCKQUOTE><BR></DIV><DIV>&lt;code&gt;</DIV><DIV>use strict;</DIV><DIV>use warnings;</DIV><DIV><BR></DIV><DIV>use File::Slurp;</DIV><DIV><BR></DIV><DIV># define o arquivo para output. a variavel $$ devolve o numero do processo</DIV><DIV># corrente.</DIV><DIV>my $output = qq{/tmp/output_$$.txt};</DIV><DIV><BR></DIV><DIV># monta a linha de comando para executar o programa cobol, passando todos os</DIV><DIV># argumentos necessarios.</DIV><DIV>my @command = ( '/usr/local/bin/my-cobol-program', '--output', $output );</DIV><DIV><BR></DIV><DIV># executa o comando definido anteriormente, e verificando se o resultado dele</DIV><DIV># foi correto. caso nao tenha sido, morre e informa o erro.</DIV><DIV>system(@command) == 0</DIV><DIV>  or die "system @command failed: $?";</DIV><DIV><BR></DIV><DIV># imprime na tela o resultado do arquivo.</DIV><DIV>print read_file($output);</DIV><DIV><BR></DIV><DIV>END {</DIV><DIV><BR></DIV><DIV>    # remove o arquivo de saida caso exista.</DIV><DIV>    unlink $output if -f $output;</DIV><DIV>}</DIV><DIV><BR><BR>&lt;/code&gt;</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Boa sorte!</DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Lucida Grande; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>--</DIV><DIV>Igor Sutton</DIV><DIV><A href="mailto:igor.sutton@gmail.com">igor.sutton@gmail.com</A></DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR class="Apple-interchange-newline"></SPAN> </DIV><BR></BODY></HTML>