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

new_monk has asked for the wisdom of the Perl Monks concerning the following question:

I too am new to Perl and could use some assistance. I have to telnet into a server and delete the following directory structure(e*Gate Intelligent Qs) under iq...


$usrid:/ep005/egate/client/iq>ls {2CE791F8-B956-11D7-8A47-D2047591D9E7} {E966E092-0086-11D7-AE05-ABCC42 +0F384C} {2D3A2FE4-B956-11D7-AA01-9928386F0C64} {E9684022-0086-11D7-AE05-B56CD2 +0DA8C8} {2EB061E0-B956-11D7-8FAD-A2B3FC810BD6} {E9699C1A-0086-11D7-AE05-DE7A18 +3014AC} {E9404D1A-0086-11D7-AE05-C74CFA34F9DD} {E96B2BC0-0086-11D7-AE05-B76DF2 +2F3513}


I have not been successful in accomplishing this. In my script, once I am in the iq directory I tried

$ftp->rmdir("/ep005/egate/client/iq/$folders"); $ftp->delete("/ep005/egate/client/iq/{*}"); system("rm -r {*}"); system("rm -r *");


I pull in a list of the items into an array, sort the list then I tried running any of the statements above and neither seem to work. When I telnet manually into the server I can run this command to delete the structures

rm -r {*}

What command would delete each one or all of them under the iq directory?

Edited by Chady -- added code tags.