Current location: Hot Scripts Forums » Programming Languages » Perl » returning value?


returning value?

Reply
  #1 (permalink)  
Old 05-08-06, 05:46 AM
jitu_singh jitu_singh is offline
New Member
 
Join Date: May 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
returning value?

hi all,
can anyboby plz tell me why the below code is not returning any values.

#!/usr/bin/perl -w
$a = 2;
$b = 3;
&x();
sub x
{
if ($a == $b){
return 1;
}else{
return 0;
}
}

o/p is blank.
i want the return value.

regards
singh
Reply With Quote
  #2 (permalink)  
Old 05-08-06, 01:20 PM
Chas Chas is offline
Coding Addict
 
Join Date: Oct 2003
Location: California
Posts: 359
Thanks: 0
Thanked 0 Times in 0 Posts
Well, it is returning a value. It's returning 0 in fact. What were you expecting it to return? Also note that you are not trapping the return value. Could that be your problem?

~Charlie
Reply With Quote
  #3 (permalink)  
Old 05-08-06, 01:57 PM
Millennium's Avatar
Millennium Millennium is offline
Wannabe Coder
 
Join Date: Nov 2003
Posts: 136
Thanks: 0
Thanked 0 Times in 0 Posts
this question has been posted/answered on another forum too, and it sure smells of school work.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem returning interest in bankaccount program psi3000 Everything Java 6 03-27-06 01:14 PM
Returning number of results found DetroitGuy PHP 3 07-22-05 08:54 PM
Excel - Checking Access table for query and returning result lapsaj Visual Basic 7 11-26-04 11:19 AM
Function not returning variable! Spreegem PHP 10 10-13-04 02:38 PM
returning partial text from table... dsumpter PHP 6 07-22-04 04:43 PM


All times are GMT -5. The time now is 04:09 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.