Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^4: Executing a string as a Perl command

by Jenda (Abbot)
on May 11, 2011 at 21:10 UTC ( #904251=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Executing a string as a Perl command
in thread Executing a string as a Perl command

Depends. If the variable contains a short string, then the slow down will be negligible. If it contains a number and the subroutine needs to do some more computations, then you've just forced perl to convert the number to a string and back. If nothing more, it's wasteful.

Then there is yet another case. What if the variable contains a huge string? You've just made yet another copy ...

Jenda
Enoch was right!
Enjoy the last years of Rome.


Comment on Re^4: Executing a string as a Perl command
Re^5: Executing a string as a Perl command
by petdance (Parson) on May 13, 2011 at 22:08 UTC
    If it contains a number and the subroutine needs to do some more computations, then you've just forced perl to convert the number to a string and back.

    Which is still negligible, especially when one is about to spawn another process.

    xoxo,
    Andy

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2015-07-02 05:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (29 votes), past polls