Hi, I am designing a small demo application using perl:cgi on webserver lighthttpd. I am new to CGI programming and do not have any idea of using sessions and ...
I wrote the following code to alphabetize a word: sub alphabetize { my $word = uc(shift); my $wordlen = length($word); my @letters; for (my $i = 0; $i < length...
If what you are looking for is a list of the letters in a word, in alphabetical order, then you want something like: perl -e ' $word="alphabetize"; @array=...
As for returning it as a string instead of an array of characters, look at the "join" function. With it, you can explicitly return a string. -David Sent via...
to get your array in a string, try the join command: my $letters = join "", @letters; ... I wrote the following code to alphabetize a word: sub alphabetize { ...
Louis-Philippe
l0u1sph1l1ppe@...
Sep 5, 2007 2:07 pm
25685
Which gets us to the oneliner: perl -e ' $word="alphabetize"; print join "", (sort split ( //, $word)), "\n"' ... ...
What does the pattern " //" break down to? I'm somewhat familiar with regular expressions and don't know what a forward slash does. I would have guessed the...
The slashes delimit a regular expression. In this case, the regexp is empty. Using an empty regular expression for the split means that each character will...
Ah, thanks. Neat little trick. Well I finished my first complete working version of the code and is a bit sluggish. Though this is expected since the input...
... Ryan> Ah, thanks. Neat little trick. Well I finished my first complete working Ryan> version of the code and is a bit sluggish. Though this is expected...
Ah, excellent. However, allow my noobness to kick in. Alright so you want me to create a hash that contains the entire list of words (values) associated with...
Can someone please help me understand what is being explained here? I thought I understood it after looking at it a second time but the part that confuses me...
I have the following code for pushing a new value onto my hash: my %buckets; push(@{ $buckets{"KEYNAME"} }, "new value"); my @keys = keys %buckets; my @values...
... With use strict; use warnings; you get the hint that you are not using Perl properly. Scalar value @keys[0] better written as $keys[0] at t.pl line 10. ...
Dear all, I have prepared one small application in cgi perl. I want to use login, logout etc through mysql. although i am able to authenticate the user but...
- OK then. - Because then it's all backwards. - Why is that? - Please don't top-post! ... Declare the %bucket hash. It's not initialized to anything, but will ...
I'm dong a for loop and using the number count to assign as part of the hash key. The test print inside the sub program work fine, but outside the program it...
Disregard I found it, I had a hidden character in my assignment line. I've found that vi does that when you have fat fingers. ... Don Dukelow HP UNIX OVO...
Hi, how can I capture the IP address of a user filling in a HTML form. The backend procesing is using Perl. I dont know what modules are installed by the ISP....
OO OO I know! sorta It's an ENV command something like $IP = ENV{Remote_User} google ENV or "Enviroment HTML" Lou the complete newbe! ... From: "zen_e_boy"...
You can check the modules installed. Check the link http://www.mimedefang.org/kwiki/index.cgi?PerlModulesINFO or use this script on web page 1. #!/usr/bin/perl...
Allo! ... For the visitor IP: $ENV{'REMOTE_ADDR'} If you need to have a listing of all environenet variable do the following: foreach $key (sort keys %ENV) ...
Thanks for your replies, I'll give them a go over the weekend. I also found a way of doing it in Javascript that I could quite easily pass back via a hidden...
... zen> Thanks for your replies, I'll give them a go over the weekend. zen> I also found a way of doing it in Javascript that I could quite easily zen> pass...
Why do I care... I am writing an online game and I at looking for ways to prevent cheating... 1-Cookies 2-Same (or similar IP address?) 3-Small program on the...