in reply to "eval"ing a hash without eval
In trying to run some code with taint checking, I found the following snippet:How about if you add:local $/; my %conf = eval <CONF>;Needless to say, that fails in taint mode.
This snippet, for example, seems to work as expected:use IO::Handle; CONF->untaint;
#!/usr/bin/perl -Tw use strict; use IO::Handle; use Data::Dumper; open(CONF,"< t41.conf") or die "couldn't open conf: $!\n"; CONF->untaint; my %conf; { local $/; undef $/; %conf = eval <CONF>; } print Dumper \%conf;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: "eval"ing a hash without eval
by Ovid (Cardinal) on Dec 29, 2005 at 04:19 UTC |