Notes: The ! after $dbh, in the signature of the TWEAK method makes $dbh argument required. The colon indicates it is a named argument, rather than a positional one.use DBIish; role DB-Connection { has $.dbh; submethod TWEAK( :$dbh! ) { $!dbh = $dbh.isa(DBIish) ?? $dbh !! DBIish.connect( |%$dbh + ); } }
In reply to Re^8: If Perl 5 were to become Perl 7, what (backward-compatible) features would you want to see?
by holli
in thread If Perl 5 were to become Perl 7, what (backward-compatible) features would you want to see?
by haukex
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |