Missing right curly or square bracket (but that isnt the case)

Discussion in 'Perl Misc' started by daveyand, May 24, 2006.

  1. daveyand

    daveyand Guest

    Hey guys,

    I get the following error:
    Missing right curly or square bracket etc......

    However on doing a count i have the right number of closing to openning
    brackets be it ( or [ or {.

    I am however also getting about 150+ errors and it starts from after
    the following bit of code.

    print FH <<EOHTML;
    <ul>
    <li onclick="show_tree('p', $n);" class="$class"
    onmouseover="this.style.background='#B8E9FF';"
    onmouseout="this.style.background='white';">$provider_name</li>
    <table class="hidden" id="p$n" cellpadding="0px"
    cellspacing="0px">
    <tr class="irrel">
    <td>
    <ul class="no-list-style">
    <li>
    Total Articles:
    $provider_article_count
    </li>
    <li class="irrel">
    Jake Link: <a href="$jake_link"
    target='_blank'>View $provider_name Jake Page</a>
    </li>
    <li class="irrel">
    Provider Id: $provider_id
    </li>
    EOHTML

    I've had this before and have just removed the <<EOHTML and assigned it
    as normal prints and it works, so it's this chunk of code. (i think
    anyway) does anyone know what could be causing it, a perl nuance
    maybe??

    Cheers for any help

    Andy
    daveyand, May 24, 2006
    #1
    1. Advertising

  2. daveyand

    Mumia W. Guest

    daveyand wrote:
    > Hey guys,
    >
    > I get the following error:
    > Missing right curly or square bracket etc......
    >
    > However on doing a count i have the right number of closing to openning
    > brackets be it ( or [ or {.
    >
    > I am however also getting about 150+ errors and it starts from after
    > the following bit of code.
    >
    > print FH <<EOHTML;
    > [...]


    The code you posted works fine, so I can only suggest that you test your
    program (and the Perl interpreter?) by assigning to a variable and
    printing that.

    Also, there may be something wrong with the file handle FH that causes
    it to not be recognized as a file handle. I ran your code by opening FH
    as standard output, and it worked, but your program is no doubt more
    complicated than that.
    Mumia W., May 24, 2006
    #2
    1. Advertising

  3. daveyand

    Mintcake Guest

    daveyand wrote:
    > Hey guys,
    >
    > I get the following error:
    > Missing right curly or square bracket etc......
    >
    > However on doing a count i have the right number of closing to openning
    > brackets be it ( or [ or {.
    >
    > I am however also getting about 150+ errors and it starts from after
    > the following bit of code.
    >
    > print FH <<EOHTML;
    > <ul>
    > <li onclick="show_tree('p', $n);" class="$class"
    > onmouseover="this.style.background='#B8E9FF';"
    > onmouseout="this.style.background='white';">$provider_name</li>
    > <table class="hidden" id="p$n" cellpadding="0px"
    > cellspacing="0px">
    > <tr class="irrel">
    > <td>
    > <ul class="no-list-style">
    > <li>
    > Total Articles:
    > $provider_article_count
    > </li>
    > <li class="irrel">
    > Jake Link: <a href="$jake_link"
    > target='_blank'>View $provider_name Jake Page</a>
    > </li>
    > <li class="irrel">
    > Provider Id: $provider_id
    > </li>
    > EOHTML
    >
    > I've had this before and have just removed the <<EOHTML and assigned it
    > as normal prints and it works, so it's this chunk of code. (i think
    > anyway) does anyone know what could be causing it, a perl nuance
    > maybe??
    >
    > Cheers for any help
    >
    > Andy

    I don't think the problem lies within this code fragment. I pasted it
    into a file and got a lot of compiler warnings and a runtime error but
    no compiler syntax errors
    Mintcake, May 24, 2006
    #3
  4. daveyand

    Mirco Wahab Guest

    Hi daveyand

    > print FH <<EOHTML;


    this is identical (iirc) to

    print FH <<"EOHTML";

    so consider

    print FH <<'EOHTML';

    instead. Yo have a lot of
    expressions in your text,
    that would be evaluated
    if you use the "..." thing.

    Regards

    Mirco

    see also: http://www.techtricks.com/webstuff/perl/heretrap.php
    Mirco Wahab, May 24, 2006
    #4
  5. daveyand <> wrote:

    > I get the following error:
    > Missing right curly or square bracket etc......
    >
    > However on doing a count i have the right number of closing to openning
    > brackets be it ( or [ or {.



    Machines are much less likely to make a mistake than a human.

    Merely counting characters is not sufficient. Those chars are
    overloaded, they have more than one meaning depending on where
    they are in the parse.

    eg. if they are in a string, then they "don't count".


    > I am however also getting about 150+ errors



    You most likely have one error that cascades into 150 error *messages*.


    > and it starts from after
    > the following bit of code.



    No it doesn't.

    It likely starts shortly before the line number reported.


    > does anyone know what could be causing it,



    A missing right curly or square bracket.


    > a perl nuance
    > maybe??



    No, if it doesn't parse, it isn't a perl program yet.

    If you post a short and complete program that we can run that
    produces the error message, then someone can surely help you
    fix it.


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
    Tad McClellan, May 24, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    1,106
    Victor Bazarov
    May 4, 2007
  2. Wabiloo
    Replies:
    1
    Views:
    819
    Martin Honnen
    Jan 25, 2008
  3. Joan Miller
    Replies:
    2
    Views:
    493
    Gary Herron
    Mar 6, 2010
  4. Alia Khouri
    Replies:
    8
    Views:
    260
    Neil Cerutti
    Apr 5, 2011
  5. Ken Fine
    Replies:
    2
    Views:
    164
    Ken Fine
    Feb 24, 2004
Loading...

Share This Page