When I have something like so:
my $sth = $dbh->prepare(
"
select t.id,t.emp_name,t.emp_email,t.req_status,t.
+date_requested,t.mngr_email,t.date_submitted,
( SELECT
GROUP_CONCAT( (case when req_status = 'Approved' t
+hen emp_name end) separator ', ')
FROM requests s WHERE s.date_requested = t.date_re
+quested)
AS approved
FROM requests t
WHERE req_status = 'Pending'
AND mngr_email = '$filter'
AND date_requested >= '$date'
ORDER BY emp_name,date_requested
"
);
I am wondering what the Perl Best Practices are with regards to long fields applied to an object, and if there is any way for Perl Tidy to automatically clean those up. As it is now, I am doing 'perltidy -pbp input.pl' and it is tidying up everything else, but leaving those areas alone. I want those areas to be tidied up as well :)
Another example, perltidy didn't touch anything in the parentheses:
my $sth = $dbh->prepare(
"
INSERT requests ( emp_name, emp_email, emp_title, mngr_name, m
+ngr_email, date_requested, req_status, date_submitted, approved_by )
VALUES ( '$login_name', '$login_email', '$login_title', '$login_mn
+gr_name', '$login_mngr_email', '$date', 'Pending', '$req_date', '' )
"
);
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.