niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Programming » Perl
subroutine doesn't seem to run after calling it.
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
Author Message
Paul Lalli
*nix forums Guru


Joined: 10 Jun 2005
Posts: 1089

PostPosted: Tue May 09, 2006 8:19 pm    Post subject: Re: subroutine doesn't seem to run after calling it. Reply with quote

Spin wrote:
Quote:
I am using PerlTray by ActiveState on Perl 5.8 on WinXP.

I have two subs, the one calling the other:

my @anim = qw(idexx idexx1 idexx2 idexx3);
sub Animate {
SetAnimation(20000, 50, @anim);
}

sub Checkport {
if (($loc ne "") && ($loc ne chr(03))) {
SWITCH: {
... couple other switches in here ...
($inbound_message_type eq "T") && do {
Animate();
... and some other stuff ...
}

Yuck. Why not just use the standard if() mechanism? the short-circuit
nature of the logical comparison operators is good for one-statement
expressions (open or die, for example), but looks ugly when used with a
block.

if ($inbound_message_type eq 'T') {
Animate();
#... and some other stuff...
}


Quote:
}
}
}

If I just add the phrase: Animate(); right after the sub it runs fine.
However in the Checkport sub it will not run.

What is your evidence for concluding it "will not run"?

Quote:
I have other code
immediately following the Animate() call that conclusively verifies I
have reached that part of the subroutine and switch.

But you have no such code that conclusively verifies anything about
whether or not Animate() was called. I suggest that it was and that
your assumption that it has not is due to a failure of yours to explain
whatever results you've seen but not told us about.

Put another way, please read the posting guidelines for this group, and
then post a short but COMPLETE script that demonstrates your problem.

Paul Lalli
Back to top
Spin
*nix forums beginner


Joined: 05 May 2005
Posts: 19

PostPosted: Tue May 09, 2006 8:04 pm    Post subject: subroutine doesn't seem to run after calling it. Reply with quote

I am using PerlTray by ActiveState on Perl 5.8 on WinXP.

I have two subs, the one calling the other:

my @anim = qw(idexx idexx1 idexx2 idexx3);
sub Animate {
SetAnimation(20000, 50, @anim);
}

sub Checkport {
if (($loc ne "") && ($loc ne chr(03))) {
SWITCH: {
... couple other switches in here ...
($inbound_message_type eq "T") && do {
Animate();
... and some other stuff ...
}
}
}
}

If I just add the phrase: Animate(); right after the sub it runs fine.
However in the Checkport sub it will not run. I have other code
immediately following the Animate() call that conclusively verifies I
have reached that part of the subroutine and switch.

Checkport() is called from PerlTray's SetTimer() subroutine.

TIA
Spin
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
The time now is Wed Nov 19, 2008 11:40 pm | All times are GMT
navigation Forum index » Programming » Perl
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts subroutine weberw@adelphia.net Perl 6 Thu Jul 20, 2006 9:36 pm
No new posts calling stored procedure using ECPG Jasbinder Bali PostgreSQL 1 Thu Jul 20, 2006 7:53 pm
No new posts Error while calling an Oracle Stored Procedure from VB us... macca Server 5 Thu Jul 20, 2006 9:32 am
No new posts smbmount: 20381: session request to *SMBSERVER failed (No... lunc networking 0 Wed Jul 19, 2006 10:52 am
No new posts Calling stored procedure in PRO C abhi147@gmail.com Tools 1 Wed Jul 19, 2006 5:07 am

Loans | Mortgage Calculator | Books | Debt | Mortgages
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1945s ][ Queries: 20 (0.1243s) ][ GZIP on - Debug on ]