I have a fastq file and need to remove the identifier, quality, and white space. So far my script looks something like this:

    #!/usr/bin/perl -w
    
    use strict;
    
    my $inputFileName = shift;
    my $outputFileName = shift;
    
    open INPUTFILE, "<$inputFileName" or die "poop";
    open OUTPUT, ">$outputFileName" or die "poop";
    
    my @bases = ('A', 'G', 'T', 'C');
    my $line;
    
    while ($line = <INPUTFILE>) {
      chomp $line;
      if ($line =~ /^\s*$/)
      elsif ($line =~ /^\s*@/)
      elsif ($line =~ /^+/)   
      else {print OUTPUT $line, "\n";
    }
    }

However I keep getting an empty output file. I'm very new to perl, so be gently.

Thanks!!
    #!/usr/bin/env perl
    use strict;
    use warnings;
    
    my $lines = 4;
    my $delimiter = "\t";
    my $input = shift @ARGV;
    
    open(INPUT,"$input");
    while (<INPUT>) {
        if($. % $lines == 2){ # the % character is the modulo operator Pierre was talking about
            print
        }
    }
    close(INPUT);

Put that in a file called `extract_reads_from_fastq.pl` and do the trick with:

    perl extract_reads_from_fastq.pl input.fastq