Re: can i change file content without using a temp file

2007-07-25 Thread cute
On 7 23 , 2 28 , [EMAIL PROTECTED] (John W. Krahn) wrote: > cute wrote: > > Now i create a temp file to store changed content. > > perldoc -q "How do I make a temporary file name" > > > is there a simple way to change file content without creating temp > > files? > > > ie: > > > while(<>) > > { >

Re: can i change file content without using a temp file

2007-07-23 Thread Mr. Shawn H. Corey
John W. Krahn wrote: Victor Tsang wrote: if you want to apply this regex to a single file, using the -i option (in place editing) might be the quickest way for you. ie. perl -pe "tr/[a-e]/[1-5]/g" -i $ perl -c -pe "tr/[a-e]/[1-5]/g" Bareword found where operator expected at -e line 1, near

Re: can i change file content without using a temp file

2007-07-23 Thread John W. Krahn
Victor Tsang wrote: if you want to apply this regex to a single file, using the -i option (in place editing) might be the quickest way for you. ie. perl -pe "tr/[a-e]/[1-5]/g" -i $ perl -c -pe "tr/[a-e]/[1-5]/g" Bareword found where operator expected at -e line 1, near "tr/[a-e]/[1-5]/g" syn

Re: can i change file content without using a temp file

2007-07-23 Thread Victor Tsang
if you want to apply this regex to a single file, using the -i option (in place editing) might be the quickest way for you. ie. perl -pe "tr/[a-e]/[1-5]/g" -i Tor. cute wrote: > Now i create a temp file to store changed content. > is there a simple way to change file content without creating

Re: can i change file content without using a temp file

2007-07-22 Thread Jeff Pang
--- cute <[EMAIL PROTECTED]> wrote: > Now i create a temp file to store changed content. > is there a simple way to change file content without > creating temp > files? > Surely Perl can. I always use one-line Perl to translate squid's access.log.Lines on access.log are something like this form

Re: can i change file content without using a temp file

2007-07-22 Thread John W. Krahn
cute wrote: Now i create a temp file to store changed content. perldoc -q "How do I make a temporary file name" is there a simple way to change file content without creating temp files? ie: while(<>) { tr/[a-e]/[1-5]/g Why are you changing all '[' to '[' and all ']' to ']'? There is n

Re: can i change file content without using a temp file

2007-07-22 Thread Chas Owens
On 7/23/07, Chas Owens <[EMAIL PROTECTED]> wrote: On 7/22/07, cute <[EMAIL PROTECTED]> wrote: > Now i create a temp file to store changed content. > is there a simple way to change file content without creating temp > files? > > ie: > > while(<>) > { > tr/[a-e]/[1-5]/g > print TEMP, $_ > } Y

Re: can i change file content without using a temp file

2007-07-22 Thread Chas Owens
On 7/22/07, cute <[EMAIL PROTECTED]> wrote: Now i create a temp file to store changed content. is there a simple way to change file content without creating temp files? ie: while(<>) { tr/[a-e]/[1-5]/g print TEMP, $_ } You can use inplace-editing. Either use -i on the #! line or fiddle w

can i change file content without using a temp file

2007-07-22 Thread cute
Now i create a temp file to store changed content. is there a simple way to change file content without creating temp files? ie: while(<>) { tr/[a-e]/[1-5]/g print TEMP, $_ } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.o