Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
"be consistent"
 
PerlMonks  

Re: Can't Write to Files properly

by Not_a_Number (Parson)
on Dec 04, 2011 at 18:51 UTC ( #941748=note: print w/ replies, xml ) Need Help??


in reply to Can't Write to Files properly

Where to start?

Well, the first red flag is that you comment out use strict; towards the top of your script...

Scrolling down to the bottom, your last three subs try to use a non-existent global @LINE array, a problem which of course strictures would have identified.

My advice: go to bed, get a good night's sleep (and try not to dream of Perl...) :)

And tomorrow, after uncommenting use strict; and adding use warnings;, work through your code until you've fixed all the errors thereby revealed.

Then, if it still doesn't work, remove everything from your test code that has no relevance to the problem at hand (particularly, but not exclusively, the 170+ lines in sub MakeHTML), after which we might be willing to debug any remaining errors.


Comment on Re: Can't Write to Files properly
Select or Download Code
Re^2: Can't Write to Files properly
by sdyates (Scribe) on Dec 04, 2011 at 19:06 UTC
    Uncommenting strict won't have it run at all so I left it uncommented. I can't understand anything strict puts out anyhows. I have not written perl in a long time and need to get this thing working so no sleep until it is working... look like it is time to do a complete rewrite... unless anyone wants to make a quick $20.

      $20? Allow me to suggest:

      http://www.freelancer.com/jobs/Perl/

      Two further suggestions:

      1) Include some sample input data in your spec (ie. what files in wwwindex might or might not contain).

      2) Don't come back here and complain that the $20 'solution' that you've been sold doesn't work...

      HTH, dave

      Update: Yeah, well, managed to reply to myself. But I'm sure you get the picture.

      Update to update: Grandfather has re-(grand?)parented this node to where I should have posted it in the first place, so my previous update is no longer valid. Thanks gramps. But it would still be a shame to miss the Shangri-Las (or maybe not...).

        I included two of the files that appear in wwwindex. They have all the input data. I don't know how else to explain. I am not a seasoned programmer like most here. Most advise is just too technical for me to understand. If I see sample code, I am able to figure out how to reverse engineer. This time I am just at the wall.

      The reason it doesn't run under strictures is because it's broken, which you know or you wouldn't have come here with a problem. If you don't understand what the error messages mean ask about those, but leave strictures on.

      Oh, and if you really want people to take interest in your problem, whittle the code down to a self contained sample that runs and demonstrates the issue, although that will take you some time and if you are unfortunate you may figure the solution out for yourself in the process.

      True laziness is hard work
Re^2: Can't Write to Files properly
by educated_foo (Vicar) on Dec 05, 2011 at 01:40 UTC
    Well, the first red flag is that you comment out use strict; towards the top of your script...
    Please tell us how use strict would help the OP find the problem with his code. I'm guessing you have no idea, but just like to spout conventional wisdom.

      Maybe if you'd read the third paragraph in Not_a_Number's reply:

      Scrolling down to the bottom, your last three subs try to use a non-existent global @LINE array, a problem which of course strictures would have identified.

      you'd have worked out for yourself exactly how the advice might have helped the OP? To use strictures is never bad advice, and often enough strictures are all that is needed to highlight the actual problem.

      Advising people to use strictures is somewhat akin to the advice "fix the first error first". Strictures may not always identify the root problem. But very often they aid in eliminating a whole bunch of silly errors that distract from the root problem.

      Conventional wisdom is none the worse for being conventional. It's unfortunate that so many people have to be reminded of it however.

      True laziness is hard work

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://941748]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (9)
As of 2014-04-19 20:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (483 votes), past polls