<?xml version="1.0" encoding="windows-1252"?>
<node id="108085" title="Re: avoiding newlines when using system calls." created="2001-08-27 09:42:50" updated="2005-07-19 14:08:39">
<type id="11">
note</type>
<author id="21732">
BooK</author>
<data>
<field name="doctext">
&lt;p&gt;If you want to follow [blakem] advice and use the
POSIX module, here is how to do it.
There is no newline here, plus you don't fork an external process just to fetch the date.&lt;/p&gt;
&lt;code&gt;use POSIX qw/ strftime /;           # standard module
$today = strftime("%D", localtime); # localtime in list context
&lt;/code&gt;
&lt;p&gt;You could even do it this other way, but be careful with
embedded %-sign in your variables. That might bite you.&lt;/p&gt;
&lt;code&gt;use POSIX qw/ strftime /;
open  trf, "&gt;/tmp/.$handle";
print trf strftime("$handle|$crpw|$first_name|$last_name|$email_addy|0|%D", localtime);
close trf;&lt;/code&gt;</field>
<field name="root_node">
108073</field>
<field name="parent_node">
108073</field>
</data>
</node>
