Thread Inline::ASM (14 answers)
Opened by tonewheel at 2012-05-12 13:26

topeg
 2012-05-12 20:29
#158321 #158321
User since
2006-07-10
2611 Artikel
BenutzerIn

user image
Versuch erst mal was einfaches:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/perl
use strict;
use warnings;
use Inline C => <<'END';
  void foo(int a)
  {
    printf("NUMBER: %d\n",a);
  }

  int add(int a,int b)
  {
    return a+b;
  }
END

foo(add($_,2)) for(0..9);

beachte das 'END' ansonsten wird \n von Perl interpretiert.

View full thread Inline::ASM