Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: EMPTY OUTPUT FILE GENERATED

by davido (Archbishop)
on Sep 26, 2012 at 05:34 UTC ( #995709=note: print w/ replies, xml ) Need Help??


in reply to EMPTY OUTPUT FILE GENERATED

Look closely at this line:

my @ra = map { ( split )[1] } split /\t/, @data1;

Start from the right hand side. The second argument to split needs to be a string of some sort, not an array.

Now move left.... Do you really intend to split on tabs, and then further split each tab-delimited column on a single space? (Because that's what's happening there.)

I suspect what you want is something more like this:

my @ra = map { (split /\t/, $_, 2)[0] } @data1

But I'm not positive, because I haven't seen your data. Next, why are you reading <FILE2> into @data2 without ever having called open on that filehandle? Also, you should be explicitly closing your output file, and using the or die construct again to verify that the close didn't fail.


Dave


Comment on Re: EMPTY OUTPUT FILE GENERATED
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2014-12-26 23:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls