[16158] in Perl-Users-Digest
Perl-Users Digest, Issue: 3570 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 10 16:58:09 2000
Date: Mon, 10 Jul 2000 13:57:56 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <963262676-v9-i3570@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 10 Jul 2000 Volume: 9 Number: 3570
Today's topics:
Re: How do I tell PERL to create a new directory in Win <lauren_smith13@hotmail.com>
Re: How do I tell PERL to create a new directory in Win <debjit@oyeindia.com>
Re: How do I tell PERL to create a new directory in Win (sky)
Re: How do I tell PERL to create a new directory in Win (Villy Kruse)
Re: How do I tell PERL to create a new directory in Win (Bart Lateur)
Re: How to change Solaris user password (Peter McMorran)
How to do an intermediary module ? <jhraigniac@freesurf.fr>
Re: How to do an intermediary module ? (Tad McClellan)
Re: How to do an intermediary module ? <jhraigniac@freesurf.fr>
how to find day of week without using modules <andreasbuykx@mailandnews.com>
Re: how to find day of week without using modules <Peter.Dintelmann@dresdner-bank.com>
Re: how to find day of week without using modules <andreasbuykx@mailandnews.com>
Re: how to find day of week without using modules <gellyfish@gellyfish.com>
Re: how to find day of week without using modules (Bart Lateur)
Re: how to find day of week without using modules (Craig Berry)
Re: how to get text enclosed by matching () ? <ronr@my-deja.com>
Re: how to get text enclosed by matching () ? <bwalton@rochester.rr.com>
Re: how to get text enclosed by matching () ? (Bart Lateur)
Re: how to get text enclosed by matching () ? (M.J.T. Guy)
Re: how to get text enclosed by matching () ? <ronr@my-deja.com>
how to implement timer for watchdog tony_barratt@my-deja.com
how to launch multiple processes? <johnston.p@worldnet.att.net>
Re: how to launch multiple processes? <foo@bar.va>
Re: how to launch multiple processes? <gellyfish@gellyfish.com>
Re: How to open redirect and open new browser at same t <s0218327@unix1.cc.ysu.edu>
How to parse string and cut after last slash?? <mmitchelson@yahoo.com>
Re: How to parse string and cut after last slash?? (brian d foy)
Re: How to parse string and cut after last slash?? (Bernard El-Hagin)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 6 Jul 2000 14:00:04 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: How do I tell PERL to create a new directory in Win32?
Message-Id: <8k2s1f$ia$1@brokaw.wa.com>
Dilbert <null@null.com> wrote in message news:145643484@NEWS.SAIC.COM...
> Can anyone tell me how to get PERL for Win32 to create a new directory?
The
> 'mkdir()' function doesn't seem to work. Possibly because it issues a
UNIX
> command?
Possibly you aren't reading the error messages?
#!perl -w
mkdir "MyDir", '0777' or die "MyDir: $!";
perldoc -f mkdir
Lauren
------------------------------
Date: Fri, 7 Jul 2000 10:41:00 +0530
From: "Debjit" <debjit@oyeindia.com>
Subject: Re: How do I tell PERL to create a new directory in Win32?
Message-Id: <8k4tm1$ebr$1@news.vsnl.net.in>
mkdir 'mkdir',0755 or die "cannot create directory stopped: $!";
is happily creating directory in my win98 box!
after runnin the script dir comman
MKDIR <DIR> 07-07-00 10:29a mkdir
Dilbert wrote in message <145643484@NEWS.SAIC.COM>...
>Can anyone tell me how to get PERL for Win32 to create a new directory?
The
>'mkdir()' function doesn't seem to work. Possibly because it issues a UNIX
>command?
>
>Thanks,
>
>Dilbert
>
>
------------------------------
Date: 08 Jul 2000 03:13:58 GMT
From: tbsky.bbs@openbazaar.net (sky)
Subject: Re: How do I tell PERL to create a new directory in Win32?
Message-Id: <3bJi2M$UuS@openbazaar.net>
※ 引述《lauren_smith13@hotmail.com (Lauren Smith)》之銘言:
> Dilbert <null@null.com> wrote in message news:145643484@NEWS.SAIC.COM...
> > Can anyone tell me how to get PERL for Win32 to create a new directory?
> The
> > 'mkdir()' function doesn't seem to work. Possibly because it issues a
> UNIX
> > command?
> Possibly you aren't reading the error messages?
> #!perl -w
> mkdir "MyDir", '0777' or die "MyDir: $!";
> perldoc -f mkdir
> Lauren
i never got success when using this kind of command.
i use linux and hp-ux.
mkdir "Mydir",'0777'
this command won't set the directory permission to "0777"
i don't know how to create directory with the permissions
i want...
can anyone tell me how to do this?
thanks for u help !!!
--
[1;32m※ Origin: [33m網路邊攤 [37m<linux.twbbs.org> [m
[1;31m◆ From: [36mreverse-105-142.unicap.com.tw[m
------------------------------
Date: 10 Jul 2000 08:15:02 GMT
From: vek@pharmnl.ohout.pharmapartners.nl (Villy Kruse)
Subject: Re: How do I tell PERL to create a new directory in Win32?
Message-Id: <slrn8mj1g6.2e.vek@pharmnl.ohout.pharmapartners.nl>
On 08 Jul 2000 03:13:58 GMT, sky <tbsky.bbs@openbazaar.net> wrote:
>※ 引述《lauren_smith13@hotmail.com (Lauren Smith)》之銘言:
>> Dilbert <null@null.com> wrote in message news:145643484@NEWS.SAIC.COM...
>> > Can anyone tell me how to get PERL for Win32 to create a new directory?
>> The
>> > 'mkdir()' function doesn't seem to work. Possibly because it issues a
>> UNIX
>> > command?
>> Possibly you aren't reading the error messages?
>> #!perl -w
>> mkdir "MyDir", '0777' or die "MyDir: $!";
>> perldoc -f mkdir
>> Lauren
>
> i never got success when using this kind of command.
> i use linux and hp-ux.
> mkdir "Mydir",'0777'
> this command won't set the directory permission to "0777"
> i don't know how to create directory with the permissions
> i want...
> can anyone tell me how to do this?
> thanks for u help !!!
And what is your umask value. This umask can be set in your shell profile
and defines some bits which should be subtracted from all creation modes
when you create files or directories. If umask is 022 then when
you create a directory with permissions you get 755 because of the unask.
There should be a umask procedure in the POSIX module, which can be used
to modify it.
Villy
------------------------------
Date: Mon, 10 Jul 2000 11:25:59 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: How do I tell PERL to create a new directory in Win32?
Message-Id: <3969b27f.15413163@news.skynet.be>
sky wrote:
> mkdir "Mydir",'0777'
> this command won't set the directory permission to "0777"
That is because 0777 != '0777';
As a string, converted to a number, the digits are treated as decimal,
so '0777' == 777!
Just don't use the quotes.
mkdir "Mydir", 0777;
--
Bart.
------------------------------
Date: Thu, 06 Jul 2000 00:40:44 GMT
From: mcmorran@visi.net (Peter McMorran)
Subject: Re: How to change Solaris user password
Message-Id: <3963d588$2$zpzbeena$mr2ice@news.visi.net>
Hello Alex,
In <8jpv4b$ck4$1@nnrp1.deja.com>, on 07/03/00
at 11:58 AM, alexyuen2092@my-deja.com said:
>In article <8jdvb9$gn8$1@orpheus.gellyfish.com>,
> Jonathan Stowe <gellyfish@gellyfish.com> wrote:
>> On Wed, 28 Jun 2000 09:15:24 GMT alexyuen2092@my-deja.com wrote:
>> >
>> > I am working with Netscape Enterprise Server and would like to
>> > implement some forms of security with Solaris Build-in security.
>> > However, I would like if there's any programs/scripts that allow
>user
>> > to change their own password in Solaris.
>> >
>>
>> I find the passwd program usually suffices
>>
>Thanks. Sorry for making confusion. I know I could do that in
>Solaris with the "passwd" but how could a remote user make use
>of the WEB-based interface (cgi, JSP etc) to change his/her
>password in the Solaris box. Any samples scripts/programs in
>doing so?
>Thanks again.
>Alex
I think that the basic answer is "no way". That's really a
Solaris issue, and it is pretty protective of its passwords. If
the users are only connecting through the web, why do they need
Solaris logins and passwords at all? If they are logging in
directly, they can change passwords when they do log in.
Cheers,
Peter
--
-----------------------------------------------------------
mcmorran@visi.net (Peter McMorran)
-----------------------------------------------------------
------------------------------
Date: Fri, 07 Jul 2000 11:57:56 +0000
From: =?iso-8859-1?Q?L=27=E9quipe?= technique Domicile <jhraigniac@freesurf.fr>
Subject: How to do an intermediary module ?
Message-Id: <3965C5C4.658C8B09@freesurf.fr>
Hi,
I would like to do an intermediary module between a script and the
modules that provides functions.
Ex :
----------------------------------
1st module :
Mod1.pm
package Mod1;
use Exporter;
use vars (@EXPORT);
@EXPORT = func1;
sub func1
{
print "func1\n";
...
}
1;
------------------------------------
2nd module :
Mod2.pm
package Mod2;
use Exporter;
use vars (@EXPORT);
@EXPORT = qw(func2 func3);
sub func2
{
print "func2\n";
...
}
sub func3
{
print "func3\n";
...
}
1;
-----------------------------------
Intermediary module :
ModRoot.pm
package ModRoot;
use Mod1;
use Mod2;
...
1;
------------------------------------
A script :
script.pl
#!/usr/bin/perl -w
use strict;
use ModRoot;
...
func1;
func2;
func3;
...
-------------------------------------
The trouble is that I don't know what is the proper way to have this
functions visibles from my script whithout using the form :
&Mod1::func1.
I would prefer the form func1 and the ModRoot module having all the
modules' functions in it's @EXPORT array.
Is it the best way to do and is it possible ?
Regards,
Jean-Hugues de Raigniac
------------------------------
Date: Fri, 7 Jul 2000 09:28:53 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: How to do an intermediary module ?
Message-Id: <slrn8mbmol.lg3.tadmc@magna.metronet.com>
On Fri, 07 Jul 2000 11:57:56 +0000, L'廦uipe technique Domicile <jhraigniac@freesurf.fr> wrote:
>Mod1.pm
>package Mod1;
>
>use Exporter;
>use vars (@EXPORT);
>
>@EXPORT = func1;
^^^^^
barewords are bad!
Quote your strings.
(and having perl DWIM the string into a list is obfuscating as well,
best to just provide a list where a list is required.
)
@EXPORT = qw/func1/;
or
@EXPORT = ('func1');
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 07 Jul 2000 18:05:59 +0000
From: =?iso-8859-1?Q?L=27=E9quipe?= technique Domicile <jhraigniac@freesurf.fr>
Subject: Re: How to do an intermediary module ?
Message-Id: <39661C07.B5F95840@freesurf.fr>
OK, I didn't put my function in a list in my example but I use the form qw() in my modules to
export the functions.
The matter is that functions are visible if I write "use Mod1" and not if I write "Use ModRoot",
even if ModRoot has "use Mod1" in it's firsts lines.
What is the way to propagate the @EXPORT array to the final script ?
Tad McClellan wrote:
> On Fri, 07 Jul 2000 11:57:56 +0000, L'廦uipe technique Domicile <jhraigniac@freesurf.fr> wrote:
>
> >Mod1.pm
> >package Mod1;
> >
> >use Exporter;
> >use vars (@EXPORT);
> >
> >@EXPORT = func1;
> ^^^^^
>
> barewords are bad!
>
> Quote your strings.
>
> (and having perl DWIM the string into a list is obfuscating as well,
> best to just provide a list where a list is required.
> )
>
> @EXPORT = qw/func1/;
>
> or
>
> @EXPORT = ('func1');
>
> --
> Tad McClellan SGML Consulting
> tadmc@metronet.com Perl programming
> Fort Worth, Texas
------------------------------
Date: Wed, 05 Jul 2000 07:11:45 GMT
From: Andreas Buykx <andreasbuykx@mailandnews.com>
Subject: how to find day of week without using modules
Message-Id: <8jun38$mk3$1@nnrp1.deja.com>
Hi there,
Can anyone of you help me to determine the day of the week the first day
of a given year+month, without using the PERL modules?
I hoped to use the localtime function, but I don't what to feed it with.
Thanks a lot,
Andreas
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 5 Jul 2000 09:54:43 +0200
From: "Dr. Peter Dintelmann" <Peter.Dintelmann@dresdner-bank.com>
Subject: Re: how to find day of week without using modules
Message-Id: <8jupkk$1pj2@intranews.dresdnerbank.de>
Hi,
Andreas Buykx schrieb in Nachricht <8jun38$mk3$1@nnrp1.deja.com>...
>Can anyone of you help me to determine the day of the week the first day
>of a given year+month, without using the PERL modules?
day of the week is in localtime()
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
(copied from perlfunc).
Best regards,
Peter Dintelmann
------------------------------
Date: Wed, 05 Jul 2000 09:08:05 GMT
From: Andreas Buykx <andreasbuykx@mailandnews.com>
Subject: Re: how to find day of week without using modules
Message-Id: <8juttd$s3h$1@nnrp1.deja.com>
In article <8jupkk$1pj2@intranews.dresdnerbank.de>,
"Dr. Peter Dintelmann" <Peter.Dintelmann@dresdner-bank.com> wrote:
> Hi,
>
> Andreas Buykx schrieb in Nachricht <8jun38$mk3$1@nnrp1.deja.com>...
> >Can anyone of you help me to determine the day of the week the first
day
> >of a given year+month, without using the PERL modules?
>
> day of the week is in localtime()
> ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime(time);
> (copied from perlfunc).
>
> Best regards,
>
> Peter Dintelmann
>
>
Thanks Peter for your help, but I'm not interested in today ;-)
Instead, I want to know the day of the week for the first day of a
specified month and year, e.g. I want to know whether April 1st of 1998
was a monday, tuesday, etc. And remember, I do not have any modules
available.
Any suggestions?
Thanks a lot,
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 05 Jul 2000 11:04:07 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: how to find day of week without using modules
Message-Id: <HCE85.1367$iP2.128270@news.dircon.co.uk>
On Wed, 05 Jul 2000 09:08:05 GMT, Andreas Buykx Wrote:
> In article <8jupkk$1pj2@intranews.dresdnerbank.de>,
> "Dr. Peter Dintelmann" <Peter.Dintelmann@dresdner-bank.com> wrote:
>> Hi,
>>
>> Andreas Buykx schrieb in Nachricht <8jun38$mk3$1@nnrp1.deja.com>...
>> >Can anyone of you help me to determine the day of the week the first
> day
>> >of a given year+month, without using the PERL modules?
>>
>> day of the week is in localtime()
>> ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
> localtime(time);
>> (copied from perlfunc).
>>
>> Best regards,
>>
>> Peter Dintelmann
>>
>>
>
> Thanks Peter for your help, but I'm not interested in today ;-)
>
> Instead, I want to know the day of the week for the first day of a
> specified month and year, e.g. I want to know whether April 1st of 1998
> was a monday, tuesday, etc. And remember, I do not have any modules
> available.
>
Work out what the value of 'time' should be for your given date - this is
in seconds since the Unix epoch.
/J\
------------------------------
Date: Wed, 05 Jul 2000 12:37:51 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: how to find day of week without using modules
Message-Id: <39652b77.3190373@news.skynet.be>
Andreas Buykx wrote:
>Can anyone of you help me to determine the day of the week the first day
>of a given year+month, without using the PERL modules?
>
>I hoped to use the localtime function, but I don't what to feed it with.
Use the standard module Time::Local to get back from date to seconds
since the epoch. Then, use the gmtime or localtime function in list
context, and get the item with index 6. Careful that you get the right
date!
--
Bart.
------------------------------
Date: Wed, 05 Jul 2000 23:09:21 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: how to find day of week without using modules
Message-Id: <sm7g11e0gas20@corp.supernews.com>
Andreas Buykx (andreasbuykx@mailandnews.com) wrote:
: Can anyone of you help me to determine the day of the week the first day
: of a given year+month, without using the PERL modules?
You can do it without modules, but why? This always reminds me of "How do
I chop down a tree without an axe or saw?" Well, okay, use nail clippers,
but it'll take a while... :)
--
| Craig Berry - http://www.cinenet.net/users/cberry/home.html
--*-- "Beauty and strength, leaping laughter and delicious
| languor, force and fire, are of us." - Liber AL II:20
------------------------------
Date: Mon, 3 Jul 2000 21:00:45 +0200
From: RonR <ronr@my-deja.com>
Subject: Re: how to get text enclosed by matching () ?
Message-Id: <01HW.B586AF7D000499E01285CBC0@news.planet.nl>
Thus far I got several recepts that all have the same result, apart from one
very advanced one, that crashed macperl.
$line="create table z (x(y),a,b t(c)) en storage (boe en bah);";
print "$line\n";
($a)= ( $line =~ /\([^()]*(\([^()]*\)[^()]*)*\)/ ); # from mastering regexps
($b)= ( $line =~ /\(([^()]|\([^()]*\))*\)/ ); # from mastering regexps
($c)= ( $line =~ /(\(\w+ \w+(?:\(\d+\))?(?:,\w+ \w+(?:\(\d+\))?)*\))/ );
$C=$1; # from Bart Lateur
$expr = '\w+ \w+(?:\(\d+\))?';
($d)= ( $line =~ /(\($expr(?:,$expr)*\))/o ); # from Bart Lateur(short)
$D=$1;
$bal=make_parenmatching_regex(10); #make pattern # from Bob Walton
$string=$line;
chomp $string;
$string=~/\(($bal)/; #matches a ( followed by longest balanced string
$e=$1;
#
## Given DEPTH, return a regex which will match a string with up
## to DEPTH levels of nested parens.
##
sub make_parenmatching_regex {
local($depth) = @_;
local($nonparen) = '[^()]';
"($nonparen|\\(" x $depth . "$nonparen*" . '\))*' x ($depth-1) .
'\))+';
}
($f)= ( $line =~ /(\(.*\))/ ); # from Neil Kandalgaonkar
print "$a\n$b\n$C\n$D\n$e\n$f\n";
print "$line\n"
print "$bal\n";
------------------results---------------------
create table z (x(y),a,b t(c)) en storage (boe en bah);
(c)
(c)
(c)
(c)
x(y),a,b t(c) ---> right match but crashed macperl
(x(y),a,b t(c)) en storage (boe en bah) ---> close but too greedy
create table z (x(y),a,b t(c)) en storage (boe en bah);
([^()]|\([^()]*\))+
--------------end results------------------------------
What I don't understand is that why I get (c) as result when I try
($g)= ( $line =~ /\(([^()]|\([^()]*\))+/ );
This should be the same as the algoritm I got from Bob with 1 as depth...
any more ideas ?
--
Ronald. < \_ _ o o
| o \ %-/\//_\\/\-%
'(*)-'---(*) (*)
home: http://home.wxs.nl/~ronr/RonR.html
PGP : http://home.wxs.nl/~ronr/ronr_pgp.key
The best way to accelerate a computer 'running' windows is by gravitation.
------------------------------
Date: Mon, 03 Jul 2000 23:58:05 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: how to get text enclosed by matching () ?
Message-Id: <396128D4.8FA34186@rochester.rr.com>
RonR wrote:
...
> What I don't understand is that why I get (c) as result when I try
> ($g)= ( $line =~ /\(([^()]|\([^()]*\))+/ );
>
> This should be the same as the algoritm I got from Bob with 1 as depth...
...
> Ronald. < \_ _ o o
...
> home: http://home.wxs.nl/~ronr/RonR.html
> PGP : http://home.wxs.nl/~ronr/ronr_pgp.key
...
You are missing one level of parens in the above regex. To make it the
same as $bal=make_parenmatching_regex(1);$line=~/\(($bal)/; you need:
($g)= ( $line =~ /\((([^()]|\([^()]*\))+)/ );
The reason for this is that the set of parens inside the + repeater is
returning the *last* thing the regex inside the parens matched, not
*everything* it matched. Thus the need for parens *outside* the +.
BTW, here is a slightly improved version of make_parenmatching_regex
that doesn't "eat" bunches of $1... variables and uses my. Maybe that
will work on macperl?
sub make_parenmatching_regex{#return a regex which will match a string
my($depth) = @_; #with up to $depth levels of nested parens
my($nonparen) = '[^()]';
"(?:$nonparen|\\(" x $depth . "$nonparen*" . '\))*' x ($depth-1) .
'\))+';
}
--
Bob Walton
------------------------------
Date: Tue, 04 Jul 2000 09:53:07 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: how to get text enclosed by matching () ?
Message-Id: <3963b3a3.8824525@news.skynet.be>
RonR wrote:
>$line="create table z (x(y),a,b t(c)) en storage (boe en bah);";
Note that my solution wasn't made for this kind of syntax. I assumed it
would always be of the form "int var(15)" or "int var".
You can relax my syntax restrictions a little.
--
Bart.
------------------------------
Date: 7 Jul 2000 15:29:12 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: how to get text enclosed by matching () ?
Message-Id: <8k4t08$iev$1@pegasus.csx.cam.ac.uk>
RonR <ronr@my-deja.com> wrote:
>Hi,
>
>a line: "blabla bla (xyz, abc(n), xyz, abc(n)) etc etc"
>I want to get the list enclosed by the matching braces
>giving: "( xyz, abc(n), xyz, abc(n) )" or eventually without the braces.
>
>Is there an easy way to do this ? The braces are always in pairs (if that
>helps).
<pedantic>
I assume you mean parentheses not braces.
</pedantic>
This sets $a to contain 'xyz, abc(n), xyz, abc(n)' :
my $line = "blabla bla (xyz, abc(n), xyz, abc(n)) etc etc";
($re = "\Q$line") =~ s/\\((\()|(\)))/$3\\$2$1/g;
my ($a) = eval { $line =~ $re };
If you want the contents of *all* the parens, change the last line to
my @a = eval { $line =~ $re };
Mike Guy
------------------------------
Date: Sat, 8 Jul 2000 9:41:58 +0200
From: RonR <ronr@my-deja.com>
Subject: Re: how to get text enclosed by matching () ?
Message-Id: <01HW.B58CA7E6000C7B2612E22B10@news.planet.nl>
On Fri, 7 Jul 2000 17:29:12 +0200, M.J.T. Guy wrote
(in message <8k4t08$iev$1@pegasus.csx.cam.ac.uk>):
> RonR <ronr@my-deja.com> wrote:
>> Hi,
>>
>> a line: "blabla bla (xyz, abc(n), xyz, abc(n)) etc etc"
>> Is there an easy way to do this ? The braces are always in pairs (if that
>> helps).
> <pedantic>
> I assume you mean parentheses not braces.
> </pedantic>
That looks better indeed.
--
Ronald. < \_ _ o o
| o \ %-/\//_\\/\-%
'(*)-'---(*) (*)
home: http://home.wxs.nl/~ronr/RonR.html
PGP : http://home.wxs.nl/~ronr/ronr_pgp.key
The best way to accelerate a computer 'running' windows is by gravitation.
------------------------------
Date: Mon, 03 Jul 2000 22:54:17 GMT
From: tony_barratt@my-deja.com
Subject: how to implement timer for watchdog
Message-Id: <8jr5ii$9gi$1@nnrp1.deja.com>
Hi List (and scalars too!)
I've got a 3 sec heartbeat from a a server wot i'm monitoring. And I'm
gonna use swatch to create an event.
Like so
<swatch.conf>
#
# Swatch configuration file for constant monitoring
#
# Timer reset
watchfor /mihostname/
exec "/usr/sbin/kill -USR1 mihostname.pid"
</swatch.conf>
So I've invoked swatch with swatch.conf and at the same time launched a
timer which resets when it gets a SIGUSR1.
And if it doesn't get a SIGUSR1 it generates a "hostname gone away
alert". But mmm I don't know how to code this timer of what bits of
perl I should use.
Can anyone advise?
TIA
Tony
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 05 Jul 2000 13:23:45 GMT
From: "Paul Johnston" <johnston.p@worldnet.att.net>
Subject: how to launch multiple processes?
Message-Id: <BFG85.8027$xL3.577952@bgtnsc06-news.ops.worldnet.att.net>
Is it possible to launch multiple processes inside perl without using fork?
(wanting cross-platformity). I'm not concerned about reading or writing to
the (child) processes.
I'm afraid I'm out of luck. Please advise.
Paul
------------------------------
Date: Wed, 05 Jul 2000 15:31:32 +0200
From: Marco Natoni <foo@bar.va>
Subject: Re: how to launch multiple processes?
Message-Id: <396338B4.3D3D7F8D@bar.va>
Paul,
Paul Johnston wrote:
> Is it possible to launch multiple processes inside perl without
> using fork? (wanting cross-platformity).
Unfortunately, multi-processness is strictly a platform-dependent
feature...
Best regards,
Marco
------------------------------
Date: 6 Jul 2000 10:22:16 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: how to launch multiple processes?
Message-Id: <8k1j48$vnr$1@orpheus.gellyfish.com>
On Wed, 05 Jul 2000 13:23:45 GMT Paul Johnston wrote:
> Is it possible to launch multiple processes inside perl without using fork?
> (wanting cross-platformity). I'm not concerned about reading or writing to
> the (child) processes.
>
> I'm afraid I'm out of luck. Please advise.
>
You are out of luck, avoid walking under ladders, avoid black cats,
look for four leaf clover ... Alternatively you might want to see if
threading will fit your bill - although it is still considered experimental
it is available on most platforms....
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Thu, 6 Jul 2000 02:28:57 -0400
From: NagaPutih <s0218327@unix1.cc.ysu.edu>
Subject: Re: How to open redirect and open new browser at same time?
Message-Id: <Pine.A41.4.20.0007060218470.39720-100000@unix1.cc.ysu.edu>
On Mon, 3 Jul 2000, shaohong wrote:
> Now my problem is
> First I want to redirect to URL1, at same time I want to open a new browser
> to some other URL2, the URL1 is still existing in the background.
print "Content-type: text/html\n";
print "Refresh: 1; URL=<your_URL1>\n";
print <<REDIR;
<html>
<head>
<title>URL1</title>
<script language="JavaScript">
<!-- hide
function getURL2() {
window.open("<your_URL2>") // modify this line
return true
}
//-->
</script>
</head>
<body onLoad="getURL2()">
...content here...
</body>
</html>
REDIR
i hope this helps.
-NagaPutih
------------------------------
Date: Mon, 10 Jul 2000 00:15:05 -0500
From: "Mike Mitchelson" <mmitchelson@yahoo.com>
Subject: How to parse string and cut after last slash??
Message-Id: <yIca5.253$7T.116932@nnrp1.sbc.net>
Hi,
I am wanting to take a string like this:
$a = /directory1/directory2/directory3/directoryx/filename.txt
and simply parse the last part after the last slash so:
$a = filename.txt
Any advice would be appreciated!
Take Care, Mike
------------------------------
Date: Mon, 10 Jul 2000 01:01:56 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: How to parse string and cut after last slash??
Message-Id: <brian-ya02408000R1007000101560001@news.panix.com>
In article <yIca5.253$7T.116932@nnrp1.sbc.net>, "Mike Mitchelson" <mmitchelson@yahoo.com> posted:
> I am wanting to take a string like this:
>
> $a = /directory1/directory2/directory3/directoryx/filename.txt
> and simply parse the last part after the last slash so:
use File::Basename qw(basename);
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>
------------------------------
Date: Mon, 10 Jul 2000 06:39:22 GMT
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: How to parse string and cut after last slash??
Message-Id: <slrn8mirk9.9rf.bernard.el-hagin@gdndev25.lido-tech>
Mike Mitchelson <mmitchelson@yahoo.com> wrote:
>Hi,
>
>I am wanting to take a string like this:
>
>$a = /directory1/directory2/directory3/directoryx/filename.txt
>
>
>and simply parse the last part after the last slash so:
>
>$a = filename.txt
>
>Any advice would be appreciated!
Just two of the *many* ways of doing this are:
($basename) = $a =~ m#([^/])+$#;
or
$a =~ s#^.*/(.*)$#$1#;
Bernard
--
perl -e'@x=(3,2,4,1,3,2,1,3,1,3,2,3,3,2,3,0,0,1,2,1,1,1,4,1,2,1,1,2,2,1,
2,1,2,1,2,1,2,1,1,1,2,1,0,0,3,2,3,2,3,2,1,1,1,1,1,2,4,2,3,2,1,2,1,0,0,1,
2,1,1,1,4,1,2,1,1,1,2,2,1,1,4,1,1,1,2,1,1,1,2,1,0,0,3,2,4,1,1,2,1,1,1,3,
1,1,1,4,1,1,1,2,1,1,3,0,0);sub x{print q x$xx$_;print q x x x shift@x};#
while(defined($_=shift @x)){s o0o\no;$_!=0?x:print}' #Symmetry yrtemmyS#
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 3570
**************************************