i am getting the following error and have no idea why
syntax error at ./vacation.pl line 33, near ") &" syntax error at ./vacation.pl line 38, near "}" Execution of ./vacation.pl aborted due to compilation errors.

there is obviously a simple reason for this error that i just cannot find.....
the code for the script is below
#!/usr/local/bin/perl -w use strict; #declare vars our $set_fwd; our $username; our $message; our $on_off; our $FILENAME; our @list_of_files; #initialize @list_of_files to what the correct list of files @list_of_files=(".forward", ".vacation.msg", ".vacation.pag", ".vacati +on.dir"); `touch Adfasfasfasdfasdfhlasfhasdfhdsfjhjdhsfhfajfhjfhasjfh`; ### # pass arguments in this patern: username on/off message no quotation +s needed ### if (($#ARGV > 1) || (($#ARGV ==1) && ($ARGV[1] eq "off"))) { $username=$ARGV[0]; $on_off=$ARGV[1]; if($on_off eq "on") { $message = join (" ",@ARGV); $message =~ s/$username//; $message =~ s/$on_off//; &On(); } elsif ($on_off eq "off") &Off(); else { print "Necessary Value Contains Incorrect Parameters\n"; exit 1; } } else { print "Error Reading Action\n"; exit 1; } print " <div align=\"center\"> $username\'s vacation message has been + \n"; print " <font color=red>"; if($on_off eq "on") print "Activated"; else print "Deactivated"; print " </font>.</div><BR>\n"; print " <div align=\"center\">\n"; print " </div>\n"; print " <center><BR>Please E-Mail <a href=\"mailto:$username\@iwu +.edu\">$username\@iwu.edu</a>\n"; print " to test this message. <BR> If you "; if($on_off eq "on") print "do not "; print "recieve an automatic response with your\n"; print " vacation message please resubmit this form</center>\n"; } else print "<b>Not all necessary values have been given.</b>\n"; sub On { foreach $FILENAME (@list_of_files) { open(TempFile, ">/home/$username/$FILENAME") || die ("Unable to op +en /home/$username/$FILENAME"); if ( $FILENAME eq ".forward") { #.forward must look like #\username, "|/usr/bin/vacation username" $set_fwd="\\$username, \"|/usr/bin/vacation $username\""; print TempFile $set_fwd; } if ( $FILENAME eq ".vacation.msg") { print TempFile $message; print TempFile "\n"; } close(TempFile); `chmod 644 /home/$username/$FILENAME`; `chown $username /home/$username/$FILENAME`; } } sub Off { foreach $FILENAME (@list_of_files) `rm -f /home/$username/$FILENAME`; }
Can anyone put a second set of eyes on this for me? and possibly offer optimization suggestions......

In reply to Lo, for i am blind by jcpunk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.