You need to be clear about where your output begins and ends. Your program prints out "This is from slp.pl\n\n"?
Rashakil Fol
Super Senior Demiposter
2,658 posts since Jun 2005
Reputation Points: 1,135
Solved Threads: 177
Ok, try this code fixup:
#!/usr/local/bin/perl -w
############### check1.pl ###############
$runAutomatic = $ARGV[1];
$skipCaseClean = $ARGV[2];
if ( -d $ARGV[0] ) { print "Directory is $ARGV[0] \n\n"; }
if ( $runAutomatic eq 'n' ) { print "No run automatic. \n\n"; }
if ( $skipCaseClean eq 'n' ) { print "No skipping bad cases. \n\n"; }
system("perl slp.pl") or die("Cannot open.");
Here's what I've done:
1. I cleaned up the alignment and formatting of your syntax.
2. I took out the seemingly useless $i = 1; assignment from the third "if" conditional.
3. I literalized the system() command, and threw in some parenthesis for sanity's sake.
4.Most importantly I added a semi-colon after the die() command.
I hope that fixes things up for you. :)
EDIT: Keep in mind, Perl's syntax is ugly as is, so - and this goes to everyone who writes in Perl - try and make your code as visually appealing and as un-cryptic as possible; one command/small conditional/assignment a line.
indienick
Junior Poster in Training
71 posts since Aug 2005
Reputation Points: 23
Solved Threads: 2