Quizzing students with Perl

2013-10-03 Thread Rick T
The code below (server addresses Xed out for security) has been used on my website for years, but it does seem to misbehave on rare occasions, so I have a few questions on how I might improve it. I apologize in advance for my amateurish coding; I’m a high school teacher who cannot afford hiring

Re: Quizzing students with Perl

2013-10-08 Thread Rick T
Many thanks for the helpful feedback from John W. Krahn, Andy Bach, and David Christensen. I have a lot to work on and I am grateful to all of you for steering me in useful directions. A special thanks to John W. Krahn, who not only zeroed in on what is likely the probably source of my

inserting a variable server name into code

2013-12-19 Thread Rick T
The following three lines are from a program that works fine for me. # Choose template file use constant TMPL_FILE = /big/dom/xoldserver/www/templates/open_courses3.html; my $tmpl = new HTML::Template( filename = TMPL_FILE ); I wanted to make the program more portable,

Re: inserting a variable server name into code

2013-12-26 Thread Rick T
Many thanks to Andy Bach, Janek Schleicher, Diab Jerius, and David Precious for you helpful comments on my post. My problem is solved and, more importantly, I learned important stuff from all of you! Rick Triplett -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional

regex problem?

2015-11-25 Thread Rick T
The following code apparently is not doing what I wanted. My intention was to confirm that the general format of $student_id was this: several uppercase letters followed by a hyphen followed by several digits. If not, it would trigger the die. Unfortunately it seems to always trigger the die.

local and auto flush

2018-05-15 Thread Rick T
I’m very much a novice — familiar with Learning Perl but finding Intermediate Perl an uphill slog. The few lines below are from a subroutine that calls Template Toolkit. The commented out line I simply copied from Perl Template Toolkit (PTT); the line after it is what I replaced it with after

difficulty with matching

2018-06-01 Thread Rick T
This is a newbie question, I’m sure. But I get perplexed easily! The follow code segment expects to receive a $student_id consisting of a surname followed by a hyphen followed by a number. The die is for testing what I’m doing. If I feed it 'jones-123’ it dies with ‘jones, - , 123’ as I

Re: obstinate syntax errors

2018-01-19 Thread Rick T
Uri, Thank you SO much for your helpful comments! You didn’t just solve THIS problem, you’ve helped me in my future programming! Rick > On Jan 19, 2018, at 11:56 AM, Uri Guttman <u...@stemsystems.com> wrote: > > On 01/19/2018 12:44 PM, Rick T wrote: >> The subr

obstinate syntax errors

2018-01-19 Thread Rick T
The subroutine below produces the following syntax errors: syntax error at /big/dom/xexploringmyself/cgi-bin/register.cgi line 71, near ""Can't change directory to $progress_hash{student_id}: $!";" syntax error at /big/dom/xexploringmyself/cgi-bin/register.cgi line 73, near ")" I've tried

slurp error

2018-07-27 Thread Rick T
I tried to implement some advice about slurping that I read on this mailing list (using local) but cannot get it to work. I get the message “Value of construct can be "0"; test with defined() at line 23” (the $slurp = <$fh1> line). I’m using perl version 5.18.2 installed in 2014. I’ve googled

slipping through my sieve

2018-09-09 Thread Rick T
I don’t know whether my difficulty is with my perl or with my logic; but either way I need a fresh mind on this. If I test the subroutine by feeding it a file name that does not exist in any format, I expect it to die — but it does not. Any good ideas will be greatly appreciated! Rick sub

Re: slipping through my sieve

2018-09-10 Thread Rick T
globals to pass data. I’ve come across this suggestion in the past but failed to appreciate it. Now I see that I have a lot of rewriting to do. An uphill job, but it needs to happen! Rick > On Sep 9, 2018, at 1:30 PM, Uri Guttman wrote: > > On 09/09/2018 02:11 PM, Rick T wrote: >&g

interpolation without double quotes

2018-07-04 Thread Rick T
The following line works, even though I forgot to double quote the variable. my $student_directory = '/data/students/' . $student_id; When I noticed this, I thought this was convenient: perl is trying to “do the right thing.” But I worry that leaving them out may be bad coding practice; if

data structure for Template Toolkit

2018-10-28 Thread Rick T
As a novice in perl I realize that it’s a bit presumptuous for me to attempt references and complex data structures. But I had a need and gave it a shot — a failing shot. I’ve been fiddling with my failure, almost mindlessly, all weekend; now I need some help. Below is the template segment I

Re: data structure for Template Toolkit

2018-10-31 Thread Rick T
Linux > On Oct 31, 2018, at 6:21 AM, Mike Flannigan wrote: > > > Are you on Linux or using Strawberry Perl? > I used Activestate for 15+ years and I was surprised > by how easy it was to move to Strawberry Perl about > 3 years ago. It's pretty darn easy to install modules > with Strawberry

browser hang

2018-10-31 Thread Rick T
This is not exactly a perl question, but perl may be implicated. The code below writes files to my server, one for each element of @ course_file_list. The files are small and the processing is simple and should go quickly. It works if the array has only a couple of elements; but with a longer

Re: data structure for Template Toolkit

2018-10-30 Thread Rick T
ilto:u...@stemsystems.com>> wrote: > > On 10/28/18 4:45 PM, Rick T wrote: >> As a novice in perl I realize that it’s a bit presumptuous for me to attempt >> references and complex data structures. But I had a need and gave it a shot >> — a failing shot. I’ve been fiddling wit

reading form values from POST

2018-09-02 Thread Rick T
I am trying to wean myself from CGI.pm, an easy task for most of you, but I am a beginner. The code below works, but that does not mean it always will or that it cannot be improved. I found the main part of this in CGI Programming with Perl, which is 18 years old, and I’ve given up hoping that

proper use of TEMPLATE

2019-03-14 Thread Rick T
I’m sure this is a “newbie question,” but I am only a shade above that status and would appreciate some clarification. I have use TEMPLATE in my code to control whether the attribute selected appears with one of the < options> of the list following in my served html document. Here’s one

configuring Net::SMTP

2023-07-08 Thread Rick T
I have two subroutines (below) in a program that uses Net::SMTP. I’ve recently moved my site from FutureQuest.net to Hostgator.com , and this part of my program has stopped working. The first routine sends an analysis of a test to me at

hosting suggestion?

2023-07-01 Thread Rick T
My web hosting company is closing business, and I less than two weeks to move my five sites to another host. All of these use perl. If you have experience with a host that supports perl, I’d appreciate any and all suggestions. I’m less concerned with cost than with service quality and support