Fellow Monks
Given @emails which contains
| id | Name | Email |
| 1 | Barry | some address |
| 2 | dave | another address |
How would i do the following?
(pseudo code)
foreach (row in @emails)
get the email address and put it in $email
so becomes, (just to see)
| Pass number | email |
| 1 | some address |
| 2 | another address |
(im going to send an email using the obtained email address, but i know how to do that)
Barry Carlyon
barry@barrycarlyon.co.uk
My solution
my @emails = LSRfm::Database::MegaList->search_all();
foreach my $record ( @emails ) {
#record is the id number of the entry
#lets fetch this email from the db, then we can stringify
@email = LSRfm::Database::MegaList->search_id($record);
$email = shift(@email);
thanks to davido for the $record idea
I apologize for not making the question clear enough, but I sometimes find it difficult to compose an effective question, usually someone complains/needs for info
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.