in reply to pattern matching with brackets
#!/usr/bin/perl -w use strict; my $code = <<'EOC'; #import <stdio.h> #import <time.h> char * point() { printf("[function point]\n"); return "point"; } char * mouse() { printf("[function mouse]\n"); return "mouse"; } EOC my @subs = ( $code =~ /\{([^\{\}]+)\}/g ); print "@subs\n";
|
|---|