> >
> > If I was using one specific group of commands, Could I put 
> them inside a
> > variable, then just use the variable when I needed the 
> commands instead of
> > copying and pasting them?
> >
> > i.e.
> > print "Hello world";
> > if ($i == 50) {
> >     goto MAIN;
> >     }
> > elsif ($t == 100) {
> >     goto SECONDARY;
> >     }
> >
> > as compared to
> >
> > $command =
> > print "Hello world";
> > if ($i == 50) {
> >     goto MAIN;
> >     }
> > elsif ($t == 100) {
> >     goto SECONDARY;
> >     };
> 
> Hi Joel.
> 
> Both your question and your code suggest that you're not
> thinking about your programming solution properly. I
> don't think I've ever seen a Perl script that used 'goto'.
> Not that is the Bad Thing that many people make out, it's
> just usually a non-intuitive way of expressing a solution.
> Also, what you describe is a subroutine, which is simply
> a named piece of code. Have you come from programming BASIC
> by any chance? In its earlier versions BASIC control flow
> was entirely dependent on GOTO <line> and GOSUB <line>, as
> it was based on the syntax of assembler languages.
> 

Don't be too harsh on this guy..  Hey, he has come up with the idea
that statements can be grouped into variables.  Give him a bit of time
and he'll name the variables... Group these variables into 'classes'
of variables, and eventually come up with a scheme to read these groups
of variables containing statements from an external file!

Who *KNOWS* what he might come up with next!  Given time, he may advance
perl!  Heck, I know I havent come up with any new idea's recently.

*grin*

END{
        require sig;
        sig::japh;
}

Can't locate sig.pm in @INC <snip>


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to