Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re^5: Help Changing use into require/import

by Corion (Pope)
on Mar 08, 2018 at 13:50 UTC ( #1210514=note: print w/replies, xml ) Need Help??

in reply to Re^4: Help Changing use into require/import
in thread Help Changing use into require/import

Just use require Capture::Tiny at runtime, like you already did in your code.

The thing you are missing is that Perl doesn't know that capture should become a function. You can either try to predeclare capture as subroutine to tell that you expect a capture subroutine:

sub capture(&@); ... require Capture::Tiny; Capture::Tiny->import('capture'); capture { } ...;

Or go the more explicit route of calling capture in a way that doesn't need parser gymnastics:

capture( sub { ... }, ... );

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1210514]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (12)
As of 2018-07-23 13:21 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (466 votes). Check out past polls.