<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2802" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=909170519-27072006><FONT face="Palatino Linotype" color=#0000ff
size=2>Igor,</FONT></SPAN></DIV>
<DIV><SPAN class=909170519-27072006> <FONT
face="Palatino Linotype" color=#0000ff size=2>Seu comando deu certo ....
</FONT></SPAN></DIV>
<DIV><SPAN class=909170519-27072006></SPAN> </DIV>
<DIV> </DIV>
<P><FONT face=Wingdings color=#000080 size=2>b</FONT><FONT
face="Palatino Linotype" color=#000080 size=2>Paola Montini</FONT> <BR><FONT
face="Palatino Linotype" color=#000080 size=2>YMF-Consultoria</FONT> <BR><FONT
face="Palatino Linotype" color=#000080 size=2>Fone: 5010-9220</FONT> </P>
<BLOCKQUOTE>
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Mensagem original-----<BR><B>De:</B>
cascavel-pm-bounces+pmontini=ymf.com.br@pm.org
[mailto:cascavel-pm-bounces+pmontini=ymf.com.br@pm.org]<B>Em nome de </B>Igor
Sutton<BR><B>Enviada em:</B> quinta-feira, 27 de julho de 2006
15:43<BR><B>Para:</B> Cascavel Perl Mongers<BR><B>Assunto:</B> Re:
[Cascavel-pm]RES: RES: RES: RES: RES: RES: Substituição de string e gravação
no arquivo<BR><BR></FONT></DIV>Esperamos que isto se reverta em contribuição
sua para a comunidade :-)<BR><BR>E seja bem vinda!<BR><BR>PS: O que é 'CM',
que você mencionou antes?<BR><BR>
<DIV><SPAN class=gmail_quote>Em 27/07/06, <B class=gmail_sendername>Paola
Montini</B> <<A
href="mailto:PMontini@ymf.com.br">PMontini@ymf.com.br</A>> escreveu:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>
<DIV>
<DIV><SPAN><FONT face="Palatino Linotype" color=#0000ff
size=2>ótimo.....</FONT></SPAN></DIV>
<DIV><SPAN><FONT face="Palatino Linotype" color=#0000ff size=2>Nossa vcs não
sabem como estão me ajudando ...... estão quebrando o maior
galho......</FONT></SPAN></DIV></DIV>
<DIV><SPAN class=q>
<DIV> </DIV>
<P><FONT face=Wingdings color=#000080 size=2>b</FONT><FONT
face="Palatino Linotype" color=#000080 size=2>Paola Montini</FONT> <BR><FONT
face="Palatino Linotype" color=#000080 size=2>YMF-Consultoria</FONT>
<BR><FONT face="Palatino Linotype" color=#000080 size=2>Fone:
5010-9220</FONT> </P></SPAN></DIV>
<DIV>
<BLOCKQUOTE>
<DIV dir=ltr align=left><FONT face=Tahoma size=2></FONT></DIV><FONT
face=Tahoma size=2></FONT>
<DIV><SPAN class=q><FONT face=Tahoma size=2>-----Mensagem
original-----<BR><B>De:</B> cascavel-pm-bounces+pmontini=<A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:ymf.com.br@pm.org" target=_blank>ymf.com.br@pm.org</A>
[mailto:<A onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:cascavel-pm-bounces+pmontini=ymf.com.br@pm.org"
target=_blank>cascavel-pm-bounces+pmontini=ymf.com.br@pm.org</A>]<B>Em
nome de </B>Igor Sutton<BR></FONT></SPAN></DIV>
<DIV><FONT face=Tahoma size=2><B>Enviada em:</B> quinta-feira, 27 de julho
de 2006 15:39<BR><B>Para:</B> Cascavel Perl Mongers<BR><B>Assunto:</B> Re:
[Cascavel-pm]RES: RES: RES: RES: RES: Substituição de string e gravação no
arquivo<BR><BR></FONT></DIV></BLOCKQUOTE></DIV>
<DIV><SPAN class=e id=q_10cb14aef89e74e8_5>Como assim 'não vai poder passar
o nome do arquivo'? Ele é sempre o mesmo? Se é sempre o mesmo, faça
assim:<BR><BR><code><BR>#!/usr/bin/perl<BR><BR>$^I = ".bak";<BR>@ARGV
= ("/meu/arquivo/input.xml"); <BR>while (<>)
{<BR> s/SNAPSHOT/1.1/;<BR>}<BR></code><BR><BR>
<DIV><SPAN class=gmail_quote>Em 27/07/06, <B class=gmail_sendername>Paola
Montini</B> <<A onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:PMontini@ymf.com.br" target=_blank>PMontini@ymf.com.br </A>>
escreveu:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>
<DIV>
<DIV><SPAN><FONT face="Palatino Linotype" color=#0000ff size=2>Igor agora
funcionou certinho......mas eu não vou poder passar o nome do arquivo
na linha de chamada do script.....</FONT></SPAN></DIV>
<DIV><SPAN><FONT face="Palatino Linotype" color=#0000ff size=2>como
fazer??<BR>PS: As perguntas podem ser ignorantes.... desculpem-me, mas sou
analista de CM e estou tendo que fazer esses
scripts...</FONT></SPAN></DIV>
<DIV><SPAN><FONT face="Palatino Linotype" color=#0000ff size=2>é a
primeira vez que trabablho com perl</FONT></SPAN></DIV></DIV>
<DIV><SPAN>
<DIV><SPAN></SPAN> </DIV>
<DIV> </DIV>
<P><FONT face=Wingdings color=#000080 size=2>b</FONT><FONT
face="Palatino Linotype" color=#000080 size=2>Paola Montini</FONT>
<BR><FONT face="Palatino Linotype" color=#000080
size=2>YMF-Consultoria</FONT> <BR><FONT face="Palatino Linotype"
color=#000080 size=2>Fone: 5010-9220</FONT> </P></SPAN></DIV>
<DIV>
<BLOCKQUOTE>
<DIV dir=ltr align=left><FONT face=Tahoma size=2></FONT></DIV><FONT
face=Tahoma size=2></FONT>
<DIV><SPAN><FONT face=Tahoma size=2>-----Mensagem
original-----<BR><B>De:</B> cascavel-pm-bounces+pmontini=<A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:ymf.com.br@pm.org" target=_blank>ymf.com.br@pm.org</A>
[mailto:<A onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:cascavel-pm-bounces+pmontini=ymf.com.br@pm.org"
target=_blank>cascavel-pm-bounces+pmontini=ymf.com.br@pm.org</A>]<B>Em
nome de </B>Igor Sutton<BR></FONT></SPAN></DIV>
<DIV><FONT face=Tahoma size=2><B>Enviada em:</B> quinta-feira, 27 de
julho de 2006 14:43<BR><B>Para:</B> Cascavel Perl
Mongers<BR><B>Assunto:</B> Re: [Cascavel-pm]RES: RES: RES: RES:
Substituição de string e gravação no
arquivo<BR><BR></FONT></DIV></BLOCKQUOTE></DIV>
<DIV><SPAN>Como você executou o seu
programa?<BR><BR>input.xml:<BR><project><BR><release>1.1</release><BR><something/><BR></project><BR><BR>teste.pl:<BR>#!/usr/bin/perl<BR><BR>$^I
= ".bak";<BR><BR>while(<>)
{<BR>
s/SNAPSHOT/1.1/;<BR>
print;<BR>}<BR><BR>como executar:<BR><BR>$ perl teste.pl
input.xml<BR><BR>saída:<BR><BR>$ ls input.xml*<BR>input.xml
input.xml.bak<BR>$ cat input.xml<BR><project>
<BR><release>1.1</release><BR><something/><BR></project><BR><BR>
<DIV><SPAN class=gmail_quote>Em 27/07/06, <B class=gmail_sendername>Paola
Montini</B> <<A onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:PMontini@ymf.com.br" target=_blank>PMontini@ymf.com.br
</A>> escreveu:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>
<DIV>
<DIV><SPAN><FONT face="Palatino Linotype" color=#0000ff size=2>Desculpe
Igor, mas a sua solução não está funcionando nessa
linha</FONT></SPAN></DIV>
<DIV><SPAN> s/SNAPSHOT/1.1/ if /SNAPSHOT/;.</SPAN></DIV>
<DIV><SPAN></SPAN> </DIV>
<DIV><SPAN><FONT face="Palatino Linotype" color=#0000ff
size=2>Att</FONT></SPAN></DIV></DIV>
<DIV><SPAN>
<DIV> </DIV>
<P><FONT face=Wingdings color=#000080 size=2>b</FONT><FONT
face="Palatino Linotype" color=#000080 size=2>Paola Montini</FONT>
<BR><FONT face="Palatino Linotype" color=#000080
size=2>YMF-Consultoria</FONT> <BR><FONT face="Palatino Linotype"
color=#000080 size=2>Fone: 5010-9220</FONT> </P></SPAN></DIV>
<DIV>
<BLOCKQUOTE>
<DIV dir=ltr align=left><FONT face=Tahoma size=2>-----Mensagem
original-----<BR><B>De:</B> cascavel-pm-bounces+pmontini=<A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:ymf.com.br@pm.org" target=_blank>ymf.com.br@pm.org</A>
[mailto:<A onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:cascavel-pm-bounces+pmontini=ymf.com.br@pm.org"
target=_blank>cascavel-pm-bounces+pmontini=ymf.com.br@pm.org</A>]<B>Em
nome de </B>Igor Sutton<BR><B>Enviada em:</B> quinta-feira, 27 de
julho de 2006 14:05<BR><B>Para:</B> Cascavel Perl
Mongers<BR><B>Assunto:</B> Re: [Cascavel-pm]RES: RES: RES:
Substituição de string e gravação no
arquivo<BR><BR></FONT></DIV></BLOCKQUOTE></DIV>
<DIV><SPAN>No exemplo que o Nelson postou ( e no meu também ) isso não
acontece. Dê uma olhada, pois o que você precisa está lá.<BR><BR>
<DIV><SPAN class=gmail_quote>Em 27/07/06, <B
class=gmail_sendername>Paola Montini</B> <<A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:PMontini@ymf.com.br" target=_blank>
PMontini@ymf.com.br</A>> escreveu:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">Meleca
falei rápido demais....<BR>o que esta acontecendo é que ele está
colocando uma linha a mais no meu arquivo vejam:
<BR><BR><projeto>Amplis
</projeto><BR><artefato>ymf-utils</artefato><BR><versao>SNAPSHOT</versao><BR><versao>Beta2006.1.2</versao><BR><BR><BR>#!/usr/bin/perl<BR>$local
=" arquivoxml.xml";<BR>open(ARQXML,"+<$local");<BR>@texto =
<ARQXML>;<BR>$nome = SNAPSHOT;<BR>foreach $matriz
(@texto)<BR> {<BR> if ($matriz =~
/$nome/)<BR> {<BR>
$matriz =~ s/$nome/Beta2006.1.2/g;
<BR> print ARQXML
$matriz
;<BR> }<BR>}<BR><BR><BR><BR>*Paola
Montini<BR>YMF-Consultoria<BR>Fone: 5010-9220<BR><BR><BR>-----Mensagem
original-----<BR>De: cascavel-pm-bounces+pmontini=<A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:ymf.com.br@pm.org" target=_blank>
ymf.com.br@pm.org</A><BR>[mailto:<A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:cascavel-pm-bounces+pmontini=ymf.com.br@pm.org"
target=_blank> cascavel-pm-bounces+pmontini=ymf.com.br@pm.org </A>]Em
nome de Paola<BR>Montini<BR>Enviada em: quinta-feira, 27 de julho de
2006 13:59 <BR>Para: Cascavel Perl Mongers<BR>Assunto: [Cascavel-pm]
RES: RES: Substituição de string e gravação no<BR>arquivo<BR><BR><BR>é
isso nilson, o erro era esse<BR><BR>*Paola
Montini<BR>YMF-Consultoria<BR>Fone: 5010-9220<BR><BR><BR>-----Mensagem
original-----<BR>De: cascavel-pm-bounces+pmontini=<A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:ymf.com.br@pm.org"
target=_blank>ymf.com.br@pm.org</A><BR>[mailto:<A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:cascavel-pm-bounces+pmontini=ymf.com.br@pm.org"
target=_blank> cascavel-pm-bounces+pmontini=ymf.com.br@pm.org </A>]Em
nome de Nilson<BR>Santos Figueiredo Junior<BR>Enviada em:
quinta-feira, 27 de julho de 2006 13:55<BR>Para: Cascavel Perl
Mongers<BR>Assunto: Re: [Cascavel-pm]RES: Substituição de string e
gravação no<BR>arquivo<BR><BR><BR>On 7/27/06, Paola Montini <<A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:PMontini@ymf.com.br"
target=_blank>PMontini@ymf.com.br</A>> wrote:<BR>> Missing right
curly or square bracket at testexml.pl line 15, at end of line<BR>>
syntax error at testexml.pl line 15, at EOF<BR><BR>Você tentou olhar
se existe algum erro próximo ao final da linha 15 do<BR>arquivo
testexml.pl, aonde está faltando uma chave ou colchete
de<BR>fechamento?<BR><BR>-Nilson Santos F.
Jr.<BR>_______________________________________________ <BR>Cascavel-pm
mailing list<BR><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:Cascavel-pm@pm.org"
target=_blank>Cascavel-pm@pm.org</A><BR><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="http://mail.pm.org/mailman/listinfo/cascavel-pm"
target=_blank>http://mail.pm.org/mailman/listinfo/cascavel-pm</A><BR>_______________________________________________
<BR>Cascavel-pm mailing list<BR><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:Cascavel-pm@pm.org"
target=_blank>Cascavel-pm@pm.org</A><BR><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="http://mail.pm.org/mailman/listinfo/cascavel-pm"
target=_blank>http://mail.pm.org/mailman/listinfo/cascavel-pm</A><BR>_______________________________________________
<BR>Cascavel-pm mailing list<BR><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:Cascavel-pm@pm.org"
target=_blank>Cascavel-pm@pm.org</A><BR><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="http://mail.pm.org/mailman/listinfo/cascavel-pm"
target=_blank>http://mail.pm.org/mailman/listinfo/cascavel-pm</A><BR></BLOCKQUOTE></DIV><BR><BR
clear=all><BR>-- <BR>Igor Sutton Lopes<BR>t: +55 51 9627.0779<BR>e: <A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:igor.sutton@gmail.com"
target=_blank>igor.sutton@gmail.com</A> </SPAN></DIV>
<DIV></DIV></DIV><BR>_______________________________________________<BR>Cascavel-pm
mailing list<BR><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:Cascavel-pm@pm.org"
target=_blank>Cascavel-pm@pm.org</A><BR><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="http://mail.pm.org/mailman/listinfo/cascavel-pm"
target=_blank>http://mail.pm.org/mailman/listinfo/cascavel-pm</A><BR><BR></BLOCKQUOTE></DIV><BR><BR
clear=all><BR>-- <BR>Igor Sutton Lopes<BR>t: +55 51 9627.0779<BR>e: <A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:igor.sutton@gmail.com"
target=_blank>igor.sutton@gmail.com</A> </SPAN></DIV>
<DIV></DIV></DIV><BR>_______________________________________________<BR>Cascavel-pm
mailing list<BR><A onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:Cascavel-pm@pm.org"
target=_blank>Cascavel-pm@pm.org</A><BR><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="http://mail.pm.org/mailman/listinfo/cascavel-pm"
target=_blank>http://mail.pm.org/mailman/listinfo/cascavel-pm</A><BR><BR></BLOCKQUOTE></DIV><BR><BR
clear=all><BR>-- <BR>Igor Sutton Lopes<BR>t: +55 51 9627.0779<BR>e: <A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:igor.sutton@gmail.com" target=_blank>igor.sutton@gmail.com</A>
</SPAN></DIV>
<DIV></DIV></DIV><BR>_______________________________________________<BR>Cascavel-pm
mailing list<BR><A onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:Cascavel-pm@pm.org">Cascavel-pm@pm.org</A><BR><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="http://mail.pm.org/mailman/listinfo/cascavel-pm"
target=_blank>http://mail.pm.org/mailman/listinfo/cascavel-pm</A><BR><BR></BLOCKQUOTE></DIV><BR><BR
clear=all><BR>-- <BR>Igor Sutton Lopes<BR>t: +55 51 9627.0779<BR>e: <A
href="mailto:igor.sutton@gmail.com">igor.sutton@gmail.com</A>
</BLOCKQUOTE></BODY></HTML>