ilovechristy has asked for the wisdom of the Perl Monks concerning the following question:
if (my @entries = $html->content =~ /<h2><a href="\/entry.*?<br \/>\s+ +?<br \/>/gs) { @entries = reverse @entries; foreach my $entry (@entries) { $entry =~ /<h2><a href="\/entry\/(\d+)\/"/; my $currentstoryid = $1; my $exists; &find(\&wanted, $sitedir); sub wanted { if (/$currentstoryid/) { $exists = 1; return $exists; } } if ($exists) { my $datedir = strftime "%Y/%m/%d", localtime; my $freshentry="$sitedir/$datedir/$currentstoryid.txt"; print " Creating ", $freshentry, "\n"; system ("mkdir", "-p", "$sitedir/$datedir"); open(NEWSTORY, ">> $freshentry"); print NEWSTORY "<font color=\"#dd3333\">$site</font>\n +"; print NEWSTORY "$entry\n"; close (NEWSTORY); } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: file::find subroutine not getting new values
by sgifford (Prior) on May 18, 2004 at 16:25 UTC | |
by ilovechristy (Novice) on May 18, 2004 at 18:45 UTC |