Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: weird print output

by kcott (Archbishop)
on Sep 30, 2012 at 21:07 UTC ( [id://996540]=note: print w/replies, xml ) Need Help??


in reply to weird print output

G'day yunfei,

Welcome to the monastery.

Please provide a self-contained piece of code which reproduces your problem. (Guidelines for doing this can be found in: How do I post a question effectively?)

The following code simulates what you're describing but does not reproduce the problem.

#!/usr/bin/env perl use strict; use warnings; while (my $file = <DATA>) { 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

Output:

$ pm_weird_print.pl ------------------------------------------------------------ ******processing <<<</home/user/projects/database/bwa/index_bwa_human_ +b36_both.fasta.tar.gz>>> IF: /home/user/projects/database/bwa/index_bwa_human_b36_both.fasta.ta +r.gz ------------------------------------------------------------ ------------------------------------------------------------ ******processing <<<</home/user/projects/database/bwa/index_bwa_human_ +b36_both.fasta.index.tar.gz.md5>>> ELSIF: /home/user/projects/database/bwa/index_bwa_human_b36_both.fasta +.index.tar.gz.md5 ------------------------------------------------------------

In your while(<DBNAME>) {...} loop, it would be useful to show the raw data before and after modification as well as how that ties in with $file="$dir/$file";.

Also, please correct the typo in the title: s/wired/weird/

-- Ken

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://996540]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2024-04-23 19:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found