Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: reputer reply

by grinder (Bishop)
on May 17, 2001 at 15:00 UTC ( [id://81200]=note: print w/replies, xml ) Need Help??


in reply to reputer reply

Man, reputer is going to answer all my reputation questions.Here are some comments I have after having had a bit of a play with it.

  • The documentation is extremely good and to the point. Too bad there is not a lot of it :)
  • When you run reputer and click on its link to come to this page, the URL appears as http://www.perlmonks.org//index.pl?node=reputer+reply which makes things barf later on. This could be because I set my "domain" as http://www.perlmonks.org/ (note the trailing slash).
  • When I started it up, the script died with a mysterious error (okay, it coughed up the line number). Turns out that in sub getsave had code like
    open(DAT,"> $_[0]") or die "$!";
    I think it's better to be more explicit about what's going on
    open(DAT,"> $_[0]") or die "open $_[0] for output: $!";
  • From here I was able to figure out what was going on, namely, a place to write the reputer data files, which gets back to the documentation... it's takes a bit of sleuthing to find out what the script wants in order to get it going. Some of the things included: setting up a directory chowned to nobody, fixing the shebang line
  • When I ran the script with warnings enabled it spewed loads of messages into the error_log. Are you interested in patches?
  • Is your spacebar broken? A little whitespace would go along way to lightening up the code and making it a bit readable, e.g. lining up assignments, a space between my and the variable it declares

More later as I play further.


--
g r i n d e r

Replies are listed 'Best First'.
Re: Re: reputer reply
by epoptai (Curate) on May 19, 2001 at 21:58 UTC
    It's a little ironic that your first point concludes there is not enough documentation, followed by reports of problems caused by not following what documentation there is :-)

    It's your responsability to set config variables to reasonable values. If a trailing slash breaks the domain don't use one.

    The 10th line of the code, which is documentation, states "Can write up to 8 data files in temp dir, so give it write permission."

    The 1st config variable is $temp, which needs to be set to a writable dir. It's just standard practice to check the shebang line since we don't all install perl in the same place.

    Updated Excuse: The script is provided with warnings turned off. I know about the warnings, and decided to turn them off because I don't always succeed in initializing variables, and despite the fact that perl doesn't care, warnings about it can hang the script from CGI.

    You specifically address this in your next reply. I used to think this initialized all the vars:

    my($mode,$td,$ta,$rd,$ra,$ca,$cd) = '';
    but you correct me with this:
    my($mode,$td,$ta,$rd,$ra,$ca,$cd) = ('','','','','','','');
    and I've come to use this method supplied by Masem in CB:
    my($mode,$td,$ta,$rd,$ra,$ca,$cd) = map {''} (1..7);
    (who also suggested split //, '0'x7 )

    You last point hits a sore spot. I've lost count of how many monks have criticized my lack of whitespace and especially eliminating the space after 'my'.

    My lack of whitespace stems from using an editor that highlights syntax. This causes colors, and not whitespace, to be my primary visual cue. It allows me to fit more code on each screen while still clearly seeing what's going on.

    My editor color codes 'my' and '$' the same bright blue color, not using a space makes declarations really stand out and look different from subsequent variable usage.

    I'll look into running my code thru perltidy, but until then I suggest you do so if my formatting doesn't work well in your development environment.

    I do appreciate your feedback, it will help shape my habits and hopefully make things clearer on my next project.

    --
    Check out my Perlmonks Related Scripts like framechat, reputer, and xNN.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-04-19 10:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found