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 XFIn reply to Re^2: Shorten the headers of a file and remove empty lines using perl
by Anonymous Monk
in thread Shorten the headers of a file and remove empty lines using perl
by intect
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |