#!/usr/bin/perl use warnings; use Inline CPP => Config => BUILD_NOISY => 1, CLEAN_AFTER_BUILD => 0; use Inline CPP => Config => AUTO_INCLUDE => '#include "ssw_cpp.h"'; use Inline CPP; my $ref = "CAGCCTTTCTGACCCGGAAATCAAAATAGGCACAACAAA"; my $seq = "CTGAGCCGGTAAATC"; print add(3,5)."\n"; my $returned = cprintit($seq); print $returned."\n"; #my $cigar = do_SSW($seq,$ref); #print "$cigar\n"; __END__ __CPP__ using namespace std; string do_SSW(const char* queryC, const char* refC) { Inline_Stack_Vars; string query(queryC); string ref(refC); StripedSmithWaterman::Aligner aligner; StripedSmithWaterman::Filter filter; StripedSmithWaterman::Alignment alignment; aligner.Align(query.c_str(), ref.c_str(), ref.size(), filter, &alignment); return alignment.cigar_string; } int add (const int a, const int b) { int c = a+b; return c; } int cprintit(const string seq) { cout << seq << endl; return 10; }