Reply
Why hash array and not array?
Old 08-10-2007, 02:27 AM Why hash array and not array?
Skilled Talker

Posts: 99
Code:
my(%form);
foreach my $p (param()) {
    $form{$p} = param($p);
}

print "Your name is $form{'name'}<br>\n";
How come you can't do @form instead of %form? don't get it..
Arez20469 is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 08-10-2007, 04:11 AM Re: Why hash array and not array?
tripy's Avatar
Fetchez la vache!

Posts: 2,133
Name: Thierry
Location: In the void
What language is this ?

Asp, coldfusion, jsp ?
Don't looks like php, neither javascript...
__________________
Listen to the ducky: "This is awesome!!!"

tripy is offline
Reply With Quote
View Public Profile
 
Old 08-10-2007, 10:08 AM Re: Why hash array and not array?
Ultra Talker

Posts: 482
It's Perl I assume?

I haven't used Perl in a long time, but I'm guessing that arrays are automatically indexed by integers as opposed to 'anything'. By using the hash array you can use strings as the array indices, too...
__________________
Free PHP Obfuscator
TwistMyArm is offline
Reply With Quote
View Public Profile
 
Old 08-10-2007, 07:54 PM Re: Why hash array and not array?
Skilled Talker

Posts: 99
It's Perl, and I dunno what Twist meant!
Arez20469 is offline
Reply With Quote
View Public Profile
 
Old 08-11-2007, 03:54 AM Re: Why hash array and not array?
chrishirst's Avatar
Super Moderator

Latest Blog Post:
Am I impressed or what?
Posts: 14,834
Location: Blackpool. UK
Quote:
Originally Posted by Arez20469 View Post
It's Perl, and I dunno what Twist meant!
http://www.ebb.org/PickingUpPerl/pickingUpPerl_6.html
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Why hash array and not array?
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.15433 seconds with 12 queries