in reply to Re: Creating table from file lists
in thread Creating table from file lists
I re-kid you, Almut: eval, untainted, unrestricted??
Could you do a quick replace of <DATA> with <>, with piped input from find for me, and then permit me a run of a single perl -e. Just before you execute your script?
:>>
(ok, it's _DATA_ and thus controlled, but it still hurts on reading. And worse, that one is pure evil to both speakers of Perl and non-speakers alike)
Update: to restrict the hurt to mere aesthtics, consider this safer version of the input loop, which will also survive pasted arbitrary absolute pathes from DATA/or a switch from DATA to STDIN.
my @f=(); # PJ while (<DATA>) { chomp; s|([^/]+)|do{$f[$#f+1]=$1,'$f['.$#f.']'}|ge; # PJ s|^/|\$h->{|; s|/|}{|g; s|$|} = 1;|; # PJ #print; print "\n"; eval; }
food for thought
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Creating table from file lists
by almut (Canon) on Oct 05, 2009 at 22:17 UTC | |
by jakobi (Pilgrim) on Oct 05, 2009 at 23:02 UTC |