Alessandro has asked for the wisdom of the Perl Monks concerning the following question:
And here is the error message Undefined subroutine &main::countGC called at GC_gfa_filter.pl line 22, <$fh> line 1. Any help is welcome, Thank you#!/usr/bin/perl use strict; use warnings; my $file = $ARGV[0]; open (my $fh, "<:encoding(UTF-8)", "$file") or die "Could not open < $ +file"; use Inline 'CPP' => << 'END'; using namespace std; int countGC(string gcString) { int res(0); for (int i = 0; i < gcString.length(); i++) { if (gcString[i] == 'C' | +| gcString[i] == 'G') { res++; } } return res; } END while (my $line = <$fh>){ my @string = split /\t/, $line; my $seq = $string[2]; printf ("%d\n", countGC($seq)); } close $fh;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Inline CPP undefined subroutine
by bliako (Abbot) on Nov 05, 2018 at 12:54 UTC | |
by bliako (Abbot) on Nov 05, 2018 at 14:06 UTC | |
by kikuchiyo (Hermit) on Nov 05, 2018 at 21:11 UTC | |
by syphilis (Archbishop) on Nov 06, 2018 at 00:33 UTC | |
by Alessandro (Acolyte) on Nov 05, 2018 at 13:20 UTC | |
by Anonymous Monk on Nov 05, 2018 at 13:21 UTC | |
|
Re: Inline CPP undefined subroutine
by BillKSmith (Monsignor) on Nov 06, 2018 at 04:45 UTC | |
|
Re: Inline CPP undefined subroutine
by harangzsolt33 (Deacon) on Nov 05, 2018 at 16:22 UTC | |
by stevieb (Canon) on Nov 05, 2018 at 16:28 UTC |