Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

perlpie's scratchpad

by perlpie (Beadle)
on Aug 12, 2010 at 02:08 UTC ( [id://854550]=scratchpad: print w/replies, xml ) Need Help??

# for Lady_Aleena sub flush_movie { my $title = $_[0]->{'em'}; my $id = exists $movies{$title} ? "$title $year" : $title; my $imdb = join('',grep(m/imdb/,@{$_[0]->{'a'}})); $imdb =~ s/http:\/\/www\.imdb\.com\/title\/tt(.*)\//$1/; $movies{$id}{id} = ucfirst $id; $movies{$id}{imdb} = $imdb; } for my $movie (sort {$movies{$a}{id} cmp $movies{$b}{id}} keys %movies +) { my $id = $movies{$movie}{id}; my $title = $movies{$movie}{title}; my $imdb = $movies{$movie}{imdb}; print "$id|$imdb\n"; } sub flush_movie { my $title = $_[0]->{'em'}; my $id = exists $movies{$title} ? "$title $year" : $title; $movies{$id}{id} = ucfirst $id; $movies{$id}{title} = $id eq $title ? '' : $title; $movies{$id}{imdb} = join('',grep(m/imdb/,@{$_[0]->{'a'}})); $movies{$id}{imdb} =~ s/http:\/\/www\.imdb\.com\/title\/tt(.*)\//$ +1/; } for my $movie (sort {$movies{$a}{id} cmp $movies{$b}{id}} keys %movies +) { print "$movies{$movie}{id}|$movies{$movie}{title}|$movies{$movie}{ +imdb}\n"; } sub flush_movie { my $title = $_[0]->{'em'}; my $id = exists $movies{$title} ? "$title $year" : $title; $movies{$id}{id} = ucfirst $id; $movies{$id}{title} = $id eq $title ? '' : $title; ($movies{$id}{imdb} = join('',grep(m/imdb/,@{$_[0]->{'a'}}))) =~ s/http:\/\/www\.imdb\.com\/title\/tt(.*)\//$1/; } print map {"$movies{$_}{id}|$movies{$_}{title}|$movies{$_}{imdb}\n"} sort {$movies{$a}{id} cmp $movies{$b}{id}} keys %movies; sub flush_movie { my $title = $_[0]->{'em'}; my $id = exists $movies{$title} ? "$title $year" : $title; $movies{$id}{id} = ucfirst $id; $movies{$id}{title} = $id eq $title ? '' : $title; ($movies{$id}{imdb} = join('',grep(m/imdb/,@{$_[0]->{'a'}}))) =~ s/http:\/\/www\.imdb\.com\/title\/tt(.*)\//$1/; } print map {join('|', @{$movies{$_}}{qw{id title imdb}})."\n"} sort {$movies{$a}{id} cmp $movies{$b}{id}} keys %movies;
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-24 20:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found