<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1013103" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1013103</link>
    <description></description>
    <language>en</language>
          <item>
    <title>Thanks</title>
    <link>https://www.webmaster-forums.net/serverside-scripting/writing-file#comment-1076022</link>
    <description> &lt;p&gt;Thanks Moc, it seems easier than I thought. I usually learn well from templates like that(learned C that way), so I can probably actually write programs now &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Sun, 24 Dec 2000 01:31:38 +0000</pubDate>
 <dc:creator>KoRnholio</dc:creator>
 <guid isPermaLink="false">comment 1076022 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/writing-file#comment-1076017</link>
    <description> &lt;p&gt;thanks for the information japhy.&lt;/p&gt;
 </description>
     <pubDate>Sat, 23 Dec 2000 22:47:11 +0000</pubDate>
 <dc:creator>Moc</dc:creator>
 <guid isPermaLink="false">comment 1076017 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Buffering</title>
    <link>https://www.webmaster-forums.net/serverside-scripting/writing-file#comment-1076015</link>
    <description> &lt;p&gt;When you &lt;strong&gt;close()&lt;/strong&gt; a filehandle, its output buffer is flushed, and anything you&#039;ve &lt;strong&gt;print()&lt;/strong&gt;ed to the filehandle and hasn&#039;t yet been stored in the file is stored.  &lt;strong&gt;close()&lt;/strong&gt;ing a filehandle also kills any file locks on it, since the filehandle can&#039;t be locked if it&#039;s not around.&lt;/p&gt;
&lt;p&gt;Calling &lt;strong&gt;flock(FH,&lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/nerdy.png&quot; title=&quot;Cool&quot; alt=&quot;Cool&quot; class=&quot;smiley-content&quot; /&gt;&lt;/strong&gt; before &lt;strong&gt;close(FH)&lt;/strong&gt; thus allows something to modify the file IN BETWEEN THE TWO operations, and may end up messing up all the work you&#039;ve done, since not everything you&#039;ve asked to print to the file is necessarily there.&lt;/p&gt;
 </description>
     <pubDate>Sat, 23 Dec 2000 21:07:11 +0000</pubDate>
 <dc:creator>japhy</dc:creator>
 <guid isPermaLink="false">comment 1076015 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Re: No book required</title>
    <link>https://www.webmaster-forums.net/serverside-scripting/writing-file#comment-1076007</link>
    <description> &lt;p&gt;Please explain.&lt;/p&gt;
&lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote: &lt;em&gt;Originally posted by japhy &lt;/em&gt;&lt;br /&gt;
&lt;strong&gt;And Moc, it&#039;s highly advisable to NOT call [b]flock(FH,&lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/nerdy.png&quot; title=&quot;Cool&quot; alt=&quot;Cool&quot; class=&quot;smiley-content&quot; /&gt;&lt;/strong&gt;, and to let the file lock on it disappear once the filehandle is closed. [/B]&lt;/p&gt;&lt;/blockquote&gt;
 </description>
     <pubDate>Sat, 23 Dec 2000 18:41:31 +0000</pubDate>
 <dc:creator>Moc</dc:creator>
 <guid isPermaLink="false">comment 1076007 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>No book required</title>
    <link>https://www.webmaster-forums.net/serverside-scripting/writing-file#comment-1076001</link>
    <description> &lt;p&gt;You don&#039;t need to buy a book to tell you how to use Perl&#039;s functions -- read the documentation that comes with Perl, available via the &lt;strong&gt;perldoc&lt;/strong&gt; program, or online at &lt;a href=&quot;http://www.perldoc.com/&quot; class=&quot;bb-url&quot;&gt;http://www.perldoc.com/&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;And Moc, it&#039;s highly advisable to NOT call &lt;strong&gt;flock(FH,&lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/nerdy.png&quot; title=&quot;Cool&quot; alt=&quot;Cool&quot; class=&quot;smiley-content&quot; /&gt;&lt;/strong&gt;, and to let the file lock on it disappear once the filehandle is closed.&lt;/p&gt;
 </description>
     <pubDate>Sat, 23 Dec 2000 14:08:44 +0000</pubDate>
 <dc:creator>japhy</dc:creator>
 <guid isPermaLink="false">comment 1076001 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/writing-file#comment-1075994</link>
    <description> &lt;p&gt;I think this is what you are asking so here goes.  You need to have some routine read in the information passed by your form.  &lt;/p&gt;
&lt;p&gt;Which then you do the following :&lt;/p&gt;
&lt;p&gt;# notice that the formdata is hash that is from the routine&lt;br /&gt;
# which parses the information submitted in the form.&lt;/p&gt;
&lt;p&gt;$stuff = $formdata{&#039;stuff&#039;};&lt;/p&gt;
&lt;p&gt;# This opens blah.txt and writes to the file, this&lt;br /&gt;
# overwrites the file if it has anything.  If you don&#039;t want&lt;br /&gt;
# to overwrite the file and simply just append to the file&lt;br /&gt;
# use &amp;gt;&amp;gt; instead of the &amp;gt; below&lt;/p&gt;
&lt;p&gt;open(LOG, &quot;&amp;gt;/www/kain/blah.txt&quot;);&lt;br /&gt;
		flock(LOG, 2);&lt;br /&gt;
		print LOG &quot;$stuff\n&quot;;&lt;br /&gt;
		flock(LOG, 8);&lt;br /&gt;
close(LOG);&lt;/p&gt;
 </description>
     <pubDate>Sat, 23 Dec 2000 08:14:12 +0000</pubDate>
 <dc:creator>Moc</dc:creator>
 <guid isPermaLink="false">comment 1075994 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
