Dear Programmers,
Please help me debug the following perl script. Thanks in advance!
I keep getting the same error msg "readline() on closed filehandle file1 at drug_list_formidterm.pl line 12."
#!usr/local/bin/perl -w
use strict;
my @table;
my $drug;
my $category;
my $line;
open...
Hello Perl experts,
I recently self-learn about the subroutine.
When do we need a local variables in the subroutine? Illustration with an example will be great!
Here is one example I have:
"
sub add{
local ($sum);
$sum=o;
foreach $_(@_){
$sum+=$_...
Well, may be a bit repetition here. I have the following input file.
gene1 rs1
gene2 rs2
gene1 rs3
gene1 rs4
And I want to write a program to make it look like:
gene1 rs1, rs3, rs4
gene2 rs2
Could anyone please help with this.
Thx,
szzxy
Hello, I have the following input file.
gene1 rs1
gene2 rs2
gene1 rs3
gene1 rs4
And I want to write a program to make it looks like:
gene1 rs1, rs3, rs4
gene2 rs2
that is, put all the rs with the same gene number into a row.
I parsed the file and called my gene number column value $gene and I...
Dear programmer(s),
Could you please tell me why the below script runs infinitely ? How can I print the result only once?
#!/usr/local/bin/perl -w
use strict;
open (file1, $ARGV[0]);
my $gene;
my $rs;
my $tf;
my $ds;
my %gene_key;
my @genes;
while(<file1>){
if...
Hi experts,
I have an input file with 2 columns (col_1 and col_2). The information in col_1 can occur more than once throughout the file, whereas the info on column 2 are all unique.
I tried to write a perl program to put all col2 info into one row when the col1 are the same.
...
##I...
Hello, I am a self-taught new user to perl. Could anyone please take a look at my script and tell me what is going wrong '
[error msg]
syntax error at gene_key.pl line 15, near "){"
syntax error at gene_key.pl line 23, near "}"
#!/usr/local/bin/perl -w
use strict;
open (file1, $ARGV[0])...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.