RE: Creating PID file

2008-04-26 Thread Michael Barnes
My apologies. I know this is a cross-platform group, and that is fine. However, if you are unable to understand simple Linux terminology, then it is doubtful that you can help answer my question. If the description is nonsense to you, then please don't waste your or my time in an apparent sla

Re: sql and perl

2008-04-26 Thread Richard Lee
J. Peng wrote: First you should learn some basic knowledge about Mysql systems and SQL statement. Before you try to connect to a Mysql server with Perl, you should install Mysql client and DBD::mysql and DBI on your host. Then you could read the document for DBI, and try to program with it. The b

Re: sql and perl

2008-04-26 Thread J. Peng
First you should learn some basic knowledge about Mysql systems and SQL statement. Before you try to connect to a Mysql server with Perl, you should install Mysql client and DBD::mysql and DBI on your host. Then you could read the document for DBI, and try to program with it. The book you mentioned

sql and perl

2008-04-26 Thread Richard Lee
Hello guys, 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? For now, I just plan to go through the book 'mysql and perl for the web' If someone can post some ex

Re: Creating PID file

2008-04-26 Thread J. Peng
On Sun, Apr 27, 2008 at 9:50 AM, J. Peng <[EMAIL PROTECTED]> wrote: > > END { > unlink "/path/program.pid" if $$ = $pid; sorry, it's "==" not "=". unlink "/path/program.pid" if $$ == $pid; This avoid the child (if have) try to delete the pid file when it exits. > } -- J. Peng -

Re: Creating PID file

2008-04-26 Thread J. Peng
On Sun, Apr 27, 2008 at 9:30 AM, Michael Barnes <[EMAIL PROTECTED]> wrote: > So, I need my script to > create a pidfile when it starts. > There's not trick for creating a pid file in Perl. You can say, my $pid = $$; open my $fd,'>', "/path/program.pid" or die $!; print $fd $pid; close $pid or d

Re: Creating PID file

2008-04-26 Thread Rob Dixon
Michael Barnes wrote: > > This may be a bit advanced for a beginner's group, but I need to have my > script create a pidfile. I'm running a monitor app that keeps track of > what is running and notifies me when stuff stops. It does it by > comparing the pid in the pidfile with ps. So, I need my

Creating PID file

2008-04-26 Thread Michael Barnes
This may be a bit advanced for a beginner's group, but I need to have my script create a pidfile. I'm running a monitor app that keeps track of what is running and notifies me when stuff stops. It does it by comparing the pid in the pidfile with ps. So, I need my script to create a pidfile when

Re: the most pupular language - perl

2008-04-26 Thread Octavian Rasnita
This popularity depends on many factors, so a simple comparison is absolutely irrelevant. It depends on the country and region. In my country there almost 0 job offers asking for perl skills. Most of the offers ask for .net, Java, PHP, asp.net, C++, even python, but very few times ask for perl

Re: strings printing bug

2008-04-26 Thread Rob Dixon
[EMAIL PROTECTED] wrote: > The following script is to read 4 consecutive lines at a time from a > file, concatenate the first 3 lines > (with a ", "), and print the result to STDOUT. If the 3 lines aren't > concatenated they print correctly, however > if they are, the result is gibberish. Any sug

Re: Advice on how to approach character translation

2008-04-26 Thread Dr.Ruud
J. Peng schreef: > Dr.Ruud: >> J. Peng: >>> Dr.Ruud: Jenda Krynicky: >@signs = map quotemeta($_) @signs; @signs = map quotemeta($_), @signs; (there was a comma missing) which you could even write as @signs = map quotemeta, @signs; >>> >>> or: >>>

Re: the most pupular language - perl

2008-04-26 Thread Dr.Ruud
"J. Peng" schreef: > I got it from my gmail newsletter, > http://www.odinjobs.com/blogs/careers/entry/perl_php_python_and_ruby > > It seems perl is still the most popular language on internet.:-) I can't understand comparisons based on a search in "job prospects". Perl is often mentioned in sysad

Re: Advice on how to approach character translation

2008-04-26 Thread J. Peng
On Sat, Apr 26, 2008 at 7:54 PM, Dr.Ruud <[EMAIL PROTECTED]> wrote: > J. Peng schreef: > > Dr.Ruud: > >> Jenda Krynicky: > > > >>>@signs = map quotemeta($_) @signs; > >> > >> @signs = map quotemeta($_), @signs; > >> (there was a comma missing) > >> which you could even write as > >

Re: Advice on how to approach character translation

2008-04-26 Thread Dr.Ruud
J. Peng schreef: > Dr.Ruud: >> Jenda Krynicky: >>>@signs = map quotemeta($_) @signs; >> >> @signs = map quotemeta($_), @signs; >> (there was a comma missing) >> which you could even write as >> @signs = map quotemeta, @signs; > > or: > @signs = map { quotemeta } @signs; That i

Re: Advice on how to approach character translation

2008-04-26 Thread J. Peng
On Sat, Apr 26, 2008 at 5:41 PM, Dr.Ruud <[EMAIL PROTECTED]> wrote: > "Jenda Krynicky" schreef: > > > > @signs = map quotemeta($_) @signs; > > @signs = map quotemeta($_), @signs; > > (there was a comma missing) > > which you could even write as > > @signs = map quotemeta, @signs; >

the most pupular language - perl

2008-04-26 Thread J. Peng
I got it from my gmail newsletter, http://www.odinjobs.com/blogs/careers/entry/perl_php_python_and_ruby It seems perl is still the most popular language on internet.:-) -- J. Peng - QQMail Operation Team eMail: [EMAIL PROTECTED] AIM: JeffHua -- To unsubscribe, e-mail: [EMAIL PROTECTED] For add

Re: I guess I don't understand modules

2008-04-26 Thread Chas. Owens
On Sat, Apr 26, 2008 at 1:59 AM, stevem <[EMAIL PROTECTED]> wrote: snip > my $f = Audio::TagLib::FileRef->new("_tune.mp3"); snip > $ft = Audio::Taglib::FileRef->new($f); snip > Can't locate object method "new" via package "Audio::Taglib::FileRef" > (perhaps you forgot to loa

Re: Advice on how to approach character translation

2008-04-26 Thread Dr.Ruud
"Jenda Krynicky" schreef: > @signs = map quotemeta($_) @signs; @signs = map quotemeta($_), @signs; (there was a comma missing) which you could even write as @signs = map quotemeta, @signs; -- Affijn, Ruud "Gewoon is een tijger." sub uniq { my $prev; map

I guess I don't understand modules

2008-04-26 Thread stevem
This bit of test code works as expected: #!/usr/bin/perl use Audio::TagLib; use warnings; use strict; my $f = Audio::TagLib::FileRef->new("_tune.mp3"); my $artist = $f->tag()->artist(); print $artist->toCString(), "\n"; but when I put that line into a subroutine in my program: sub dofile {