http://www.perlmonks.org?node_id=1017112


in reply to Re: file header change
in thread file header change

thanks tmharish.. i used the following, but its not working.. :
use strict; use warnings; sub read_file { my( $filename ) = <STDIN>; my @lines; sub read_file { my( $filename ) = <STDIN>; my @lines; open( FILE, "< $filename" ) or die "Can't open $filename : $!" +; { if( @line =~ />contig_(\d+)\s/ ) { print ">$1\n"; } else { print "$line\n"; } }

:-(

Replies are listed 'Best First'.
Re^3: file header change
by tmharish (Friar) on Feb 05, 2013 at 10:42 UTC
    , but its not working..

    I am not surprised.

    Why do you have the same function defined twice? The second time inside the first??

    Create two functions, one to get the file name and the other to read the file, modify the contents and print it

    CALL the functions

    And finally try to run your code and get rid of the syntax errors.

      got it.. thanks tmharish for ur cooperation..