On Wed Dec 24 12:20:34 2008, JPIERCE wrote:
Show quoted text> All of
> while( taint(my $lie = <STDIN>) ){
> while( untaint(my $lie = <STDIN>) ){
> while( taint($lie = <STDIN>) ){
> while( untaint($lie = <STDIN>) ){
>
> cause a script to die without any message once that line is reached,
> on at least 5.8.4 and 5.8.8
It works for me on 5.8.8:
$ echo foo | perl -MTaint::Util -le 'print $]; while( taint(my $lie =
<STDIN>) ){ print $lie }'
5.008008
That is it doesn't die. However taint() and untaint() don't return the
value they touch (they're like chomp in that regard) so you can't use
them in a while() loop like that. It's a low-level interface so you
should instead do something like:
while (<STDIN>) {