Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: split function

by zejames (Hermit)
on Jun 18, 2002 at 10:47 UTC ( [id://175332]=note: print w/replies, xml ) Need Help??


in reply to split function

Hello, I don't really understand your code :
  • You open FILE and you use BLASTX
  • You never use the array passed to the sub split_file
  • you return an array, that you never use

I would do this :
open FILE, "< $ARGV[0]" or die "Unable to open file : $!\n" while (<FILE>) { push @{$data[$.]}, split /[\s\t]+/; }
(No tested)
$. is the line number of the input file. Hence, if you have a test file like this
1 2 3 4 5 6 7 8 9 A B C
$data[ 2 ] [ 1 ] will give '6'

HTH

-- zejames

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-19 21:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found