<?xml version="1.0" encoding="windows-1252"?>
<node id="1016019" title="Re: file listing within skript not working" created="2013-01-30 05:39:44" updated="2013-01-30 05:39:44">
<type id="11">
note</type>
<author id="616540">
moritz</author>
<data>
<field name="doctext">
There's no need to shell out to [man://ls] to get a list of files, you can simply say

&lt;code&gt;
my @files = glob "$datenDir/*.xml";
&lt;/code&gt;

&lt;p&gt;(assuming that &lt;c&gt;$datenDir&lt;/c&gt; doesn't contain whitespaces or other nasty stuff; but that would a problem with your approach too).

&lt;blockquote&gt;So why is the backtick-ls working with perl -e but not within a script? &lt;/blockquote&gt;

&lt;p&gt;I'm very sure it's not script vs. -e, but that there is some other difference. Is the directory the same in both cases? Is the script run as the same user, with the same security context (if you use selinux) as your one-liner?&lt;/p&gt;

&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-616540"&gt;
[http://perl6.org/|Perl 6 - the future is here, just unevenly distributed]
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
1016018</field>
<field name="parent_node">
1016018</field>
</data>
</node>
