#! /usr/bin/perl -w use strict; use diagnostics; my $f = shift; for my $dir (1..20) { open (PIPE, ">pipe"); $dir = $f.'_'.$dir; $| = 1; select(PIPE); print STDOUT "$dir\n"; print PIPE "C,$dir,1ROSE"; close PIPE; sleep 1; }