Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re^4: How to eval an array element in regex's substitution

by aquarium (Curate)
on Oct 27, 2010 at 21:52 UTC ( #867852=note: print w/replies, xml ) Need Help??

in reply to Re^3: How to eval an array element in regex's substitution
in thread How to eval an array element in regex's substitution

yes, i think in this case regex is too much, as it's only a fixed parameter substitution. regex can become easily overused. And when you use a regex you introduce pitfalls. I always go for simple substitution or other string operations first. substr and index functions come in very handy.
regards testing smtp...just in case this is not common knowledge, you can telnet to port 25 on your smtp server and issue commands to send emails, just as a module would. it's great for testing the viability of a particular idea/method...and then you can see if a module can do it or needs some tweaking. For example, you would see that you can send multiple separate emails during one session/connection to smtp server. Mind you, setting up a massively parallel process to send emails isn't going to change much on the smtp server end, which serves a FIFO queue anyway. And using one connection/send/disconnection per email is useful as a unit of measure that one email send completed. I would argue that unless your program needs hours to complete (the bulk email send) that you should just send them one by one. it's also good not to hog/thrash the mail server.
anyway, hope your project is progressing well.
the hardest line to type correctly is: stty erase ^H
  • Comment on Re^4: How to eval an array element in regex's substitution

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (1)
As of 2023-06-04 21:06 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (22 votes). Check out past polls.