redirect function to /dev/null
Anonymous Monk
created: 2006-03-03 00:22:17
if i call system(test.pl)>/dev/null from perl it redirects all execution of test.pl to null device.
is ther any way to redirect function call execuiton. what i mean is if i call
&func(), is it possible to redirect its execution to /dev/null. i dont want to ue system thats why i am in need of it .
Re: redirect function to /dev/null
created: 2006-03-03 00:58:40
{
   # Temporarily undefine STDOUT.
   local *STDOUT;
   func();
}
as in
sub func {
  print("2\n");
}


print("1\n");

{
   # Temporarily undefine STDOUT.
   local *STDOUT;
   func();
}

print("3\n");

perlmonks.org content © perlmonks.org and Anonymous Monk, ikegami

prlmnks.org © 2006 edmund von der burg (eccles & toad)

v 0.03