Hi Monks,
I am getting the following compile error
-----------------------------------------------
Bareword found where operator expected at do-bld3.pl line
2045, near "if ( $me3400(1) eq /cp"
(Might be a runaway multi-line // string starting on line 2000) (Do you need to predeclare if?)
Backslash found where operator expected at do-bld3.pl line 2045, near "mz \" (Do you need to predeclare mz?)
syntax error at do-bld3.pl line 2045, near "if ( $me3400(1) eq /cp me340x"
syntax error at do-bld3.pl line 2052, near "} else"
syntax error at do-bld3.pl line 2063, near "}"
--------------------------------------------------
Its showing for below piece of code..can u please help in debug.
======= if ($s1 == "j") {
$log = "\/users\/$u\/me3400-log.txt";
open(FILE, $log) || die "cud not read $log";
while(<FILE>) {
if ( $me3400(1) == /cp me340x-metrobase-mz \/tftpboot\/$u\/me340x-metrobase-mz/ )
{
open(OUTFILE,">>$of1") || die "cud not write";
print OUTFILE "me340x-metrobase-mz\n";
close(OUTFILE);
return;
} else {
open(OUTFILE,">>$of2") || die "cud not write";
print OUTFILE "me340x-metrobase-mz\n";
close(OUTFILE); return;
} } #end of while for me3400 log
} ### end of if if ($s1 == "j")
thanks
Unni

In reply to Compile error for the perl code by unnik

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.