Bareword found where operator expected at fluff.pl line 10, near ") threeYrExpiration" (Missing operator before threeYrExpiration?) Global symbol "$current_mth" requires explicit package name at fluff.p +l line 8. Global symbol "$last_day_current_mth" requires explicit package name a +t fluff.pl line 8. syntax error at fluff.pl line 10, near ") threeYrExpiration" Global symbol "$unlinkCountTotal" requires explicit package name at fl +uff.pl line 21. Global symbol "@deleted_files" requires explicit package name at fluff +.pl line 23. Global symbol "$task" requires explicit package name at fluff.pl line +24. Global symbol "$logger" requires explicit package name at fluff.pl lin +e 25. Global symbol "$logger" requires explicit package name at fluff.pl lin +e 27. Global symbol "$task" requires explicit package name at fluff.pl line +28. Execution of fluff.pl aborted due to compilation errors.
where I have named my script fluff.pl. This tells me this is not the code that is giving you trouble, particularly as one of the errors is a missing block ({}). If I can't replicate your issue, then I can't identify it. There is nothing obviously wrong with your logic. Please post code that compiles that recreates your issue; see How do I post a question effectively?.
As a helpful side comment, if your actual code works when you copy/paste threeYrExpiration into file_handler, maybe you should leave it in there and modify file_handler to look more like:
sub file_handler { my ($abs_filename) = @_; return unless $current_mth == 1; return unless $last_day_current_mth == 31; threeYrExpiration($abs_filename); } # End of sub file_handler
In reply to Re: Delete file from sub call within another sub
by kennethk
in thread Delete file from sub call within another sub
by begood321
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |