OK, sorry, but I have no clue what is causing the problem you are having.
KevinADC 192 Practically a Posting Shark
Sulley's Boo commented: ^,^ +3
OK, sorry, but I have no clue what is causing the problem you are having.
grasping at straws...... try sleep():
$count = 100;
#print $mech -> content;
for ($count = 100; $count <= 500; $count++)
{
print "$count</br> ";
$purl =
"http://www.website.com/servlet/Servlet?pdf=abc$count.pdf";
$mech->get( $purl, ":content_file" => "d:/Devesh/abc$count.pdf");
print "downloading abc$count.pdf</br>";
[B]sleep(1);[/B]
#print $mech->content;
#print "after......</br>";
#print "save $count done</br>";
}
try this maybe:
$count = 200;
#print $mech -> content;
for ($count = 200; $count <= 500; $count++)
{
which will start the file download at 200 instead of 100. See what happens.
Can we see the script or is this going to be a guessing game?
thats because google does not allow you to do what you are trying to do. If you want to hit google use their API.
Is this school work? Do you this question posted on other perl forums? Whats the purpose of including the resID if it's not being used in the output?
in the code I posted, change this line:
print qq~( $long, $lat, time(), $omschrijving, $longneg, $latneg )~;
to:
$sth->execute( $long, $lat, time(), $omschrijving, $longneg, $latneg );
I may have figured it out, try this in place of your existing perl script:
#!/usr/bin/perl -wT
# popchecker.pl
use warnings;
use lib 'd:/www/criens.nl/sailmailscript';
use Mail::POP3Client;
use DBI;
#
$pop3user = 'mailaddress@criens.nl';
$pop3pass = 'password';
$pop3host = "pop.criens.nl";
#
$pop = new Mail::POP3Client( USER => $pop3user,
PASSWORD => $pop3pass,
DEBUG => 1,
AUTH_MODE => PASS,
HOST => $pop3host ) || die "Can't connect";
my $checked = 0;
sub storeurl
{
my $long = $_[0];
my $lat = $_[1];
my $omschrijving = $_[2];
my $longneg = $_[3];
my $latneg = $_[4];
my $headers = shift;
my $dbhostname = 'mysql.criens.nl';
my $dbuser = 'datebase username';
my $dbpwd = 'database password';
my $dbbase = 'database name';
my $dbtabel = 'longlat';
my $sql = "INSERT INTO longlat (longitude, latitude, tijd, omschrijving, longneg, latneg)
VALUES (?, ?, ?, ?, ?, ?)";
my $dbh = DBI->connect( 'dbi:mysql:' . $dbbase, $dbuser,
$dbpwd, { RaiseError => 1 }) || die
"Database connection not made: $DBI::errstr";
my $dbh = DBI->connect ("DBI:mysql:host=mysql.criens.nl;database=name", "name", "password", {PrintError => 0, RaiseError => 1});
my $sth = $dbh->prepare( $sql );
print qq~( $long, $lat, time(), $omschrijving, $longneg, $latneg )~;
$dbh->disconnect();
}
sub main
{
my $find;
my $url;
my $i;
my $longi;
my $lati;
my $longitude;
my $latitude;
my $omschrijving;
my $longneg = 0;
my $latneg = 0;
for ($i = 0 ; $i <= $pop->Count(); $i++)
{
my @FOO = $pop->Body( $i );
$longi = 0;
$lati = 0;
my $blog = 0;
foreach $line (@FOO)
{
if ($line =~ /\[b\]/){
$blog …
I maybe can help if you can clarify what the problem is in more detail. This makes no sense to me:
Here is where the problem lies. The message "b" in brackets is not taken out of the entire mailmessage and the database field is empty.
a little bit of an enigma..... don't let it go to your head ;)
EDIT: that wink smiley looks bad, I am of course just kidding with you
tgreer,
You last post explains alot (http://www.daniweb.com/techtalkforums/post358440-45.html).
I've been in a similar situation in the past and can appreciate your continued interest in somthing you were active in helping to shape and direct. Sometimes those parting of ways are bitter-sweet.
Since you did not have to explain yourself one iota to me, I appreciate that you did. It gives me insight I did not have before.
Regards,
Kevin
Good, so it seems you've answered your own question quite nicely, though I'm sure some would dispute your conclusions. Amazing, what a little research can do!
I think any conclusion I might try and surmise would be incomplete at best. I get the feeling there has been a lot of water under the bridge that I am totally unaware of. I will leave it at that, like I said I was really just curious. I'm not questioning your interest in this website, which seems to be very genuine to me.
I just found you to be a little bit of an enigma is all. But that is explained by my own ignorance about most of what goes on around here. Since I prefer it that way, I probably should not be asking you for any insight anyway.
Anyways, take care, maybe catch you around in the feedback forum from time to time.
Kevin
tgreer,
I don't understand your interest in how daniweb is structured. I had assumed you must be fairly active in the IT forums, but checking your post history, it appears to be 95%+ posting in the feedback forum for several months now.
I went back to Nov 2006 to find your last post in an IT forum (c++ I think it was). I might have missed one or two, but really, your main activity for several months is just posting in the feedback forum.
Am I missing something? You seem to have stoped being a contributing member a while back, at last as far as IT contributions is concerned. I see you have a "team colleague" designation, but I don't know what that signifies.
I am just curious is all, feel free to ignore my comments or tell me to mind my own business. Just seems odd to me that you seem to care that much when you're no longer really active in the IT aspect of daniweb.
Regards,
Kevin
No need to apologize. No, I have no personal axe to grind here. The only source of bitterness is IntelliTXT, a topic I've already exhausted, and which has nothing to do with the concerns about the changing atmosphere and member demographics of Daniweb.
When I say Daniweb has changed for the worse, that the quality of postings has deteriorated, that we're attracting non-technical members, and that the staff seems much more tolerant of all of the above - that's exactly what I mean and the only motive is to let the administration know about the concern, and provide others who might feel the same an opportunity to say "yeah, what he said".
OK, that explains your concerns (to me) much more clearly. That is perfectly reasonable and rational and very understandable.
I get the sense that you are motivated by personal reasons, but what those reasons are I have no clue. Sort of like hearing two people arguing, you can tell they are angry or upset, but you have no idea why. It seems like you are upset about something more than just the quality or quantity of "geek" posts. But maybe not, maybe I am just getting the wrong impression. If I am, my apologies.
Your penchant for hyperbole makes it hard for me to take you seriously. You use words like "pollute" and "desease" to describe the problem as you see it. It makes your opinion seem less than objective, but maybe it is less than objective and that is your point? I honestly don't know.
But I do get the sense of some underlying motive for your comments about the quality of posts and how it affects this forum. I could be totally wrong, I'm just giving you my honest opinion, and maybe my perception of your motivation is wrong, but it comes across as negative and critical instead of helpful or insightful.
is that "all forums" or "this category"? When I look at "all forums" there are mostly IT forums displayed but also feedback and lounge threads.
very good. I noticed this in your code:
closedir ("DIR");
You should remove the double-quotes as DIR is a filehandle. No sense in getting into bad habits. ;)
make your test simple for now:
chdir("C:/Perl/Scripts") || die "Can't chdir to C:/Perl/Scripts: $!";
opendir(DIR,"backuptest") || die "Did not open folder: $!";
my @folders = readdir DIR;
print "$_\n" for @folders;
see what that prints
you can always have the perl script chdir to the folder you are interested in:
chdir('C:/Perl/Scripts/Backuptest') or die "Can't chdir to C:/Perl/Scripts/Backuptest: $!";
Note: its safer to use forward slashes in directory paths, even if you are on windows. Windows supprts forward and back slashes in directory paths.
rmdir($dir) if (-M $dir > 4);
directories have to be empty though to delete them like this. You could write a recursive function to delete all files and sub directories first or use the File::Path module (it's a core module) to delete a directory tree. Or use an operating system command to delete the directory even if not empty.
the code I posted would work in Win32, but it is not complete code.
opendir(DIR,'backup_folder') or die "$!";
my @folders = readdir DIR;
close(DIR);
if(scalar @folders > 4) {
remove_some();
}
elsif (scalar @folders < 4) {
add_some();
}
else {
print "4 folders, do nothing";
}
sub remove_some {
a sub routine to delete some folders
}
sub add_some {
a sub routine to add some folders
}
btw,
this: (\d\d){2}
translates to two digits ina row twice \d\d\d\d
you wanted:
\d{2}\/\d{2}\/\d{2}
what you really want are string anchors (^$):
$result = $start_date =~ /^\d\d\/\d\d\/\d\d$/;
the way you are doing it is checking a sub string, so dd/dd/dd anywhere in the string would match (where "d" is a single digit)
google for:
posix strftime function
you will find plenty of resources that explain the strftime function in detail and POSIX in general.
use Time::Local 'timelocal_nocheck';
use POSIX 'strftime';
my $s_date = '08/01/07';
my $e_date = get_edate($s_date);
print "start date:$s_date, end date: $e_date";
sub get_edate {
my $s_date = shift || return(0);
my ($m,$md,$y) = $s_date =~ m|(\d+)/(\d+)/(\d+)|;
my $epochtime = timelocal_nocheck(0, 0, 0, $md, $m-1, $y);
return strftime("%m/%d/%y",0,0,0,(localtime($epochtime+604800))[3,4,5]);
}
whats the format of the start date?
that really looks like query string data, in which case the CGI module could be used to get you name value pairs into your script for further use.
No Kani,
Actually I m working on a website which works as a webserver.I want that if we write a perl and call it through HTML then while we host this HTML page it is showing the source code of the perl and we don't want that.
I want tht when we code into perl in HTML then it will host the output of the perl.
Take an example suppose we are connecting a database in MySql through perl and hosting tht code through HTML then it should display the contents of the database or the query fired on the database not the source code of the perl.
Obviously you first need perl installed on the server. Then the server has to be configured to execute scripts instead of just returning the text like it would with html documents.
But as far as "hosting the code through html" goes, are you trying to use SSI tags to run scripts? You can do that in pages that the server knows to parse fo SSI tags, normally .shtml or .shtm pages.
Do you mean you want the perl code embedded in the html code (sort of like php)?
Search google for: "embedded perl"
You may want to post on another forum where there could be more members that have experience with this type of thing you are trying. Try perlmonks or devshed.
I believe the error codes are specific to the operating system, so you may have to try and determine what 255 means for your operating system, personally I don't know. Maybe someone else can shed some light on this problem for you.
To run any system application with perl you use:
system()
backtiks: ` `
qx/ /
exec()
but exec exits the perl program. Whcih you use depends on what you are doing.