Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re^2: Interview Prepration

by jhourcle (Prior)
on Apr 04, 2005 at 03:17 UTC ( #444575=note: print w/replies, xml ) Need Help??

in reply to Re: Interview Prepration
in thread Interview Prepration

3. Explain the difference between use and require.

"use" is at compile time, "require" is at run-time? It's weird how you code and code and only when somebody asks you something you start having questions about it :

use also calls import(). From use:

Imports some semantics into the current package from the named module, generally by aliasing certain subroutine or variable names into your package. It is exactly equivalent to

BEGIN { require Module; import Module LIST; }


8. What is the difference between for & foreach, exec & system?

for & foreach are now an alias to each other (Ok, one of them is implemented, but they're actually the same thing). As for exec & system, I don't use them much, so I'd have to check on documentation (and don't forget backticks, too)

for can be used as an alias for foreach, and visa-versa. But please, please don't use foreach with a C style for loop:

foreach ( loop_init(); exit_test(); increment() ) { ... }

As for exec and system, one of 'em forks, one doesn't. I always forgot which one is which, and look them up, too. (exec never returns, while system does) and sometimes, I just open a pipeline.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2021-06-24 09:28 GMT
Find Nodes?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)

    Results (124 votes). Check out past polls.