[ create a new paste ] login | about

Link: http://codepad.org/oJ7GfdZk    [ raw code | output | fork ]

cowens - Perl, pasted on Sep 7:
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/perl

use strict;
use warnings;


my $time = time;
sub f { localtime $time }
my %h = ( scalar f() => 1 );
print grep { defined } @h{+f} ? "not this" : "this prints", "\n";
print grep { defined } $h{+f} ? "this prints" : "not this", "\n";


Output:
1
2
3
Scalar value @h{+f} better written as $h{+f} at t.pl line 10.
this prints
this prints


Create a new paste based on this one


Comments: