At 15:22 12.05.2001 +1030, Daniel Falkenberg wrote: >Hey all, > >Please don't stree to much over this one but, is there an easier way of >writing this?
Ok. I haven't read the thread yet because I want to take a fresh shot at this... so here goes... >while(1){ > if ($status == 1) { > #Do this sub... > sub(); > elsif ($status == 1) { > #Do this other sub... > sub2(); > } else { > #Continue while loop... > } >} while (1) { &sub1 if ( $status == 1 ); &sub2 if ( $status == 2 ); next if ( $status >= 1 or $status <= 2 ); # the rest here.... } That is just one way I would possibly do it. You must have had a typo above there because you have '( $status == 1 )' twice. So, I improvised. Now, I will read the thread and see if I came close to the other gurus. :) - Jim >Can I make it smaller. I want to know this to improve my Perl skills. > >Regards, > >Dan > >-- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] - Jim -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861 -----BEGIN PERL GEEK CODE BLOCK----- ------BEGIN GEEK CODE BLOCK------ Version: 0.01 Version: 3.12 P++>*@$c?P6?R+++>++++@$M GIT/CM/J d++(--) s++:++ a- >++++$O!MA->++++E!> PU-->+++BD C++++(+) UB++++$L++++$S++++$ $C-@D!>++++(-)$S++++@$X?WP+>++++MO!>+++ P++(+)>+++++ L+++(++++)>+++++$ !E* +PP+++>++++n-CO?PO!o >++++G W++(+++) N+ o !K w--- PS---(-)@ PE >*(!)$A-->++++@$Ee---(-)Ev++uL++>*@$uB+ Y+>+++ PGP t+(+++)>+++@ 5- X++ R@ >*@$uS+>*@$uH+uo+w-@$m! tv+ b? DI-(+++) D+++(++) G(++++) ------END PERL GEEK CODE BLOCK------ ------END GEEK CODE BLOCK------ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]