Lost Password?

Go Back   CodeCall Programming Forum > Web Development Forum > Perl

Perl Discussion for the PERL language - Practical Extraction and Reporting Language, is a programming language often used for creating CGI programs.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old 03-14-2008, 12:46 AM
KevinADC KevinADC is offline
Learning Programmer
 
Join Date: Jan 2007
Posts: 87
Rep Power: 6
KevinADC is on a distinguished road
Default Re: Need a perl study-buddy

What happens if something besides 1 or 2 is entered as the option?

drop the -w switch from the shebang line. The warnings pragma is better:

use warnings;

Don't use parenthesis around print commands:

print ("You chose option 1. Enter your value below \n\n");

should be:

print "You chose option 1. Enter your value below \n\n";

print is not a function, using parenthesis can sometimes cause problems.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 03-14-2008, 12:52 AM
KevinADC KevinADC is offline
Learning Programmer
 
Join Date: Jan 2007
Posts: 87
Rep Power: 6
KevinADC is on a distinguished road
Default Re: Need a perl study-buddy

declaring the subs at the beginning of the script is also unnecessary:

sub one;
sub two;

You can drop that now before it becomes a bad habit.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 03-15-2008, 04:02 PM
pvpchina pvpchina is offline
Newbie
 
Join Date: Mar 2008
Posts: 9
Rep Power: 0
pvpchina is on a distinguished road
Default Re: Need a perl study-buddy

when should i use

$a = <STDIN>;

and

my $a = <STDIN>;


whats the difference? =)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 03-16-2008, 02:20 PM
KevinADC KevinADC is offline
Learning Programmer
 
Join Date: Jan 2007
Posts: 87
Rep Power: 6
KevinADC is on a distinguished road
Default Re: Need a perl study-buddy

The short answer is you should always use the "strict" pragma and declare all your lexical variables with "my". The use of "strict" is a pretty lengthy topic, here is an article that discusses it more in depth:

perl.com: Beginners Intro to Perl - Part 6

The article is a little old but seems to still be relevant.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15 (permalink)  
Old 03-26-2008, 01:00 PM
KevinADC KevinADC is offline
Learning Programmer
 
Join Date: Jan 2007
Posts: 87
Rep Power: 6
KevinADC is on a distinguished road
Default Re: Need a perl study-buddy

I guess he learned perl already.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #16 (permalink)  
Old 04-16-2008, 12:46 PM
pvpchina pvpchina is offline
Newbie
 
Join Date: Mar 2008
Posts: 9
Rep Power: 0
pvpchina is on a distinguished road
Default Re: Need a perl study-buddy

Quote:
Originally Posted by KevinADC View Post
I guess he learned perl already.
nop...

i failed the course now im doing C A_A!!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #17 (permalink)  
Old Yesterday, 02:41 PM
Sionofdarkness Sionofdarkness is offline
Programming Expert
 
Join Date: Jul 2006
Posts: 385
Rep Power: 10
Sionofdarkness is on a distinguished road
Default Re: Need a perl study-buddy

Failed! You gotta learn to study harder, my friend.
__________________
Make Money Online
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
can someone tell me how to study c# better? yulin11 C# Programming 6 02-24-2008 11:53 PM
Perl text parse help (noob) dfp Perl 4 11-23-2007 01:57 PM
Looking for expert perl freelancer hhheng Request Services (Paid) 1 11-12-2007 04:53 PM
Perl is Dead. Long live Perl. Kernel Programming News 3 08-10-2007 10:49 AM
Perl Tutorial Course for Windows priorityone Perl 22 02-11-2007 12:57 AM


All times are GMT -5. The time now is 01:56 AM.

Contest Stats

dargueta ........ 128.00000
John ........ 127.00000
Xav ........ 107.00000
gaylo565 ........ 18.00000
Johnnyboy ........ 3.00000
navghost ........ 1.00000

Contest Rules

Ads