in the below code which ever is present first push or print is working,the second line is not coming into picture,is there a way I can push to array and print to a file at the same time?
open(my $FOLDERS, '+>', "dirs.log") or die $!; find(sub { push @folders, "$_" if -d $File::Find::name && !$seen{$_}++ +; print $FOLDERS "$_\n" if -d $File::Find::name && !$seen{$_}++; }, $cwd +);
In reply to How to push and print at the same time? by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |