Re: Please help critcize and shorten my sub code

2008-05-11 Thread Rob Dixon
Jenda Krynicky wrote: > > Only the loops that need to be labeled should be labeled. I agree. Apart from your spelling of 'labelled' :) Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Please help critcize and shorten my sub code

2008-05-11 Thread Jenda Krynicky
From: Peter Scott <[EMAIL PROTECTED]> > On Sun, 11 May 2008 02:05:06 +0200, Jenda Krynicky wrote: > > You do not need the label unless you need to jump out of some other > > loop than the innermost. In this case there are no nested loops so it > > would probably be better to skip the label. > >

Re: Please help critcize and shorten my sub code

2008-05-11 Thread Peter Scott
On Sun, 11 May 2008 02:05:06 +0200, Jenda Krynicky wrote: > You do not need the label unless you need to jump out of some other > loop than the innermost. In this case there are no nested loops so it > would probably be better to skip the label. While I personally program the way you suggest, ta

Re: Please help critcize and shorten my sub code

2008-05-10 Thread Richard Lee
Jenda Krynicky wrote: From: Richard Lee <[EMAIL PROTECTED]> Jenda Krynicky wrote: You may do something like this: for my $wanted ( [outsideroute_group_m => route_name => \$routename, route_group_id => \$routegroupid], [outsideroute_trunk_m => route_group_id => \$routeg

Re: Please help critcize and shorten my sub code

2008-05-10 Thread Jenda Krynicky
From: Richard Lee <[EMAIL PROTECTED]> > Jenda Krynicky wrote: > > You may do something like this: > > > > for my $wanted ( > > [outsideroute_group_m => route_name => \$routename, > > route_group_id => \$routegroupid], > > [outsideroute_trunk_m => route_group_id => \$routegroupid,

Re: Please help critcize and shorten my sub code

2008-05-10 Thread Richard Lee
Jenda Krynicky wrote: From: Richard Lee <[EMAIL PROTECTED]> I dont know how to go through the array over and over again pending on my previous search so I ended up writing it like below which works.. but looks really really inefficient.. sub dd_fact { my $routename

Re: Please help critcize and shorten my sub code

2008-05-10 Thread Jenda Krynicky
From: Richard Lee <[EMAIL PROTECTED]> > I dont know how to go through the array over and over again pending on > my previous search so I ended up writing it like below which works.. but > looks really really > inefficient.. > > > sub dd_fact { > my $routename = shift; >

Please help critcize and shorten my sub code

2008-05-10 Thread Richard Lee
I dont know how to go through the array over and over again pending on my previous search so I ended up writing it like below which works.. but looks really really inefficient.. sub dd_fact { my $routename = shift; my $routegroupid; my $trunkgroupid; my $carriername; my $ca