http://qs321.pair.com?node_id=722411

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

Dear Masters,
I have the following subdirectories:
-dir1 |_ file1.gz |_ ... |_ file1000.gz ... -dir100 |_file1.gz |_ ... |_ file300.gz
What I am trying to do is to traverse "dir*" and execute "gunzip" command on the files inside them. I tried this code, but doesn't work:
for my $sd (@dirs) { system("cd $sd"); system("gunzip *.gz"); }
Please advice what's wrong with the above construct?

---
neversaint and everlastingly indebted.......