... foreach(@ARGV) { @temp = split(/./, $_); foreach(@temp) { &do_something($_); } @temp = (); }