Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Backtracking.pm

by educated_foo (Vicar)
on May 10, 2002 at 15:17 UTC ( #165665=note: print w/ replies, xml ) Need Help??


in reply to Backtracking.pm

If the code is the first argument, you can use a prototype starting with '&', like this:
sub mymap(&@) { ... }
/s

Replies are listed 'Best First'.
Re: Re: Backtracking.pm
by Joost (Canon) on May 10, 2002 at 15:24 UTC
    Damn, i want to use it as the second argument....

    guess i'm out of luck then ?

    -- Joost downtime n. The period during which a system is error-free and immune from user input.
      Yeah. This one has bothered me, too. I suppose you could do something like this (untested):
      sub is(&) { return $_[0] } sub goal { ... } # ... goal 'foo' is { ... }
      but it's not quite as nice. Option 2: write a source filter that takes
      goal mygoal
      and replaces it with
      goal 'mygoal', sub
      That might be a good way to go.

      /s

        Thanks for the tip, I used Filter::Simple, and it seems to do the trick :-)
        -- Joost downtime n. The period during which a system is error-free and immune from user input.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://165665]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2016-06-30 15:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (396 votes). Check out past polls.