Re: Changing case of the first letter of words in string

2003-08-22 Thread Gabriel Cooper
Bis wrote: I want to make the case of the first letter of all the words in a selected string to upper case. The code s/\b(\w+)/\u$1\E/g; enables me to do this for the whole document. But the string I want to match and operate on is all instances of text following the string SCTN: as in SCTN: N

Re: writing back to a file

2003-08-20 Thread Gabriel Cooper
try this: my $source_file = "searchandreplace.txt"; open(IN,"<$source_file") || die "can't open file: $1"; while() { $row = $_; $row =~ s/\s+\w+//i; push(@arr, $row); } close(IN); open(OUT,">$source_file" ) || die "can't open file: $1"; foreach (@arr) { print O

Re: the File::Copy module

2003-08-19 Thread Gabriel Cooper
Jeff Westman wrote: Try: use strict; use warnings; ... my $returnValue = "copy("machine1\\share\\file1","machine2\\share\\file2"); you probably don't want that first quotation mark before copy. unless ($returnValue) warn "Copy failed: $!"; you could do it in one step as:

Re: Display realtime data As it changes in the databse - TK

2003-08-19 Thread Gabriel Cooper
Ramprasad A Padmanabhan wrote: Voodoo Raja wrote: Sorry for not posting it in the first place. Will this sub.. chew memory if I run it a number of times.. or does it overwrite it. sub read { print "\nreading data"; $db = DBI->connect("DBI:mysql:$dbase:$hostname", $username, $password); as Ra