Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



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

Posts: 99
Trades: 0
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
 
 
Register now for full access!
Old 08-10-2007, 04:11 AM Re: Why hash array and not array?
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
What language is this ?

Asp, coldfusion, jsp ?
Don't looks like php, neither javascript...
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 08-10-2007, 10:08 AM Re: Why hash array and not array?
Ultra Talker

Posts: 483
Trades: 0
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...
__________________

Please login or register to view this content. Registration is FREE
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
Trades: 0
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
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
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!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Why hash array and not array?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.14907 seconds with 12 queries