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

Re: Quickly changing a function under test in Test::More

by gube (Parson)
on Mar 09, 2006 at 14:18 UTC ( [id://535389]=note: print w/replies, xml ) Need Help??


in reply to Quickly changing a function under test in Test::More

Hi try this,

#!/usr/local/bin/perl use strict; use warnings; use Data::Dumper; my %commands = ( 'command1' => { 'description' => "Does something", 'function' => sub { my $var = shift; return "var = $var\n" } } ); my $cmd = 'command1'; print $commands{$cmd}{'function'}->("hello");

It's reference part, to learn more about reference, go through perlref link, above given by duff.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-23 20:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found