How to output in HTML?

2005-05-11 Thread Roger Grosswiler
Hi, i just wrote a very small perl-file, which opens a file, reads the content, adds a 1 and closes it. It's a veery simple hitcounter. (counter.pl, code see below) I would like now to print this in an existing html-sheet, say, when opening index.html, this program should be executed an

Re: Learning Perl

2003-02-28 Thread Roger
both of these options are great. but I'll tell you what I did. I bought a copy of "the perl cd bookshelf" on www.half.com that's the first one not the second one. Learning Perl 2nd Edition is on the cd along with perl in a nutshell, Programming Perl, 2nd edition, Perl Cookbook, Advanced Perl Prog

CGI Calendar Script

2002-07-09 Thread Roger Spears
say, how can I get the script to figure out that the 1st of July this year was a Monday? Anyone know of any example scripts or snippets of code I could look at for this project? Thanks, Roger -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Perl/CGI and Databases (where to begin?)

2002-06-27 Thread Roger Spears
ccess Database that's stored on the server?? Thanks, Roger -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: wildcard for unix????

2002-02-04 Thread Roger C Haslock
try chmod 0755 *.* - Roger - - Original Message - From: "Luinrandir Hernson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Sunday, February 03, 2002 8:54 PM Subject: wildcard for unix What is the global wildcard for unix?

Re: mkdir in cgi-script

2002-01-20 Thread Roger C Haslock
In this case I think you drop into shell `mkdir -p $fullpath`; # And check for errors!!! - Roger - - Original Message - From: "Rene Verharen" <[EMAIL PROTECTED]> To: "Beginners-CGI List" <[EMAIL PROTECTED]> Sent: Saturday, January 19, 2002 5:01 PM Sub

Re: Tables in CGI

2002-01-17 Thread Roger C Haslock
Sorry. That line should probably be foreach (0..$#columns) Odd message, though. - Roger - - Original Message - From: "Gerry Jones" <[EMAIL PROTECTED]> To: "Roger C Haslock" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, January 17, 20

Re: Tables in CGI

2002-01-15 Thread Roger C Haslock
gt;'1', -align=>'CENTER', -valign=>'TOP'}, Tr({-align=>'CENTER', -valign=>'TOP'}, [ th(\@columns) ] ), $rows ) - Roger - - Original Messag

Re: Question regarding placing specific items with a file

2001-12-31 Thread Roger C Haslock
successive Vhost sections relating to the same subdomain? If so, you may need to rewrite the httpd.conf file. - Roger - - Original Message - From: "Darryl Schnell" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, December 31, 2001 1:02 PM Subject: Question rega

Re: I need some concepts about binmode

2001-12-31 Thread Roger C Haslock
I quote from perlfaq5:- How do I randomly update a binary file? If you're just trying to patch a binary, in many cases something as simple as this works: perl -i -pe 's{window manager}{window mangler}g' /usr/bin/emacs However, if you have fixed sized records, then you might do something more

Re: problems with gd.pm

2001-12-13 Thread Roger C Haslock
http://aspn.activestate.com/ASPN/Modules/dist_html?dist_id=8887 GD 1.33 Interface to Gd Graphics Library CPAN Released: Author: LDS PPM Platforms: Linux Windows Version: GD 1.27.2 Perl Version: 5.6 Release Date: PP

Re: Hoax filter [was: Fwd: Fw: PLEEEEEEEASE READ!!!]

2001-12-04 Thread Roger C Haslock
comparing those with those of the group, should be quite effective. If a suitable filter is found, we might offer it to other groups, for they are liable to the same damage. - Roger - - Original Message - From: "Stephan Tinnemeyer" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTEC

Re: Fw: PLEEEEEEEASE READ!!!

2001-12-02 Thread Roger C Haslock
OT: Such people should have their e-mail priveleges removed. - Roger - - Original Message - From: "Dean Theophilou" <[EMAIL PROTECTED]> To: "lynn bui" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Sunday, December 02, 2001 4:57 AM Subject: RE: Fw

Re: Redirecting STDOUT to a variable...

2001-11-29 Thread Roger C Haslock
$datacapture = `$command`; $successorfailure = $?; - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, November 28, 2001 4:57 PM Subject: RE: Redirecting STDOUT to a variable... > Hi > Thanks, but I need

Re: Split a line with Multiple data types

2001-11-13 Thread Roger C Haslock
>> Obviously, split(/ /, $line) doesn't produce the array I really want. I don't understand the word 'obviously': what results are you getting? Have you tried the safer split /\s+/, $line; # split on any sequence of whitespace - Roger - - Original Message

Re: printing lines chunk

2001-11-11 Thread Roger C Haslock
while ($line =~ s/([^\r]{60})[^\r]/$1\r/){ ; # as long as 60 characters are not followed by a \r, put one in } - Original Message - From: "Pedro A Reche Gallardo" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, November 09, 2001 7:27 PM Subject: printi

Re: Global Variables

2001-11-02 Thread Roger C Haslock
]'; use constant USERNAME => scalar getpwuid($<); use constant USERINFO => getpwuid($<); 2) You can write your own private module, which defines such things. Cheers - Roger - - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>

Re: I want out, but I'm no idiot.

2001-10-27 Thread Roger C Haslock
Just a suggestion, but could someone set up a newsgroup for those that want out, but can't make it. (And someone else arrange their swift transfer to it!) - Roger - -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: $variable manipulation question

2001-10-02 Thread Roger C Haslock
If you are sure its a string, maybe you can use 'unpack', and then 'join'. - Roger - - Original Message - From: "Shannon Murdoch" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, October 02, 2001 11:20 AM Subject: $variable manipulat

Re: Replacing carriage returns in a variable

2001-10-02 Thread Roger C Haslock
advances to the next line, and used without a carriage return, enabled e.e.cummings to write his non-stop paragraphing. - Roger - - Original Message - From: "Guy Tubbs" <[EMAIL PROTECTED]> To: "Roger C Haslock" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]&

Re: Replacing carriage returns in a variable

2001-10-01 Thread Roger C Haslock
Something like this? my $othercharacter = 'Z'; $yourvariable =~ s/\r/$othercharacter/g; # \r is carriage return # /g at the end means do them all - Roger - - Original Message - From: "Guy Tubbs" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent:

Re: Find and delete

2001-10-01 Thread Roger C Haslock
First note > my $wordtodelete = "[Deletethis]; should have a trailing quote mark, like this > my $wordtodelete = "[Deletethis]"; Perhaps you need something like my $wordtodelete = "\[Deletethis\]"; - Roger - - Original Message - From: &

Re: How to ck for null set w/ Checkboxes

2001-09-25 Thread Roger C Haslock
her they are expected, but have not been given a value. Regards - Roger - - Original Message - From: "Teresa Raymond" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, September 25, 2001 2:02 PM Subject: How to ck for null set w/ Checkboxes > How do y

Re: structure of scripts (newbie Q)

2001-09-20 Thread Roger C Haslock
o create a functional module.) I, too, would be interested in other views on this subject. - Roger - - Original Message - From: "Stephan Tinnemeyer" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, September 20, 2001 2:22 PM Subject: structure of scripts

Re: Volunteer Project

2001-09-20 Thread Roger C Haslock
I have some time free: Can you give an idea of what is wanted. - Roger - - Original Message - From: "Mark Bergeron" <[EMAIL PROTECTED]> To: "Gary Stainburn" <[EMAIL PROTECTED]>; "Bradley M. Handy" <[EMAIL PROTECTED]>; "Teresa R

Re: Pls help me 2 troubleshoot

2001-09-19 Thread Roger C Haslock
: my %se = { "av" => "AltaVista", "yh" => "Yahoo", "gg" => "Google"}; my $searchengine = $q-> param('searchengine'); my $search = new WWW::Search ($se{$searchengine }); Regards - Roger - ---

Re: Pls help me 2 troubleshoot

2001-09-19 Thread Roger C Haslock
it, instead of before? Why do you redefine it on every call to the subroutine? Why do you call for $se{searchengine}, when you have only defined $se{av}, $se{yh} and $se{gg}? Why do you call the subroutine only once? - Roger - - Original Message - From: "Sunthari" <[EMAIL PRO

Re: Security Suggestions Please!

2001-09-18 Thread Roger C Haslock
ng cookies, but works if cookies aren't enabled. You must realise, however, this is not very secure. Its better that re-broadcasting the password, however, and shows you are taking precautions, if someone tries to sue for damages. I hope this helps. - Roger - - Original Message - Fr

Re: STDIN loop help

2001-09-10 Thread Roger C Haslock
Would something like this help? $i=1 while(my $line=) { chomp $line; push @integer,$line; # push a scalar onto the array print "Enter another integer, please: "; last if ++$i>=10; } - Original Message - From: "David Draley" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent:

Re: adding array elements

2001-09-08 Thread Roger C Haslock
How about > use strict; > my @data = qw/ 1 2 3 4 5 9 /; > my @sum = (0,0); > map { $sum[$_%2 ] += $data[$_] } ( 1..$#data ); > print $sum[0]; ... or sum such? - Roger - - Original Message - From: "Curtis Poe" <[EMAIL PROTECTED]

Re: Help me !

2001-09-06 Thread Roger C Haslock
itute; the \n is a newline character; the // contains nothing, and achieves the removal; the g find all the occurrences; The end result may not be what you want, hence the advice elsewhere to get rid of carriage returns (\r). Regards - Roger - - Original Message - From: "Pirabakaran

Re: Counting all the files on a system

2001-08-30 Thread Roger C Haslock
Hi I'm not sure why you want to look at /etc/fstab: why is it not sufficient to recurse from '/'? Also, remember to skip /dev. Cheers - Roger - - Original Message - From: "Westlake, Andy" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thur

Re: directory listing of document root?

2001-08-28 Thread Roger C Haslock
Surely, if you have control of your directory structure, you can use $ENV{DOCUMENT_ROOT}. There is no absolutely general solution, and you must be aware of what virtual hosting may do to your path. - Roger - - Original Message - From: "Robert Bunn" <[EMAIL PROTECTED]

Re: How does Apache invoke Perl interpreter: OT please don't reply

2001-08-24 Thread Roger C Haslock
Anything in the cgi-bin (or similar) directory is assumed to be an executable script. If it is a perl script (starts with #!//perl), then perl gets called. The interpreter then runs as a separate process. (You can try `ps -efl` to see whats happening) Does this help? - Roger - - Original

Re: File upload problems still!

2001-08-23 Thread Roger C Haslock
Just an aside, but what is the point of format => 'Application/msword' ? Anyone can rename their file to look like '*.doc', and you can only determine the file content when you have uploaded it ( at which point you SHOULD check). Regards - Roger - - Original Me

Re: Help on script

2001-08-22 Thread Roger C Haslock
lose INPUT; my $report = 'No matches found.'; if ($count) {$report = "Total numbers of matches : $count"} print p($report),end_html; [As a matter of logic, consider the split statement, and consider what it returns if the pattern is at the beginning, or end, of the line. T

Re: Help on script

2001-08-21 Thread Roger C Haslock
hink that). >>Not for a total novice programmer (who shouldn't learn Perl first anyway), ... >> A person new to ALL programming should NOT buy this book ... If you want to learn programming, I can only recommend 'Algorithms + Data Structures = Programs' by Niclaus Wirth (out

Re: A better way for ugly code?

2001-08-10 Thread Roger C Haslock
and then construct a loop to check them all. Of course, such checking is more efficiently done in Javascript on the client machine, and there are many such scripts. However, you still need to validate the parameters, in case the client has suppressed or violated the Javascript. Regards - Ro

Fw: very funny

2001-08-09 Thread Roger C Haslock
[ Please reply to the group, or else the thread loses its cohesion. RCH] I trust you are aware of http://www.perl.com/pub/q/FAQs. If these are incomprehensible to newbies, please post to this group, and say what you don't understand. If the FAQs are no good, they need revision. -

Re: search and return a value from a table

2001-08-09 Thread Roger C Haslock
What sort of database engine are you using? If this has an SQL interface, you would write something like select age from tablename where name='zzz'; ... and you would post the query to an SQL group. See recent 'very funny' discussion: this is not a perl query. - Rog

Re: Cookies and Security

2001-08-08 Thread Roger C Haslock
users of the script. I look with interest to the more learned answers to your query. - Roger - - Original Message - From: "Ryan Davis" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, August 08, 2001 10:00 AM Subject: Cookies and Security Hey all, I hav

Re: very funny

2001-08-08 Thread Roger C Haslock
elphi, ..., but I can't see how to do it in Perl 3... and so on They could bang their classification at the beginning of the subject line, and we could see what to answer. [ Any without such a prefix will get answered very slowly! ] - Roger - -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: reg cgi pgm running

2001-06-28 Thread Roger C Haslock
I recommend you test your program from the command line first. When it works from the command line, find an iplanet newsgroup for advice on iplanet. - Original Message - From: "nila devaraj" <[EMAIL PROTECTED]> To: "Hal Wigoda" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, J

Re: formatting and writing to file: getting the params

2001-06-19 Thread Roger C Haslock
You have > foreach my $name ( $cgi->param ) > {print "$name\t" . $cgi->param( $name ) . "\n"; > } You have to be careful with CGI::param; it returns a scalar for a scalar, and an arrayref for a list. May I suggest something like my %params = $cgi->Vars; foreach (keys %params) { my $para

Re: beginner's addressbook tutorial - level of presentation

2001-06-15 Thread Roger C Haslock
7;Why not CGI.pm?' Beginners will wish to learn to use this module; it is highly thought of. I looked for HTML::Template in Active State, and again in CPAN, with no luck. Incidentally, I noticed that you are making a new database connection each time you call cgi->new. Do you intend this, an

Re: binaries of DBI, DBD::mysql, CGI

2001-06-15 Thread Roger C Haslock
MySQL, Apache and Perl are all available for Windows. I do a fair amount of such stuff on Windows (but don't tell my Linux freinds). You shouldn't need a C compiler, but I too would like to know of a free/shareware one; I last used Topspeed under DOS. - Roger - - Original Message

Re: beginner's addressbook tutorial - level of presentation

2001-06-14 Thread Roger C Haslock
hod. I accept that one might implement one class, or several classes, within a module. Regards - Roger - - Original Message - From: "fliptop" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, June 13, 2001 5:51 AM Subject: beginner's addressbook tut

Re: mystery

2001-06-14 Thread Roger C Haslock
#!/.../perl to #!/.../perl -- That is, put two minus signs on the end. Regards - Roger - - Original Message - From: "Sally" <[EMAIL PROTECTED]> To: "perlcgi" <[EMAIL PROTECTED]> Sent: Thursday, June 14, 2001 9:54 AM Subject: FW: mystery > > > -Or

Re: MySQL access

2001-06-13 Thread Roger C Haslock
hile (my $arrayref=$sth->fetchrow_arrayref){ my ($name,$extno,$dnis,$cli,$acd)=@$arrayref; . . . } May I recommend you acquire ActivePerl from www.activestate.com: even if you don't use it, the documentation is an excellent ready reference. (If the module doesn't seem to be docu

Re: MS SQL Server access

2001-06-13 Thread Roger C Haslock
database (for tidiness) Where are you stuck? - Roger - - Original Message - From: "Derek Harding" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, June 13, 2001 9:35 AM Subject: MS SQL Server access > Hi, > > I wonder if anyone can help please. &

Re: error message

2001-06-13 Thread Roger C Haslock
What it means is:- Your script crashed before finishing making a page. If you are using CGI.pm, plant 'end_html;exit;' at various places through your script until it generates something legible. The error can be located that way. BTW, I endorse the fatalsToBrowser recommendation

Re: Regex question

2001-06-11 Thread Roger C Haslock
re of them # $/ == endofline - Roger - - Original Message - From: "Bruno Veldeman" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, June 09, 2001 9:07 PM Subject: Regex question > Hi, > > I can't seem to get the regex right for this: > > I

Re: More "Succintification"

2001-06-07 Thread Roger C Haslock
I have found the series of articles, eg http://www.oreillynet.com/pub/a/network/2001/05/18/perl_redflags.html to be most helpful for such problems - Roger - - Original Message - From: "Teresa Raymond" <[EMAIL PROTECTED]> To: "beginnerperllist" <[EMA