#!/usr/bin/env perl use strict; use warnings; while (my $file = ) { print '-' x 60, "\n"; chomp $file; print "******processing <<<<${file}>>>\n\n"; if ($file =~/(zip$)|(gz$)|(tar$)|(bz$)|(bz2$)/i) { print "IF: $file\n"; } elsif ($file =~/md5$/i) { print "ELSIF: $file\n"; } print '-' x 60, "\n"; } __DATA__ /home/user/projects/database/bwa/index_bwa_human_b36_both.fasta.tar.gz /home/user/projects/database/bwa/index_bwa_human_b36_both.fasta.index.tar.gz.md5 #### $ pm_weird_print.pl ------------------------------------------------------------ ******processing <<<>> IF: /home/user/projects/database/bwa/index_bwa_human_b36_both.fasta.tar.gz ------------------------------------------------------------ ------------------------------------------------------------ ******processing <<<>> ELSIF: /home/user/projects/database/bwa/index_bwa_human_b36_both.fasta.index.tar.gz.md5 ------------------------------------------------------------