[ create a new paste ] login | about

Link: http://codepad.org/25x395U5    [ raw code | output | fork ]

Perl, pasted on Oct 31:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/perl

print "Hello World!\n";

$str = " #define vamsi varanasi 1";

$define_string = qr/^\s*#define\s+(\w+)\s*$/;

$define_value_string = qr/^\s*#define\s+(\w+)\s+(\w+)\s*$/;

if($str =~ m/$define_string/){
  print "YO YO \n";
}

if($str =~ m/$define_value_string/){
  print "YES \n";
}


Output:
1
Hello World!


Create a new paste based on this one


Comments: