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

Re: split function

by jwkrahn (Abbot)
on Jul 12, 2010 at 18:39 UTC ( [id://849077]=note: print w/replies, xml ) Need Help??


in reply to split function

Perhaps your code will run better like this:

#!/usr/bin/perl #network_coco.plx use warnings; use strict; open DATAOUT2, '>>', 'cococount.txt' or die "$!\n"; for my $count ( 90 .. 95 ) { open DATAIN, '<', $ARGV[ 0 ] or die "cannot open \"ARGV[0]\":$!"; open DATAOUT, '>', 'variable' or die "$!\n"; while ( <DATAIN> ) { my $field = ( split /\t/ )[ 2 ]; if ( $field >= "0.$count" ) { print DATAOUT; } } close DATAOUT; close DATAIN; #clm close reads file variable, and gives back an integer open VAR2, '-|, 'clm', 'close', '-abc', 'variable', '--is-undirect +ed', '--write-count', '-cc-bound', '5' or die "$!\n"; while ( <VAR2> ) { chomp; print DATAOUT2 "0.$count\t$_\n"; } close VAR2 or warn $! ? "Error closing pipe: $!" : "Exit status $? from clm"; } close DATAOUT2;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-03-19 07:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found