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]);
my $gene;
my $rs;
my $tf;
my $ds;
my %gene_key;
my @genes
while(<file1>){
if ($_=~/^(.+)\t+(.+)\t+(.+)\t(.+)$/){
$gene=$1;
$rs=$2;
$tf=$3;
$ds=$4;
}
push (@genes, $gene);
foreach $gene (@genes){
$gene_key{$gene}=($3." ".$2." ".$4)
}
foreach $gene(keys %gene_key){
my @gene_table;
push (@gene_table, $gene," ",$gene_key{$gene});
print "$gene.' '.$gene_key{$gene}";
}
}
close (file1);
[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]);
my $gene;
my $rs;
my $tf;
my $ds;
my %gene_key;
my @genes
while(<file1>){
if ($_=~/^(.+)\t+(.+)\t+(.+)\t(.+)$/){
$gene=$1;
$rs=$2;
$tf=$3;
$ds=$4;
}
push (@genes, $gene);
foreach $gene (@genes){
$gene_key{$gene}=($3." ".$2." ".$4)
}
foreach $gene(keys %gene_key){
my @gene_table;
push (@gene_table, $gene," ",$gene_key{$gene});
print "$gene.' '.$gene_key{$gene}";
}
}
close (file1);