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);
In reply to File is not creating to see the Result by mtrasp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |