Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Understanding the benefit of Given/When ...

by LanX (Chancellor)
on Mar 04, 2010 at 14:44 UTC ( #826710=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use feature "switch";
     
    ...
     
    # whats the point of implicit smartmatch if only scalars can be testet
    +??? smartmatchingan array is different
    print "\nBUT: def ~~ \@test!" if @test ~~ /def/;
    
  2. or download this
    === Given/When    
    GIVEN(abc):    abc    default    
    ...
    = GIVEN(\@test):
        whats tested is:    ARRAY(0x8a08a38)    default    
    BUT: def ~~ @test!
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://826710]
Approved by Corion
Front-paged by jrsimmon
help
Chatterbox?
[1nickt]: For multiple dirs use iterator(): $it = path("/foo")-> iterator; while ( my $path = $it->() ) {...}
[1nickt]: (also skips . and .. automatically, and follows subdirs if you set <c\>recurse => 1</c>
[1nickt]: $it = path("/foo")-> iterator(recurse => 1 );

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (13)
As of 2017-03-28 18:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (340 votes). Check out past polls.