develooper Front page | perl.perl6.users | Postings from October 2018

KEEP/UNDO phaser question

Thread Next
From:
Norman Gaywood
Date:
October 27, 2018 23:51
Subject:
KEEP/UNDO phaser question
Message ID:
CAHJ-_U6MZRj_4cBWuZRJNfLxnE8gsPQj5R-cAwHOSLPtYb7qPQ@mail.gmail.com
Just been reading  the latest of Elizabeth's wonderful blog posts on how
phasers work in perl6:
https://opensource.com/article/18/10/how-phasers-work-perl-6?fbclid=IwAR3eJSn5EdJh2DYgpjrFOy7kg-dShuilwQhHDHTANeb4JmHYSBiTz3WyxPA

I have question on the KEEP/UNDO example:
{
    KEEP $dbh.commit;
    UNDO $dbh.rollback;
    ...    # set up a big transaction in a database
    True;  # indicate success
}

Won't that "True;  # indicate success" just force the KEEP phaser to run?
Shouldn't you just use the result of  whatever  is the result of "... # set
up a big transaction in a database"?

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About