Created
November 7, 2009 14:32
-
-
Save kidd/228718 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use warnings; | |
use strict; | |
use Data::Dumper; | |
my $l; | |
open my $fh, '<', shift || $0; | |
while(<$fh>){ | |
$l = $_ if /say/; | |
}; | |
print "$l\n"; | |
my %h; | |
$h{goatse}=()= $l =~ /( )/g; #4. force list context and then, scalar context | |
($h{match}) = $l =~ /( )/g; #' '.list context but only assigning the first result | |
(@{$h{array}}) = $l =~ /( )/g; #[' ',' ',' ',' ']. list context | |
@{$h{array2}} = $l =~ /( )/g;#[' ',' ',' ',' ']. list context | |
$h{bool} = $l =~ /( )/g; #1. true / false | |
print Dumper \%h; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment