Help Help Help!!! 
Author Message
 Help Help Help!!!

My web programming prof at LSU assigned us the task of writing a cgi perl
script which reads a name (2 words) from an html form, manipulates the
string, and sends back to the http processor some html code about the
string.   Are you with me so far??   What he wants us to do with the string
is 1) print out the number of characters and 2) sort the string in ascending
order (i.e. 'James' comes back as 'aeJms').  Seems easy enough.  The problem
I'm having is the array I've set up to receive the string evidentally can
not be sorted.  As you can see I have set up a dummy array within the script
which does allow the join and sort functions.  Why won't the array I am
using for the name string allow join and sort??

Any help you can provide is greatly appreciated....

Regards, JD

#!/usr/local/bin/perl
use CGI standard;
$co = new CGI;

print $co->header,
$co->start_html(
 -title=>'CGI Script Assignment',
 -author=>'JD',
 -meta=>{'keywords'=>'CGI Assignment'},
);
#$co->center($co->h2('xxxxxxxxxxxxxxxxx')),
#$co->h4('xxxxxxxxxxxxx'),
#$co->hr;

if($co->param()) {


print $num[1];
print $num[3];
print $num[4];
print $num[0], $co->p;




print $name[1];
print $name[4];
print $name[6];
print $name[10], $co->p;


Quote:
}

$co->hr;
$co->end_html;


Wed, 08 May 2002 03:00:00 GMT  
 Help Help Help!!!
On Sat, 20 Nov 1999 20:04:57 -0600, "JAMES DELLER"

Quote:

>My web programming prof at LSU assigned us the task of writing a cgi perl

...

At least you are honest enough to admit this is a homework assignment!

Quote:
> The problem
>I'm having is the array I've set up to receive the string evidentally can
>not be sorted.  As you can see I have set up a dummy array within the script
>which does allow the join and sort functions.  Why won't the array I am
>using for the name string allow join and sort??
...


...
There's your problem,  what you have is the entire string in $name[0].
You need to split the string so each array entry only has one
character, then sort it:

...
Learn to use the Perl de{*filter*}, you can see exactly what's going on.

Schnoodlewinks-constantly leveling up warrior
Fluffy_the_Fly-lvl.7 warrior (x2-don't ask!)
Flame-QFG5 Paladin



Wed, 08 May 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. HELP HELP HELP HELP HELP

2. ****** HELP HELP HELP ******

3. Help Help Help!!!!

4. help help help please!!!!

5. HELP HELP HELP!!! - with function call parameters

6. Help Help Help!!!

7. DBD on HP-UX10.01 HELP!HELP!HELP!HELP!PLEASE!!!

8. DBD on HP-UX10.01 HELP!HELP!HELP!HELP!PLEASE!!!

9. Help, Help, Help... This is killing me...

10. help .. help help

11. Help...Help, install failed, please help!!

12. Help Help Please Help !

 

 
Powered by phpBB® Forum Software