use Your::Module; open my $arc, 'ftp ftp://some.dot.com/pub/3GB.archive |' or die; local $/ = \65536; ## Could your module handle this? my $arcObj = Your::Module->new( $arc ); while( my( $name, $dataRef ) = $arcObj->next ) { if( $name =~ m[^file(\d+.type)$] and $$dataRef =~ m[this|that] ){ open $out, '>', localtime . $1 or die $!; print $out $$dataRef; last } }