Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: execute a string as a function

by CountZero (Bishop)
on Aug 06, 2013 at 16:21 UTC ( #1048139=note: print w/ replies, xml ) Need Help??


in reply to execute a string as a function

And don't call your subroutines with the '&' added to its name. It has certain side-effects you do not need.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics


Comment on Re: execute a string as a function
Download Code
Re^2: execute a string as a function
by marinersk (Chaplain) on Aug 06, 2013 at 21:29 UTC
    I'll bite.

    What side-effects?

      perlsub
        &NAME(LIST);   # Circumvent prototypes.
        &NAME;         # Makes current @_ visible to called subroutine.
      
      
        cute, where are the sideffects?
        &unpack_c( $lines[$_] ) ; VERSUS unpack_c( $lines[$_] ) ;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (12)
As of 2014-11-26 09:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (165 votes), past polls