mtrasp has asked for the wisdom of the Perl Monks concerning the following question:
Iam working on below script .In the script langfile.txt is not creating and what is happening in for loop .i am not understanding for loop part especially $tmp =~ s/^\s+//; and $tmp =~ s/ \s+$//;please tell me how can i understand this part.
$query = "pr_SelectLanguages $Number, $operatingsystem"; @results = `osql -U$DB_USERNAME -P$DB_PASSWORD -S$DB_SERVER -Q\"$q +uery\"`; $langlist1 = ""; open(dest,">langfile.txt") or writelog(logdie,"can't open langfile +.txt for writing"); for ($i=2; $i<$#results-1; $i++) { $tmp=@results[$i]; $mytmp=@results; $tmp =~ s/ //; print "$tmp"; print dest $tmp; $tmp =~ s/^\s+//; $tmp =~ s/ \s+$//; chomp($tmp); $langlist1 = $langlist1 . uc $tmp . " "; $langs=$mytmp; } $langlist1 =~ s/\s*$//; close(dest);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File is not creating to see the Result
by moritz (Cardinal) on Mar 09, 2010 at 22:34 UTC | |
|
Re: File is not creating to see the Result
by pemungkah (Priest) on Mar 09, 2010 at 22:56 UTC | |
by mtrasp (Acolyte) on Mar 10, 2010 at 06:52 UTC | |
by Anonymous Monk on Mar 10, 2010 at 13:51 UTC | |
by mtrasp (Acolyte) on Mar 12, 2010 at 23:26 UTC | |
by mtrasp (Acolyte) on Mar 12, 2010 at 23:27 UTC |