Submitting through a perl script


I was asked to help a friend out with his site but ran into an issue. He currently wants a cgi to capture data, if the one of the variables is less than X, just send an email, if the ...
Posted On: Monday 26th of November 2012 09:04:08 PM Total Views:  126
View Complete with Replies

RELATED TOPICS OF Perl PROGRAMMING LANGUAGE




Can I iterate through a file on a CGI page?

Apologies to Perl purists - comp.infosystems.www.authoring.cgi doesn't work on my newsreader, and this is a CGI question: What I want to do is, I've got a large collection of image files: $ wc gallery-pix 37448 62619 3218967 gallery-pix and what I'd like to do is look at each of the 37488 image files on some kind of page, with buttons like "Keep", "Skip", and "Quit", so I can page through all of these images, which are strewn all over the Samba server, and decide which ones might look good on the website. So, is it possible to do something like (in pseudocode): for each $line in { show webpage with tag, and the three buttons; get button response, decide what to do with file; if button == "Quit", save place in source file; next; or so
VIEWS ON THIS POST

74

Posted on:

Sunday 4th November 2012
View Replies!

Looping through an anonymous array of arrays

my $arrayRef = [ 1, 2, 3, ['a', 'b', 'c', [""] ]]; I have no problem returning single elements but how would one walk this list of elements with say a for loop
VIEWS ON THIS POST

78

Posted on:

Sunday 4th November 2012
View Replies!

Loop through Multi Dimension hashs

Hi , I am creating a hash to store my servers. Here is my hash example:push(@ { $array{examplesite}{'App-servers'}{'Application Server'}{'External IP'} },'test');push(@ { $array{examplesite}{'App-servers'}{'Application Server'}{'External IP'} },'test1');push(@ { $array{examplesite}{'App-servers'}{'Database server'}{'External IP'} },'test1');I am able to get external ip printed by doing this: for $item ( @ { $array{examplesite}{'App-servers'}{'Application Server'}{'External IP'} }){\tprint $item;}But I have to specify 'Application Server' within my for query, I would like to print everything after {'App-servers'} so I can see database servers as well as app-servers. Any suggestions how I can do that
VIEWS ON THIS POST

152

Posted on:

Wednesday 7th November 2012
View Replies!

Perl prog not correctly processing subroutine through require

I have a perl program that tries to call a subroutine which is available through a require statement. The file is called headers.pl and contains nothing more than a single subroutine called header_print that takes no arguments and just does a print, something like ....sub header_print {...}1;My main perl is:#!/usr/bin/perluse CGI qw(:standard);use lib qw(.);eval { require "headers.pl"};if ($@) {\t\tprint "Failed to load require because: $@"}else{print "No problem with require";}header_print{};When the perl runs I successfully get the "No problem with require" suggesting the require worked file but then the perl fails with.."Can't call method "header_print" without a package or object reference at ...pathname...\tline 12--------I am a bit of a beginner at this so I am hoping this is something obvious
VIEWS ON THIS POST

87

Posted on:

Wednesday 7th November 2012
View Replies!

"Enter this obfuscated code before submitting" help needed (CGI)

I need to add one of those "Enter this generated graphic code" keys to an HTML form to stop auto submissions. I'd google it, but I'm not even sure what the industry buzzword to describe these is (heads up appreciated!). Alternatively, if anyone has a pointer to some specific code and/or snippets they like to use, that would be great too.
VIEWS ON THIS POST

73

Posted on:

Wednesday 7th November 2012
View Replies!

looping 2 times through 5000 differs from 5000 times through 2

Hi all, Last week I discovered this perl.beginners group. Good stuff here, albeit many times hard to grasp the answers. But I'm learning. What I would like to understand is why looping 2 times through 5000 lines takes less time ...
VIEWS ON THIS POST

81

Posted on:

Saturday 10th November 2012
View Replies!

how to iterate through a list of files in a directory and compare them to an index.

I here is a sample of the problem I am trying to solve. I have an index.txt file that contains two values separated by a pipe symbol like this: junk_file_test1|test1.pdf junk_file_test2|test2.pdf I slurp the file in, open a directory ...
VIEWS ON THIS POST

73

Posted on:

Saturday 10th November 2012
View Replies!

Return number of keys in a hash of hash? Looping through "sub hash"?

I'd like to get the number of keys in hash of hashes. I know that I can do something like $count = keys( %myHash ), but how would I go about finding the number of keys in a sub-hash Alternately, ...
VIEWS ON THIS POST

52

Posted on:

Saturday 10th November 2012
View Replies!

Help with looping through records

Hi all,Having an issue with looping through the records of a data table and rendering them onto a web page.\tIn this case, there are 4 records in the table.\tThis is the code I'm trying to use:@row = $sth->fetchrow_array;foreach $row (@row){print
VIEWS ON THIS POST

64

Posted on:

Saturday 10th November 2012
View Replies!

using "opendir" through a CGI script on Apache

Greetings all, I'm trying to use the "opendir" command on Win32 in a CGI script. I'm using Apache 2.0.48 for Win32. The "openDir" command works from the CGI script when I try to open a folder located on my local ...
VIEWS ON THIS POST

77

Posted on:

Thursday 15th November 2012
View Replies!

submitting a menu in perl

when I create a menu in a dynamic document using cgi.pm how do I get the menu to submit after someone makes a choice I cant tell if theres something special I have to do or if there is an ...
VIEWS ON THIS POST

59

Posted on:

Thursday 15th November 2012
View Replies!

Mass filename renaming through arrays

, Hoping someone can help me tweak my syntax here. I've got a directory with files named as follows: dave@linux:/tmp/gd65-11-03/mp3s> ls -lC1 gd65-11-03d1t01_vbr.mp3 gd65-11-03d1t02_vbr.mp3 gd65-11-03d1t03_vbr.mp3 gd65-11-03d1t04_vbr.mp3 gd65-11-03d1t05_vbr.mp3 gd65-11-03d1t06_vbr.mp3 I'd like to rename the mp3s based on their actual song names ...
VIEWS ON THIS POST

78

Posted on:

Monday 19th November 2012
View Replies!

problem when submitting a string through a form

, iam havign an issue about a string that when is submittd through a form in index.pl doesnt get back the same as the original you can read here so i wont type everythign form beginning please. PerlMonks tried to ...
VIEWS ON THIS POST

62

Posted on:

Monday 19th November 2012
View Replies!

how to loop through an object?

I understand that a perl object is much like a hash ref, but not the 100% same.For instance, it is easy to loop through a hash ref:CODEif(ref($var) eq 'HASH') {\tforeach my $key (keys(%{$var})) {\t\tprint "Key: $key, Val: $var->{$key}\n";\t}}But I don't know how to loop through an object like:CODEmy $obj = someModuleName->new();If I knew the obj '$obj' has some data members, then I know how to reach it:CODEprint "$obj->{dataMember1}\n"
VIEWS ON THIS POST

62

Posted on:

Saturday 24th November 2012
View Replies!

setting unix command through perl script

Hi , I need to execute the "export CCASE_NO_FILE_HEADER=yes" command through Perl script. What I did is qx(export CCASE_NO_FILE_HEADER=yes); but still the value for CCASE_NO_FILE_HEADER is not getting set to "yes"
VIEWS ON THIS POST

70

Posted on:

Sunday 25th November 2012
View Replies!

Send mail through a secure (SSL) SMTP server.

I need to write a perl script that sends mail via a secure SMTP server. I've tried using Mail::SendEasy, but I don't think it supports SSL. I've tried looking on cpan.org, but I can't seem to find what I'm ...
VIEWS ON THIS POST

55

Posted on:

Sunday 25th November 2012
View Replies!

multi-CPU search through file

Since the perl version is the fastest and it might be useful for others who have a multi-CPU machine and need to search through a text file, I thought others might find this interesting: Wide Finder Project http://www.tbray.org/ongoing/When/20.../30/WF-Results...
VIEWS ON THIS POST

46

Posted on:

Monday 26th November 2012
View Replies!

FAQ 4.63 How do I reset an each() operation part-way through?

This is an excerpt from the latest version perlfaq4.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest ...
VIEWS ON THIS POST

56

Posted on:

Monday 26th November 2012
View Replies!

connecting to mysql through DBI problem

, I have a very interesting problem. I'm connecting to local mysql database using DBI. I can connect and do queries as ordinary user (username 'nick'), but when I connect as root (username 'root', of course :-) ), I get ...
VIEWS ON THIS POST

133

Posted on:

Monday 26th November 2012
View Replies!