in reply to How to work with Arrays of 83,000 values

Please explain what you mean by "it doesn't work". Does it emit an error, incorrect output, make your computer erupt in flames, ...?

--MidLifeXis

  • Comment on Re: How to work with Arrays of 83,000 values

Replies are listed 'Best First'.
Re^2: How to work with Arrays of 83,000 values
by vaniaul (Initiate) on Jul 23, 2013 at 17:09 UTC
    it gives multiple error messages like:
    # Might be a runaway multi-line "" string starting on line <line no. e.g. 86055>
    # Bareword found where operator expected
    # Missing operator before <the word e.g. Looking?>
    # String found where operator expected

    A snapshot of the error messages is shown in image at:
    http://imgur.com/TmR0BBd&3RdEAVA#1

    thanks for your help!
      At some point in every Perl class I have taught, I have tell someone "fix your syntax problems before you try to diagnose your logic problems."

      So, what happens with your code after you fix your errors?

      As a side note I'd suggest you rethink your design using a hash for the reading-list books and then do a single pass through the catalog file, reporting all matches as you go. The logic will be cleaner and the places where you can get the wrong index go away. (I know you think that the multiple arrays solution is 'cleaner'; Code will prove you wrong. What will happen the first time that the reading-list or the catalog changes? (Nota Bene: You have already demonstrated that problem.) This has all the potential of being a full-time maintenance headache. Not that I am objecting, mind you, cleaning up code like this on contract is what I do for a living....)

      ----
      I Go Back to Sleep, Now.

      OGB

      Please include a snapshot on this site, not an off-site location. PerlMonks attempts to be self contained so that any data associated with a question is on-site, helping to ensure the long-term validity of the questions.

      --MidLifeXis

      "...messages like...." doesn't really cut it. Here are the messages which result from adding strict and warnings to your script and running...

      perl -c 1045909.pl Scalar found where operator expected at 1045909.pl line 16, near "$rea +dingbooks$_" (Missing operator before $_?) # ie, Ln beginning '$rdbooks = $read +ingbooks$_;' Scalar found where operator expected at 1045909.pl line 17, near "$rea +dingdate$_" (Missing operator before $_?) Scalar found where operator expected at 1045909.pl line 21, near "$cat +books$_" (Missing operator before $_?) Scalar found where operator expected at 1045909.pl line 22, near "$cat +date$_" (Missing operator before $_?) Global symbol "$readingbooks" requires explicit package name at 104590 +9.pl line 16. syntax error at 1045909.pl line 16, near "$readingbooks$_" Global symbol "$readingdate" requires explicit package name at 1045909 +.pl line 17. syntax error at 1045909.pl line 17, near "$readingdate$_" Global symbol "$catbooks" requires explicit package name at D:\_Perl_\ +PMonks\1045909.pl line 21. syntax error at 1045909.pl line 21, near "$catbooks$_" Global symbol "$catdate" requires explicit package name at D:\_Perl_\P +Monks\1045909.pl line 22. syntax error at 1045909.pl line 22, near "$catdate$_" 1045909.pl had compilation errors.

      And... ohmigosh -- strict and warnings + actually reading the messages -- comes to the rescue again.

      If I've misconstrued your question or the logic needed to answer it, I offer my apologies to all those electrons which were inconvenienced by the creation of this post.