Monday, November 22, 2010

Input Params for Pig Script

A way to list all the input parameters of a pig script

open FILE, "<", "$pigfile" or die $!;
#GOING through the file to list out Parameters#
while (my $line = <file>) {
      #Only taking non commented line and content inside single quotes#
      if($line !~ /--/ && $line =~ /(')\$(.+?)(\1)/){
           print("\n$2");
}
close(FILE);

No comments: