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

Re: Printing a backspace?

2007-07-22 Thread Chas Owens
On 7/22/07, yitzle <[EMAIL PROTECTED]> wrote: On 7/22/07, Dr.Ruud <[EMAIL PROTECTED]> wrote: > yitzle schreef: > > nobody: > > >> For Bonsai kittens, put them in glass jars and feed them well.^U > > > > Works nice! Thanks! Why don't I see anything about kittens (except in the reply)? I believe

Re: comparing two values in a column and then do arithmetic

2007-07-22 Thread Rob Dixon
venkateshwar wrote: I have a large set of values like this in two different columns,both the values are variables.. I need to check if first value(ValA) is same in any of the consecutive values and then find the difference between valB of those two matched valA! and the next instant the differe

Re: comparing two values in a column and then do arithmetic

2007-07-22 Thread Jeff Pang
--- venkateshwar <[EMAIL PROTECTED]> wrote: > Hi, > > I have a large set of values like this in two > different columns,both > the values are variables.. > > > I need to check if first value(ValA) is same in any > of the > consecutive > values and then find the difference between valB of > tho

comparing two values in a column and then do arithmetic

2007-07-22 Thread venkateshwar
Hi, I have a large set of values like this in two different columns,both the values are variables.. I need to check if first value(ValA) is same in any of the consecutive values and then find the difference between valB of those two matched valA! and the next instant the difference should be bet

Re: Printing a backspace?

2007-07-22 Thread yitzle
On 7/22/07, Dr.Ruud <[EMAIL PROTECTED]> wrote: yitzle schreef: > nobody: >> For Bonsai kittens, put them in glass jars and feed them well.^U > > Works nice! Thanks! Why don't I see anything about kittens (except in the reply)? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comman

Re: Query

2007-07-22 Thread yaron
You can always choose to walk the kings road: use Filesys::DiskSpace; ($fs_type, $fs_desc, $used, $avail, $fused, $favail) = df $dir; $total = $used + $avail; print "Total:$total\nUsed:$used\ n"; Yaron Kahanovitch - Original Message - From: "kapil.V" <[EMAIL PROTECTED]> To: beginners@

Re: Printing a backspace?

2007-07-22 Thread Chas Owens
On 7/22/07, Dr.Ruud <[EMAIL PROTECTED]> wrote: yitzle schreef: > nobody: >> For Bonsai kittens, put them in glass jars and feed them well.^U > > Works nice! Thanks! Wow! snip At least it was a bottom post. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PR

Re: Printing a backspace?

2007-07-22 Thread Dr.Ruud
yitzle schreef: > nobody: >> For Bonsai kittens, put them in glass jars and feed them well.^U > > Works nice! Thanks! Wow! -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Parsing large XML file - Revisited

2007-07-22 Thread Dr.Ruud
"Mike Blezien" schreef: > my $article_number = $elt->first_child_text('article_number'); > my $dist_number= $elt->first_child_text('distributor_number'); > my $dist_name = $elt->first_child_text('distributor_name'); > my $artist = $elt->first_child_text('artist'); > my $