http://www.perlmonks.org?node_id=1026597


in reply to Re: deleting a file in perl
in thread deleting a file in perl

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^3: deleting a file in perl
by 2teez (Vicar) on Apr 02, 2013 at 07:28 UTC

    keralaqueen234,
    The script shown in my previous post, should work.
    Usage: perl delete_log.pl <directory_name>
    Where delete_log.pl is your Perl script, directory_name the directory you which to go through, checking which file to delete, after you have been shown the name of the file, if you want to delete the file you answer y, if not just press ENTER.

    If you tell me, I'll forget.
    If you show me, I'll remember.
    if you involve me, I'll understand.
    --- Author unknown to me

      yes that works .. but in my folder xyz , i have files with names currentlog.log,currentlog123.log,currentlog233.log,detail.txt,see.txt .... i need to delete only the files which has the name pattern of 'currentlog'. other files including currentlog.log need to be retained.how do i find the patern of filenames ?