Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
There's more than one way to do things
 
PerlMonks  

Re: Re: Clearing user defined variables

by Wassercrats
on Apr 13, 2004 at 07:28 UTC ( #344644=note: print w/ replies, xml ) Need Help??


in reply to Re: Clearing user defined variables
in thread Clearing user defined variables

I don't like the limitations of scoping my variables. Aren't there pleantly of lower level language that don't even offer that feature? That never bothered me. It seems like it would just slow me down. It's too late for that now anyway.


Comment on Re: Re: Clearing user defined variables
Re: Re: Re: Clearing user defined variables
by matija (Priest) on Apr 13, 2004 at 07:40 UTC
    Aren't there pleantly of lower level language that don't even offer that feature? Well, there's assembler, and ... uf - that's pretty much it, unless you count stack oriented languages like forth and postscript where the concept doesn't even exist.

    And we program in Perl, because it is better than those low-level languages. One of the ways it is better is scoped variables.

    If you think non-scoped variables don't bother you, try this experiment: rewrite your 3200 line script to use scoped variables (if you're such a hot coder the non-scoped variables never bothered you, this should be peanuts to you). Then maintain both versions for a month, adding the same features to each version. I'm betting you will find maintaining the scoped version much easier.

      Actually, assembly is not the only "language" without locals, basic had no locals for ages and programmers didn't miss them (it's actually easier to have local variables in most machine-code then in basic).

      However, in Perl, you should use my variables. You just put the whole script in

      RUN: {{ .... }}
      and declare evry variable as my inside the braces, and just redo RUN when needed.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://344644]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2014-04-20 13:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls