It is bad manners to quote .sigs.
Have you seen thePostingGuidelinesthat are posted here frequently?
Yes. That is why I asked them.
Your code never puts anything into $_ before it copies it to
$firstcopy, so you might as well have
$firstcopy = undef;
instead of
$firstcopy = $_;
You should always enable warnings when developing Perl code.
If the get() succeeds then $_ will not contain undef, and will
probably also not contain the empty string, so
$firstcopy ne $_
will be true every single time.
The code you posted made no sense at all.
My questions were an attempt to draw some sense from it.
If you post a short and complete program *that we can run*, then
we can surely help you solve your problem. If you don't, then
we probably can't.
Have you seen thePostingGuidelinesthat are posted here frequently?
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"- Hide quoted text -
- Show quoted text -
If you post a short and complete program *that we can run*, then
we can surely help you solve your problem. If you don't, then
we probably can't.
OK, so my problem is that I don't have a run-able program; so I may be
better off explaining what I'd like to do and what I've constructed
thus far:
I would like to assign a variable the content of a URL via "get,";
have Perl commit that to memory; then wait for a determined amount of
time; get via "get" the content of the same URL as the one committed
to memory earlier, and then compare the old, memory-committed version
of the URL to the recently retrieved content.
What I have so far is a program commits the two instances of the
retrieved URL and compares them, but I can only print out the second
instance if they are different, not the difference itself.
I've also used File::Compare, but that doesn't yield any results;
perhaps I'm using it wrong; I'm running it from a command prompt on
Windows XP; the following is the program:
#!/usr/bin/perl
use LWP::Simple;
use File::Compare;
$| = 1;
$firstcopy = get("
http://www.google.com");
sleep 10;
$secondcopy = get("
http://www.google.com");
if ($firstcopy ne $secondcopy) {
print ('There has been a content change');
}