#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    41
    Rep Power
    12

    Question Global symbol "@dhtmlcentral" requires explicit package name


    I want to create a dynamic page with perl.

    since my html is quite complicated.

    I use this structure
    {
    #!/usr/bin/perl

    print "Content-type:text/html\n\n";

    parse the get method

    header();

    deal with the dynamic part

    footer();

    }

    sub header{

    }


    sub footer{
    }

    I keep getting the compling erreor.
    Global symbol "@dhtmlcentral" requires explicit package name at shownews.cgi line 69.

    any clues?

    Thanks
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2002
    Posts
    548
    Rep Power
    0
    Sigh. You don't even post the part of the code that the error refers to? Post the whole file.
  4. #3
  5. 'fie' on me, allege-dly
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2003
    Location
    in da kitchen ...
    Posts
    12,894
    Rep Power
    6444
    Before Hero sees this, I'd start looking at CGI.pm, and also some HTML::Template if the html is complex

    --Ax
  6. #4
  7. 11
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Jul 2001
    Location
    Lynn, MA
    Posts
    4,635
    Rep Power
    83
    <muttering>The header isn't RFC compliant- there isn't a space after the ":" and there should be. . .</muttering>

    Do you see why I harp on this stuff? You see it ALL the time!
  8. #5
  9. 'fie' on me, allege-dly
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2003
    Location
    in da kitchen ...
    Posts
    12,894
    Rep Power
    6444
    OT It's been a real education, and well worthwhile
    Cheers
    --Ax
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    41
    Rep Power
    12
    Thanks all replies.
    I am a newbird of perl.

    I forget to mention , I use " USE strict "
    under the #!/usr/bin/perl.
    When I delete the use strict, everything is going well.
    Any advice?
  12. #7
  13. 'fie' on me, allege-dly
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2003
    Location
    in da kitchen ...
    Posts
    12,894
    Rep Power
    6444
    @dhtmlcentral is an array that hasn't been declared.

    Perhaps you could attach your script, and I'll see if I can check it out

    --Ax
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    41
    Rep Power
    12
    here is perl script.
    Attached Files
  16. #9
  17. 'fie' on me, allege-dly
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2003
    Location
    in da kitchen ...
    Posts
    12,894
    Rep Power
    6444
    It's to do with webmaster@dhtmlcentral.com
    Just escape it \@dhtmlcentral.com should get you out of jail
    --Ax
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    41
    Rep Power
    12
    Thank you AXweildr a lot.
    I understand right now.
    @dhtmlcentral.com will be considered a valid variable in perl.
    Since I use strict, perl required me to declare the @dhtmlcentral.com variable.

    So simple.
    Thanks a lot.
  20. #11
  21. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2002
    Posts
    548
    Rep Power
    0
    The best part is that the original error you posted told you EXACTLY where to look in the file to find the problem.
  22. #12
  23. 'fie' on me, allege-dly
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2003
    Location
    in da kitchen ...
    Posts
    12,894
    Rep Power
    6444
    Randy,

    How can that be the best part, when line 69 wasn't posted at that time??

    --Ax
  24. #13
  25. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2002
    Posts
    548
    Rep Power
    0
    I'm saying - he didn't even open the farking file to see what the problem was. Methinks he shouldn't trust himself to code a print command

IMN logo majestic logo threadwatch logo seochat tools logo