Re: Showing errors with user input

2009-12-10 Thread John W. Krahn
Adam Jimerson wrote: On Dec 7, 12:43 pm, g...@lazymountain.com (Greg Jetter) wrote: On Sunday 06 December 2009 10:24:31 am Adam Jimerson wrote: I am working on a registration page and there for want it to show the user errors it has found with their input. I have two subroutines in my code,

Re: Data Conversion ?

2009-11-07 Thread John W. Krahn
Nathan Gibbs wrote: How would I get the length of a string as returned by length () into a 4 byte unsigned integer in network byte order my $length = pack 'N', length $string; John -- The programmer is fighting against the two most destructive forces in the universe: entropy and human

Re: Creating a Logon Form

2008-12-14 Thread John W. Krahn
John W. Krahn wrote: PekinSOFT wrote: John W. Krahn wrote: pekins...@gmail.com wrote: I enter the string 'hiyall2008' in the password field and get the following values in my logon script... Click 1: hiyall2008153639492 Click 2: hiyall2008135813700 Click 3

Re: Creating a Logon Form

2008-12-12 Thread John W. Krahn
PekinSOFT wrote: John W. Krahn wrote: pekins...@gmail.com wrote: I enter the string 'hiyall2008' in the password field and get the following values in my logon script... Click 1: hiyall2008153639492 Click 2: hiyall2008135813700 Click 3: hiyall2008152312388 et cetera

Re: Creating a Logon Form

2008-12-10 Thread John W. Krahn
[EMAIL PROTECTED] wrote: Hey All, Hello, I'm new to doing CGI with Perl and so am a little lost here. I'm working on a web-accessible database system for a (rather large) group of area churches and went through the rigmarole of assessing various programming and scripting languages to see

Re: awk command in script?

2008-11-21 Thread John W. Krahn
Owen wrote: You need to run something like this. Adapt to your requirements #!/usr/bin/perl -w use strict; while (DATA) { my $line = $_; if ( $line =~ /QQQ/ ) { my @bits = split; print $bits[$#bits -1]\n;

Re: awk command in script?

2008-11-20 Thread John W. Krahn
marys wrote: Hello: Hello, Does anyone know how to use ‘awk’ in a script? perl and awk have a lot of similar features so its usually preferable to use perl in a perl program instead of awk. It must have a different syntax than the unix analog, as does the ‘grep’ command. For grep, the

Re: Processing files in a directory

2008-11-11 Thread John W. Krahn
Susheel Koushik wrote: use the PERL system command. Its a wrapper for system call on your host OS. ex: system(rm *.tmp); Why, when you can just do: unlink *.tmp; John -- Perl isn't a toolbox, but a small machine shop where you can special-order certain sorts of tools at low cost and in

Re: parsing a line

2008-08-20 Thread John W. Krahn
thunder wrote: Hello all Hello, I have the following small file that i am parsing one line at a time (each line consists of hex values) line 1: 0d line 2: line 3: 2000 line 4: 0064 line 5: 76d457ed462df78c7cfde9f9e33724c6 line 6: bded7a7b9f6d763e line 7:

Re: Testing an array for a match

2008-04-10 Thread John W. Krahn
Lou Hernsen wrote: Hallo Hello, I have an array @Treasures and I want to match anywhere in it for /:1:2:3:/ can I if (@Treasures =~ /:1:2:3:/){} or do i have to change (@Treasures to $Treasures and then $Treasures = @Treasures ; if ($Treasures =~ /:1:2:3:/){} if ( grep /:1:2:3:/,

Re: Adding a comma to format localtime

2007-04-11 Thread John W. Krahn
Gregg O'Donnell wrote: I use this line of code: my $datetime = join ' ', (split ' ', localtime)[0,2,1,4,3]; To create this result: Mon 9 Apr 2007 09:15:05 How can I add a comma to this result to get: Mon, 9 Apr 2007 09:15:05 ( my $datetime = localtime ) =~

Re: Can't use string as a subroutine ref while strict refs

2006-11-11 Thread John W. Krahn
Sara wrote: use strict; use warnings; use CGI; my $q = new CGI; my $do = $q-param('do') || 'main''; if ($do) { $do; } sub main { blah blah } = Trying to call the subroutine main from variable $do but I am gettin' error: Can't use string

Re: indexing... in some way

2005-12-12 Thread John W. Krahn
Adriano Allora wrote: hi to all, Hello, this question isn't exactly a cgi-question, but I need to solve this problem before writing the cgi interface. I've got a list of tagged files. I've listed all the couple word+tag. now, for each word+tag I want to write a file containing all the

Re: Exact matching using GREP.

2005-09-09 Thread John W. Krahn
Sara wrote: - Original Message - From: Ovid --- Sara [EMAIL PROTECTED] wrote: while (my $row = $sth-fetchrow_hashref) { if (grep /$row-{CAT_TITLE}/, @present) { #matching title with @present elements print $row-{CAT_TITLE}; } Question is how to do EXACT matching using

Re: getstore and comments

2005-08-19 Thread John W. Krahn
Adriano Allora wrote: hi to all, Hello, Some questions: 1) how can I write multine comments? something like /** ... **/? Install this module: http://search.cpan.org/~kane/Acme-Comment-1.02/ 2) the following script doesn't find the page requested in getstore (baolian.local = 127.0.0.1).

Re: Just to know why ?: is not working here

2005-06-14 Thread John W. Krahn
J. Alejandro Ceballos Z. wrote: I made a CGI that must send a piece of code to screen, otherwise, must return a redirect command (is a banner CGI) What it is stange to me is that the construction: # blah, blah above # # Returns code or redirect to the page print ($str_codetoreturn)