in reply to Re: Shorten the headers of a file and remove empty lines using perl
in thread Shorten the headers of a file and remove empty lines using perl
and got the following messages:#!/usr/local/bin/perl use warnings; open ( my $input_fh, "<", $genome ); open ( my $output_fh, ">", $output_file ); foreach my $line ( <$input_fh> ) { unless ( $line =~ m/\A\s*\Z/ ) { $line =~ s/(GL\d{6})\d+/$1/; print $output_fh $line; } } close ( $input_fh ); close ( $output_fh );
Name "main::genome" used only once: possible typo at header.pl line 3. Name "main::output_file" used only once: possible typo at header.pl line 4. Use of uninitialized value $genome in open at header.pl line 3. Use of uninitialized value $output_file in open at header.pl line 4. readline() on closed filehandle $input_fh at header.pl line 5.
I think my way to open the file is wrong. Can you give me some hints? Thanks XF
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Shorten the headers of a file and remove empty lines using perl
by Cristoforo (Curate) on Jun 13, 2013 at 23:27 UTC | |
by choroba (Cardinal) on Jun 13, 2013 at 23:30 UTC | |
by Preceptor (Deacon) on Jun 14, 2013 at 20:29 UTC | |
|
Re^3: Shorten the headers of a file and remove empty lines using perl
by Cristoforo (Curate) on Jun 13, 2013 at 23:43 UTC | |
by Anonymous Monk on Jun 14, 2013 at 01:27 UTC | |
by Preceptor (Deacon) on Jun 14, 2013 at 20:26 UTC |