Professional Web Applications Themes

[The Subroutine...revisited] What is "Use of uninitialized JOIN" error? - PERL Beginners

jason corbett wrote:  Explicitly name the columns you want to select on. It could end up saving you a bunch of headaches in the long run. Also, go into the MySQL CLI and type your command in, just to make sure you're getting back what you want... I'm willing to bet that you're getting back NULL values in one or more of your columns, which may be causing problems in the join statement.   For debugging, try adding in the following lines: use Data::Dumper; print "# of columns: " . record . "\n"; print "\record:\n" . Dumper(\record) . "\n"; You ...

  1. #1

    Default RE: [The Subroutine...revisited] What is "Use of uninitialized JOIN" error?

    jason corbett wrote: 

    Explicitly name the columns you want to select on. It could end up
    saving you a bunch of headaches in the long run. Also, go into the MySQL
    CLI and type your command in, just to make sure you're getting back what
    you want... I'm willing to bet that you're getting back NULL values in
    one or more of your columns, which may be causing problems in the join
    statement.
     

    For debugging, try adding in the following lines:

    use Data::Dumper;
    print "# of columns: " . record . "\n";
    print "\record:\n" . Dumper(\record) . "\n";

    You may find that your whole array is, in fact, populated with NULL
    values...
     
    Ed Guest

  2. #2

    Default RE: [The Subroutine...revisited] What is "Use of uninitialized JOIN" error?

    I have seen null values come up, but when I do this same query in SQL Plus (Oracle environment BTW), I am getting no null values.

    Ed Christian <ptd.net> wrote:jason corbett wrote: 

    Explicitly name the columns you want to select on. It could end up
    saving you a bunch of headaches in the long run. Also, go into the MySQL
    CLI and type your command in, just to make sure you're getting back what
    you want... I'm willing to bet that you're getting back NULL values in
    one or more of your columns, which may be causing problems in the join
    statement.
     

    For debugging, try adding in the following lines:

    use Data::Dumper;
    print "# of columns: " . record . "\n";
    print "\record:\n" . Dumper(\record) . "\n";

    You may find that your whole array is, in fact, populated with NULL
    values...
     


    Jason Guest

  3. #3

    Default Re: [The Subroutine...revisited] What is "Use of uninitialized JOIN" error?





    $recordlist=join(",",record); #This statement is causing the problem

    Have you tried to see if there are any blank records in record?

    __________________

    William Ampeh (x3939)
    Federal Reserve Board

    William Guest

  4. #4

    Default sub naming conventions

    Is there an established, doented best practice for naming subroutines in
    Perl? does it differ whether the subroutine is in a script or a module (I
    would like it to be clear in my scripts whether I am expecting something local
    or packaged). I have seen at least:

    some_function()
    someFunction()
    SomeFunction()

    TIA,

    -John
    Perl.Org Guest

  5. #5

    Default Re: sub naming conventions

    On Jul 13, 2004, at 6:52 PM, perl.org wrote:
     

    This one is typical Perl style. Some of use find it easier to read
    than those Java-ish variants you showed.

    Check out:

    perldoc perlstyle

    James

    James Guest

  6. #6

    Default Re: sub naming conventions

    On Tue, 13 Jul 2004 18:57:57 -0500, James Edward Gray II wrote 

    Thanks. I had done perldoc perl | find /i "nam" but didn't see anything that
    looked relevant. The people that maintain Perl apparently have a very
    different mindset than I do...
    Perl.Org Guest

  7. #7

    Default Re: sub naming conventions

    perl.org wrote: 
    >
    >
    > Thanks. I had done perldoc perl | find /i "nam" but didn't see anything that
    > looked relevant. The people that maintain Perl apparently have a very
    > different mindset than I do...
    >[/ref]

    Which particular style you happen to choose is less important, than
    being consistent with it all the way through your programming. Check
    out CPAN and you will see a varied (and wonderful) sample of very
    different styles, of many things, naming conventions, argument passing,
    error handling, etc. But the best modules on CPAN all exhibit one
    trait, they are consistent wrt their own interface.

    Just my $.02...

    http://danconia.org
    Wiggins Guest

  8. #8

    Default Re: sub naming conventions

    On Tue, 13 Jul 2004 19:17:06 -0500, Wiggins d'Anconia wrote 

    Good because according to that perldoc I am following about 10% of convention
    (though it is pretty consistant), and I would more prefer to be able to read
    my own code than worry that someone else would only be able to read code
    styled according to Larry.

    There is still a question here - is there any convention difference between
    local sub names (in the script) and sub names in modules? I guess I can
    always name my local subs lsWhatever if there is no established convention.
    Perl.Org Guest

  9. #9

    Default Re: sub naming conventions

    On 7/13/2004 8:34 PM, perl.org wrote:
     

    Naw, method names are dem dar thangs wit objects hanging of der side of em.

    $obj->method_name()

    function_name()

    Fully::Qualified::function_name()


    Randy Guest

  10. #10

    Default Getopt::Std vs. Getopt::Long

    I have been using Getopt::Std for some time and I'm pretty happy with it.
    I've been reading about Getopt::Long and it seems to support everything in
    Getopt::Std and has some nice conveniences. Does anyone have experience
    converting scripts (or just development process) from Std to Long? Does
    anyone have pretty good code examples using Getopt::Long?
    Perl.Org Guest

Similar Threads

  1. Replies: 2
    Last Post: October 4th, 09:47 PM
  2. Replies: 1
    Last Post: December 17th, 09:09 PM
  3. Replies: 5
    Last Post: July 13th, 07:25 PM
  4. What is "Use of uninitialized JOIN" error?
    By Jason in forum PERL Beginners
    Replies: 4
    Last Post: July 13th, 06:00 PM
  5. Replies: 2
    Last Post: February 19th, 11:17 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139