1/14 My perl foo is weak. What's a simple elegant way to write the content of
$result to the file $filename? Thanks!
\_ open(FILE,">$filename");print FILE $result;close FILE; -tom
\_ Added a $ in the right spot
\_ Depending on what you're doing: perl's print default to STDOUT, so
you can also just print $result; and then run your script from the
command line as: foo.pl > file. When doing the open() you also
probably want to test that the open succeeded. You may not have
perms on the file, you may have typod the path, etc.
\_ Dependin on how complex $result is you can also do shell escapes
in perl. I.e. system "echo $result >> $filename";
\_ Not exactly elegant when the real solution fits in about 1/2
again as many characters. |