|
|
|
running for beginners Creating PID file
|
|
|
#make sure the last thing done is the removal of the pidfile #note: this happens even if we die END { our $program; un_link_( /var/run/$program ) or die could not delete /var/run/$program ; } As I have said (in fact it's said by Lincoln Stein), you should add a if statement here to avoid the childs delete the pid file when they're exiting. if ( $$ == $pid ) { # $pid is parent's pid un_link_ $pidfile or die $!; snip If the code forks (without an exec), then this is a good point.
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|
|
|
running for beginners Creating PID file
|
|
Hi, You didn't say if you are running Windows, Linux or something else... If you have Linux, you probably already have perl. If you use Windows, get and install perl from www.activestate.com. You must also get and install MySQL from www.mysql.com if you don't have it installed. Then you need to install the modules DBI and DBD::mysql using (under Unix/Linux): $ cpan cpan install DBI cpan install DBD::mysql or cpan force install DBD::mysql Then you could read more about these modules using: $ perldoc DBI $ perldoc DBD::mysql and you can start using them like: my $dbh = DBI-connect( dbi:mysql:data_base_=test , username , thePassword ); #Create a table $dbh-do( create table foo(id int unsigned not null autoincrement primary key, body text) ); #Insert a few rows my $sth = $dbh-prepare( insert into foo(id, body) values(?, ?) ); my @bodies = qw/foo bar baz/; foreach my $body(@bodies) { $sth-execute(undef, $body); } #select a row my $sth2 = $dbh-prepare( select id, body from foo where id=? ); $sth2-execute(3); my ($id, $body) = $sth2-fetchrow_array; You will find many ways of using DBI from the POD doc. HTH. Octavian
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|
|
|
running for beginners Creating PID file
|
|
|
- Ukryj cytowany tekst -- Pokaż cytowany tekst -
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|
|
|
running for beginners Creating PID file
|
|
|
I don't change lists very often. I am a member of quite a few mailing lists. But I have never been treated like this on any list before. I guess my original assumption was right, This may be a bit advanced for a beginner's group. Your problem is trivial compared to many that are posed here. I am sorry that you were upset by my reply, but I had no intention of being offensive and I would suggest that you misinterpreted what I wrote. You are certainly over-sensitive about being criticized for your choice of platform, as it is hard to read that into my words. If you choose to stay then we will to our best to help, but I hope your will bear in mind at least the spirit of what I have written here. If you go elsewhere for assistance then I wish you well. Rob
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|
|
|
running for beginners Creating PID file
|
|
|
I want to start learning about sql and how it interacts w/ perl. My rough idea is to install mysql server and read some books to start playing w/ it along w/ perl. Any advice? Consider SQLite too.
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|
|
|
running for beginners Creating PID file
|
|
|
Your posting is a reply to a posting that it has nothing to do with. Next time just start fresh. Yes indeed. It may seem like a simple way to make a new post to the group, but if you start by creating a reply and emptying the content, those of us with email clients that display threads correctly will see it as a reply to an irrelevant thread. It isn't hard to create a fresh email for a new subject. Rob
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|