Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: szzxy
  • Order by date
  1. szzxy

    Debugging for realine() on closed filehandle

    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...
  2. szzxy

    The purpose of a local variable in subroutine

    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+=$_...
  3. szzxy

    Sort a file

    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
  4. szzxy

    Sort a file

    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...
  5. szzxy

    how to get rid of an infinite loop

    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...
  6. szzxy

    a reoccurring problem for novice in perl

    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...
  7. szzxy

    a tiny syntax error for new commer

    Seems like I still have a lot to learn. Thanks a lot for all the replies.
  8. szzxy

    a tiny syntax error for new commer

    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])...

Part and Inventory Search

Back
Top