Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 03-08-2003, 07:42 AM   #1 (permalink)
M3GAPL3X
Code Monkey
 
M3GAPL3X's Avatar
 
Join Date: Mar 2003
Location: California
Posts: 57
M3GAPL3X is on a distinguished road
Send a message via AIM to M3GAPL3X
Nice tutorial tin_man. I just wanted to add some basic things into it.

For arrays, you can use the qw function after the array name if you don't feel like typing all the parenthesis and commas

Ex:
Code:
@stuff = ("book", "table", "lamp");
you could use:

Code:
@stuff = qw(book table lamp);
Same thing goes for hash tables. You could do something like this:
Code:
#!/usr/bin/perl 

%days = qw(
Sun	Sunday
Mon	Monday
Tue	Tuesday
Wed	Wednesday
Thur	Thursday
Fri	Friday
Sat	Saturday
);

print $days{Sun};
I also believe that I found a mistake in tin_man's tutorial. When you access a hash table via the print statement, you have to use a "{}" instead of "()".

Ex:
Code:
print $days{Sun};
__________________
--------------------------
M3GAPL3X@linuxmail.org
M3GAPL3X is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how come i dont hear much about perl Apodysophilia All Other Coding Languages 2 12-16-2003 10:05 AM


All times are GMT -8. The time now is 07:12 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting