#!/opt/local/bin/perl use Getopt::Std; @ticket_owner = ("5550001","5550002","5550003","5550004"); @tech_person = ("1110001","1110002","1110003","1110004"); @date_submitted = ("13-JAN-16","14-JAN-16","15-JAN-16","16-JAN-16","17-JAN-16","18-JAN-16","19-JAN-16"); @date_completed = ("23-JAN-16","24-JAN-16","25-JAN-16","26-JAN-16","NULL","NULL","NULL"); @category_id = ("01","02","03","04","05","06","07","08","09","10","11","12","13"); @machine = ("acta.cs.pitt.edu", "kaly.cs.pitt.edu", "elements.cs.pitt.edu", "kaso.cs.pitt.edu", "oxgyn.cs.pitt.edu", "rodi.cs.pitt.edu","java lab machine"); @description = ("The fan is noisy.", "Can not print any PDF file!", "Seems that the server is down?!", "The AFS client crashes all the time!", "The mouse responds in a weird way.", "I failed to login to the evaluation site.", "May I have SigmaPlot installed on my machine?", "Some keys on the keyboard does not function.", "The sound card is unrecognized.", "The harddrive got bad sector.", "Windows crashed!", "can not reach AFS-home directory from home.", "I have trouble configuring Outlook.", "Can not submit my h/w using the submission site.", ); getopt("t"); $ticket_num = 567860; usage() if $opt_h||!$opt_t; for($i=0; $i<$opt_t; $i++) { $randomSubmitted = rand($#date_submitted); $randomCompleted = rand($#date_completed); if($date_completed[$randomCompleted]=="NULL") { $days = "NULL"; } else { $days = 10 + (int($randomCompleted) - int($randomSubmitted)); } print $ticket_num."\t".$ticket_owner[rand @ticket_owner]."\t".$date_submitted[$randomSubmitted]."\t". $date_completed[$randomCompleted]."\t".$days."\t".$category_id[rand @category_id]."\t".$machine[rand @machine]. "\t".$description[rand @description]."\n"; push(@assignments, $ticket_num."\t".$tech_person[rand @tech_person]."\t".$date_submitted[$randomSubmitted]."\t"."assigned"."\t"."NULL"."\n"); if($date_completed[$randomCompleted]!="NULL") { push(@assignments, $ticket_num."\t".$tech_person[rand @tech_person]."\t".$date_completed[$randomCompleted]."\t"."closed_successful"."\t"."NULL"."\n"); } $ticket_num++; } print "\n"; foreach $tuple (@assignments) { print $tuple; } sub usage() { print STDERR << "EOF"; use -t to define the number of tuples EOF exit; }