Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Short Refactoring Tip: let the object do it for you

by Ovid (Cardinal)
on May 19, 2003 at 21:31 UTC ( #259306=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    if ($po->status->name eq 'Pending') {
        # po can be sent
    if ($po->status->name eq 'Pending' || $po->status->name eq 'Sent') {
        # po can be cancelled
  2. or download this
    if ($po->can_send) {
        # po can be sent
    if ($po->can_cancel) {
        # po can be cancelled

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://259306]
Front-paged by diotalevi
[thezip]: So, we have a small deployment coming up soon for a project. What is the general name for the project management documentation that details the tasks and schedules/ sequences for the execution of the deployment?
[thezip]: Deployment checklist?

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2017-02-23 17:45 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (350 votes). Check out past polls.