[17518] in Perl-Users-Digest
Perl-Users Digest, Issue: 4938 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 21 03:05:29 2000
Date: Tue, 21 Nov 2000 00:05:10 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <974793910-v9-i4938@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 21 Nov 2000 Volume: 9 Number: 4938
Today's topics:
A script question and an Apache question cgould@gate.net
Re: Does sub foo { 'A'..'Z' } return a list? <joe+usenet@sunstarsys.com>
Re: Does sub foo { 'A'..'Z' } return a list? <joe+usenet@sunstarsys.com>
Re: Does sub foo { 'A'..'Z' } return a list? <joe+usenet@sunstarsys.com>
Re: Does sub foo { 'A'..'Z' } return a list? <joe+usenet@sunstarsys.com>
Re: Download image from a html page using perl CGI jbuff1856@my-deja.com
Enumerate Existing Modules ? boomer2000@my-deja.com
Re: FTP - .jpg send problem <lauren_smith13@hotmail.com>
Re: Help: multiple DB files, regular expressions, and s (Garry Williams)
Re: how do I delete initial and final spaces in a strin (Christopher Burke)
Re: making a daemon server (Rafael Garcia-Suarez)
Memory limitation & memory leak <softcomp@home.com>
Re: Please tell me why this code is wrong (ActiveState <uri@sysarch.com>
Reading files? <johngros@Spam.bigpond.net.au>
Re: Reading files? (Wyzelli)
Re: sending a signal to a process which I don't own <nospam@jsoft.xs4all.nl>
Re: Strange behavior from localtime() Oct31 2000 or lat <softh@bellsouth.net>
urgent, regular expression eastking@my-deja.com
Re: urgent, regular expression (Wyzelli)
Re: Weird question: has anyone used Perl to parse the S <lauren_smith13@hotmail.com>
Re: What is a Junior Perl Programmer? <johngros@Spam.bigpond.net.au>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 21 Nov 2000 06:35:34 GMT
From: cgould@gate.net
Subject: A script question and an Apache question
Message-Id: <8vd53m$rjk$1@nnrp1.deja.com>
I am the alleged author of this little project :) :
http://tilt.largo.fl.us/redirect/redirect.html
This is basically a script that is designed to get around evil filters
and odd problems with routers that occasionally crop up from time to
time, by loading a web page to you via another server.
To the PERL folks:
1) I'd like to know if anyone knows of any problems with LWP::Simple
leaving Perl hanging when loading web page. The Unix admins of this
server (SunOS I think) were complaining about this at one time. It
doesn't seem to do this with my home system though...
My home system FYI: ActivePerl 5.6, Apache 1.3, Windows NT 6a, AMD K6-
450 w/ 160 megs of RAM, 80gb, etc.
2) Right now, the script looks for certain patterns, then does a
substitution on the entire page loaded in a variable. Is it possible to
designate a substitute only on the match you found (tieing in to the
same variable)?
3) Any other perl tips would be appreciated. This is my second perl
script, go easy. :)
To the APACHE folks:
I installed the above script on my PC at home basically for use at work
or other places I use the Internet. Somehow (don't ask me!) this script
has been discovered, and is now being used for porn downloads by fine
folks in such diverse locations as Brazil and the UK. Which I really
have no problem with (the logs are funny :) ), but a K6-450 is not
really designed for these tasks that much. :)
For future reference (translation: if 1 million folks decide to use my
poor K6-450), is there a way to restrict directories or scripts to
certain IP addresses?
(Note: Email is cgould11 at tampabay.rr.com, not the posted address.)
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 14 Nov 2000 20:05:22 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Does sub foo { 'A'..'Z' } return a list?
Message-Id: <m3itpqoxil.fsf@mumonkan.sunstarsys.com>
mgjv@tradingpost.com.au (Martien Verbruggen) writes:
> On 14 Nov 2000 08:38:48 -0500,
> Joe Schaefer <joe+usenet@sunstarsys.com> wrote:
> > mgjv@tradingpost.com.au (Martien Verbruggen) writes:
> >
> >> If either
> >> operand of scalar ".." is a constant expression, that
> >> operand is implicitly compared to the `$.' variable, the
> >> current line number.
> >>
> >>
> >> The scalar context propagates into the subroutine, putting the flipflop
> >> in a scalar context. This means it will work as described above. It will
> >> return false, since $. is not equal to 'A'. So, it returns "", the empty
> >> string.
> >>
> >
> > Grrr...
> >
> > and yet not a single mention of the damned thing in perldoc -f readline.
>
> The documentation isn't perfect, and especially cross-references are
> missing in many places. Feel free to submit a patch to the perl porters
> (with perlbug). Often it's just a matter of no one having noticed
> missing pointers, and they'll be happy to add it to the docs.
I don't think you really mean that- my patch would be pretty, well, large ;)
--
Joe Schaefer
------------------------------
Date: 14 Nov 2000 20:11:32 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Does sub foo { 'A'..'Z' } return a list?
Message-Id: <m3em0eox8b.fsf@mumonkan.sunstarsys.com>
mgjv@tradingpost.com.au (Martien Verbruggen) writes:
> On 14 Nov 2000 08:38:48 -0500,
> Joe Schaefer <joe+usenet@sunstarsys.com> wrote:
> > mgjv@tradingpost.com.au (Martien Verbruggen) writes:
> >
> >> If either
> >> operand of scalar ".." is a constant expression, that
> >> operand is implicitly compared to the `$.' variable, the
> >> current line number.
> >>
> >>
> >> The scalar context propagates into the subroutine, putting the flipflop
> >> in a scalar context. This means it will work as described above. It will
> >> return false, since $. is not equal to 'A'. So, it returns "", the empty
> >> string.
> >>
> >
> > Grrr...
> >
> > and yet not a single mention of the damned thing in perldoc -f readline.
>
> The documentation isn't perfect, and especially cross-references are
> missing in many places. Feel free to submit a patch to the perl porters
> (with perlbug). Often it's just a matter of no one having noticed
> missing pointers, and they'll be happy to add it to the docs.
I don't think you really mean that- my patch would be pretty, well, large-
beginning with a rewrite of IO::Handle and ending with one less entry
in perlvar ;)
--
Joe Schaefer
------------------------------
Date: 14 Nov 2000 20:19:28 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Does sub foo { 'A'..'Z' } return a list?
Message-Id: <m38zqmowv3.fsf@mumonkan.sunstarsys.com>
mgjv@tradingpost.com.au (Martien Verbruggen) writes:
> On 14 Nov 2000 08:38:48 -0500,
> Joe Schaefer <joe+usenet@sunstarsys.com> wrote:
> > mgjv@tradingpost.com.au (Martien Verbruggen) writes:
> >
> >> If either
> >> operand of scalar ".." is a constant expression, that
> >> operand is implicitly compared to the `$.' variable, the
> >> current line number.
> >>
> >>
> >> The scalar context propagates into the subroutine, putting the flipflop
> >> in a scalar context. This means it will work as described above. It will
> >> return false, since $. is not equal to 'A'. So, it returns "", the empty
> >> string.
> >>
> >
> > Grrr...
> >
> > and yet not a single mention of the damned thing in perldoc -f readline.
>
> The documentation isn't perfect, and especially cross-references are
> missing in many places. Feel free to submit a patch to the perl porters
> (with perlbug). Often it's just a matter of no one having noticed
> missing pointers, and they'll be happy to add it to the docs.
I don't think you really mean that- my patch would be pretty, well, large-
beginning with a rewrite of IO::Handle and ending with one less entry
in perlvar ;)
--
Joe Schaefer
------------------------------
Date: 14 Nov 2000 20:20:57 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Does sub foo { 'A'..'Z' } return a list?
Message-Id: <m366lqowsm.fsf@mumonkan.sunstarsys.com>
mgjv@tradingpost.com.au (Martien Verbruggen) writes:
> On 14 Nov 2000 08:38:48 -0500,
> Joe Schaefer <joe+usenet@sunstarsys.com> wrote:
> > mgjv@tradingpost.com.au (Martien Verbruggen) writes:
> >
> >> If either
> >> operand of scalar ".." is a constant expression, that
> >> operand is implicitly compared to the `$.' variable, the
> >> current line number.
> >>
> >>
> >> The scalar context propagates into the subroutine, putting the flipflop
> >> in a scalar context. This means it will work as described above. It will
> >> return false, since $. is not equal to 'A'. So, it returns "", the empty
> >> string.
> >>
> >
> > Grrr...
> >
> > and yet not a single mention of the damned thing in perldoc -f readline.
>
> The documentation isn't perfect, and especially cross-references are
> missing in many places. Feel free to submit a patch to the perl porters
> (with perlbug). Often it's just a matter of no one having noticed
> missing pointers, and they'll be happy to add it to the docs.
I don't think you really mean that- my patch would be pretty, well, large-
beginning with a rewrite of IO::Handle and ending with one less entry
in perlvar ;)
--
Joe Schaefer
------------------------------
Date: Tue, 21 Nov 2000 05:20:08 GMT
From: jbuff1856@my-deja.com
Subject: Re: Download image from a html page using perl CGI
Message-Id: <8vd0m5$ohm$1@nnrp1.deja.com>
In article <8vcaom$6qg$1@nnrp1.deja.com>,
jzhang_97@my-deja.com wrote:
> Is there a simple way to download a image
> file(.gif) from a web server with address:
>
> http://www.webserver.com/img.gif
>
> using perl CGI and saving it locally? I tried
> "lynx" and could not figure out a way doing
> it. I prefer doing it using standard
> Perl commands, if possible.
>
>
If you're working from a unix shell try
wget http://www.webserver.com/img.gif
No perl required for this.
--jbuff
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 21 Nov 2000 06:24:16 GMT
From: boomer2000@my-deja.com
Subject: Enumerate Existing Modules ?
Message-Id: <8vd4ec$r56$1@nnrp1.deja.com>
Is there a way to simply enumerate (list) all of the existing PERL
modules on a server ?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 21 Nov 2000 07:30:18 GMT
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: FTP - .jpg send problem
Message-Id: <dwpS5.3718$qP3.547061@dfiatx1-snr1.gtei.net>
<mr_foosball@my-deja.com> wrote in message
news:8vcuah$mop$1@nnrp1.deja.com...
> I have an FTP problem.
>
> When I ftp 'put' a .jpg file from one windows system it doesn't seem
to
> work. The 6KB file is reduced to 1KB which is unreadable. I have
> tried the $ftp->type(binary); and it doesn't change the outcome. I
> have read through the ftp docs, and haven't come across anything.
> Aslo, when I do the ftp manually it works (ascii or binary mode).
You may want to follow up with some code that demonstrates the problem.
Lauren
------------------------------
Date: Tue, 21 Nov 2000 06:19:55 GMT
From: garry@zweb.zvolve.net (Garry Williams)
Subject: Re: Help: multiple DB files, regular expressions, and substitutions
Message-Id: <fuoS5.1239$xb1.77382@eagle.america.net>
On 21 Nov 2000 02:41:01 GMT, CloneTwo <clonetwo@aol.com> wrote:
>I have two tab-separated database files: 'oldDBfile' and 'newDBfile'. Each
>contains a list of over 15000 books. About 10% of the books in 'oldDBfile' have
>an entry that contains a hyperlink, these books need to replace the same books
>in 'newDBfile' (that do not have hyperlinks). Cutting and pasting 1500 book
>entries by hand seemed like a very bad idea, so I thought I'd try to write a
>perl script to solve the problem.
>
>I started by extracting all of the books with links from the oldDBfile with:
>
>#!perl
>open(IN, 'oldDBfile') or die('could not open oldDBfile');
>open(OUT, '>booklinks') or die('could not open booklinks');
>
>
>while ($line = <IN>) {
> if ($line =~ /http:/) {
> print OUT ($line);
> }
>}
>
>close(IN);
>close(OUT);
Since you remarked that Perl is new to you, I hope you don't mind a
couple of comments.
This does precisely what you said it does, but it can be simplified.
Also, you will find that it is much easier to debug problems when you
ask perl to help you. Change that first line to:
#!perl -w
use strict;
Now you will have to declare variables explicitly, but you will find
that perl can now catch your typos (and other errors) in return for
the small extra effort.
If the open statements *do* fail for some reason, then it would be
nice to know why. Just let the system tell you by printing $! in the
error message:
open(IN, 'oldDBfile') or die("could not open oldDBfile: $!");
open(OUT, '>booklinks') or die("could not open booklinks: $!");
Since all Perl scripts will have already opened the standard input and
output files and since they will both be closed automatically, why not
just use them for this "filter" script:
#!perl -w
use strict;
while ( <> ) {
if ( /http:/ ) {
print;
}
}
Actually that can be shortened to:
#!perl -w
use strict;
while ( <> ) {
print if /http:/;
}
(By the way, if you have the grep program available, using it would be
even easier. :-)
To use this to create the file you want, do this from the command
line:
perl my_filter oldDBfile > booklinks
which will redirect the standard output of the script to the file you
want created.
Anyway, these are mostly style issues. Let's get to the real meat of
the problem.
You don't make it clear what the actual format of these files is, but
I'll make some assumptions based on the data that you did provide. If
these assumptions are wrong, you should still be able to adapt the
approach to your actual record formats.
I will assume that there are two fields separated by tab characters:
the ISBN number and the title. I also assume that this applies to
both original files. (The title can include the link in the
oldDBfile.)
>This gives me the file 'booklinks' with all the books with hyperlinks form
>'oldDBfile'. Since the first entry for each book is its ISBN number, the next
>step should be a simple search and replace, something like:
>
>"if the ISBN number of a book from 'booklinks' matches the ISBN number of a
>book in 'newdbfile' the entry from 'booklinks' should replace the book in
>'newdbfile'"
That's a good approach. Let's try it.
Since you mentioned that there are about 15,000 records involved,
there may be a memory problem with this first approach. But let's go
through it and then I'll show another method that will work without
memory constraints.
To do a "search and replace" we will first load the file with the
links into a hash so that we can access its values quickly. We'll use
the ISBN numbers as keys for the hash. (This implies another
assumption: that there are no duplicate records in oldDBfile.) Once
we have the hash with the links in it loaded, the rest is a simple
"filter" again. We'll use the same approach as you did in the first
script:
[untested]
#!perl -w
use strict;
my %links;
# Load our hash of links keyed by ISBN
open(LINKS, 'booklinks') or die "can't open 'booklinks': $!";
while ( <LINKS> ) {
my ($isbn, $link) = split /\t/;
$links{$isbn} = $link;
}
close(LINKS);
(This is the part that will consume significant memory, if there are
lots of records with links in the original oldDBfile file.)
Now that our hash is loaded, all we have to do is filter the contents
of the newdbfile file just as above except we'll replace part of the
records that match an element in our hash. We could explicitly open
two new file handles, but let's just use the already opened standard
files. This is usually the convention for any "filter" program:
while ( <> ) {
my ($isbn, $title) = split /\t/;
$title = $links{$isbn} if exists $links{$isbn};
print "$isbn\t$title"
}
This just replaces the second field with the saved link from the hash
*if* there is a matching element in the hash.
Again, we would execute this script similarly to the first:
perl my_merge newdbfile > merged_db_file
As I mentioned before, if your actual file format is different, you
will have to adapt this approach to fit it. But the basic idea is the
same: create a hash keyed on the ISBN and replace the appropriate
field with its contents when the records match.
One more comment: You can combine the filter in the first script with
the loading of the hash in this script. I'll leave that to you to do,
if you want.
What if you run out of memory trying to load the hash? Well then you
can still get the job done by using your operating system's sort
utility. You will have to sort both original files on the ISBN number
(ascending) and then merge them appropriately. Here's one way to do
it:
If you are running this on a Unix system, then sort the files this
way:
sort input_file > output_file
If you are using another OS, consult the manual page for its sort
program. (This assumes that the ISBN is the first field in the
files.) After the original files are sorted, we merge them with this
script:
[untested]
#!perl -w
use strict;
# Get the next record in the oldDBfile
sub get_link {
if ( defined(my $line = <OLD>) ) {
my ($isbn, $link) = split /\t/, $line;
return($isbn, $link);
}
return;
}
open(OLD, 'oldDBfile') or die "can't open 'oldDBfile': $!";
open(NEW, 'newdbfile') or die "can't open 'newdbfile': $!";
# Get the first oldDBfile values
my ($old_isbn, $link) = get_link;
# Read and replace the newdbfile records
while ( <NEW> ) {
my ($new_isbn, $title) = split /\t/;
# Either get a higher or equal ISBN or
# null list at end of oldDBfile
if ( $old_isbn and $new_isbn gt $old_isbn ) {
($old_isbn, $link) = get_link
while ( $old_isbn and $new_isbn gt $old_isbn );
}
# Replace, if a match
if ( $old_isbn and $new_isbn eq $old_isbn ) {
$title = $link;
}
# Write result
print "$new_isbn\t$title";
}
close(OLD);
close(NEW);
Here's how you run it:
perl my_small_merge > merged_db_file
Hope this helps.
--
Garry Williams
------------------------------
Date: 21 Nov 2000 07:12:10 GMT
From: craznar@hotmail.com (Christopher Burke)
Subject: Re: how do I delete initial and final spaces in a string?
Message-Id: <8FF3AF0FCcraznar@130.102.2.1>
uri@sysarch.com (Uri Guttman) wrote in <x7hf52eh0j.fsf@home.sysarch.com>:
>>>>>> "CB" == Christopher Burke <craznar@hotmail.com> writes:
>
> CB> OR even one step ...
> CB> $line =~ s/^\s*(.*?)\s*$/\1/;
>
>or even correctly:
You mean 'or even better supported' because the above DOES work.
>
> $line =~ s/^\s*(.*?)\s*$/$1/;
>
>\1 is a backreference and should only be used in the regex itself and
>not in the replacement string. it is supported but not proper. use $1
>and brethren as that is what they are designed for.
Thanks for the clarification - I hope you accepted mine in exchange.
>
>uri
>
------------------------------
Date: Tue, 21 Nov 2000 07:53:05 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: making a daemon server
Message-Id: <slrn91kag4.gh6.rgarciasuarez@rafael.kazibao.net>
Fran Turgeon Bridges wrote in comp.lang.perl.misc:
> I have a process that I wish to make a daemon. Using the "Perl Cookbook"
> I have created the job to execute a system call every 120 seconds. When I
> run it stand alone it runs fine. When I run it as a daemon it does not
> run my system call.
>
> I have included the job below. Do any errors leap out to anyone?
>
> Thanks
>
> -Fran Bridges
>
> #!/usr/local/bin/perl
> use POSIX;
>
> chroot ("/var/daemon") or
> die "Couldn't chroot to /var/daemon: $!";
>
> $pid = fork;
> exit if $pid;
> die "Coulen't fork: $!" unless defined($pid);
>
> POSIX::setsid()
> or die "Cannot start a new session: $!";
>
> $time_to_die = 0;
>
> until ($time_to_die) {
> $status = system("/mypath/to/mycommand");
I suppose that the command path is actually /var/daemon/mypath/to/mycommand ?
Because you've chrooted you're daemon, it can't access filesystem
objects below /var/daemon.
> sleep(60);
> }
>
> sub signal_handler {
> $time_to_die = 1;
> }
The signal handler is not installed?
BTW, there is a nice on-line tutorial on daemons in perl :
http://www.webreference.com/perl/tutorial/9/
--
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
------------------------------
Date: Tue, 21 Nov 2000 06:33:49 GMT
From: "Jon" <softcomp@home.com>
Subject: Memory limitation & memory leak
Message-Id: <hHoS5.21732$15.5031516@news1.rdc1.az.home.com>
Hello all,
I have been seeing some strange behavior in Perl. Wonder if anyone could
help answer the following questions. I did not see an answer in the FAQ
pertaining
to these question but if it exist somewhere, please kindly point me to it.
Does anyone here know if there is a limitation to the amount of memory
Perl
can access - assuming that the physical RAM is not the limiting factor?.
If I have a localized (my) reference to a hash of hash to an array
within a
function, does all the memory used to build this structure gets freed and be
made available when Perl exit the function?. It seems like Perl is not
freeing
the memory or if it does, it is not reusing them. I am using Perl 5.X.
Any opinion?. Thanks in advance
Jon
------------------------------
Date: Tue, 21 Nov 2000 05:48:50 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Please tell me why this code is wrong (ActiveState build 613 on Winblows)
Message-Id: <x74s11euyl.fsf@home.sysarch.com>
>>>>> "d" == dsteuber <dsteuber@my-deja.com> writes:
d> my %foo_hash = { bar => "baz" };
bogus. use parens and not braces to initialize a hash. you just assigned
an anon hash to the hash which would have been caught by -w. you should
always enable -w.
d> sub get_foo_hash {
d> return \%foo_hash;
d> }
d> my $foo_hash_ref = Foo::get_foo_hash();
d> printf "%s\n", $foo_hash_ref{bar};
as others have pointed out that is not the way to dereference a hash
ref. but since the original hash has bad data, even fixing this won't
help unless you fix the first problem as well.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Tue, 21 Nov 2000 05:54:34 GMT
From: "John Boy Walton" <johngros@Spam.bigpond.net.au>
Subject: Reading files?
Message-Id: <u6oS5.97$bg5.808@news-server.bigpond.net.au>
$line = <BOGUS>
if ($form_data{'pass'} eq $line)
I get a syntax error in the second line.
I was wondering if reading BOGUS in this manner is acceptable? There is only
one item in the file and only ever will be. I also have not written "/n" to
the file. Would this be the problem?
------------------------------
Date: Tue, 21 Nov 2000 06:55:07 GMT
From: wyzelli@yahoo.com (Wyzelli)
Subject: Re: Reading files?
Message-Id: <Xns8FF3A2E5Cwyzelliyahoocom@203.39.3.131>
"John Boy Walton" <johngros@Spam.bigpond.net.au> wrote in
<u6oS5.97$bg5.808@news-server.bigpond.net.au>:
>$line = <BOGUS>
> if ($form_data{'pass'} eq $line)
missing ; on first line
I assume the second line normally ends in { for starting the if block
Wyzelli
------------------------------
Date: Tue, 21 Nov 2000 08:15:21 +0100
From: "Willem Joosten" <nospam@jsoft.xs4all.nl>
Subject: Re: sending a signal to a process which I don't own
Message-Id: <8vd7g8$1aj$1@news.tudelft.nl>
"Martien Verbruggen" <mgjv@tradingpost.com.au> wrote in message
news:slrn91i4k3.imr.mgjv@martien.heliotrope.home...
> No. You can't. This has nothing to do with Perl, but is a feature of
> Unix. You don't, after all, want just anyone's signals interrupting your
> program, do you?
No not anyone but it would be nice to be able to allow another process to do
so.
> Several other ways: sockets, named pipes, SYSV message queues.
>
> What is best, and how to solve it is impossible to say without knowing
> much, much more about what your programs do, and what the intent of the
> signal is.
The cgi script updates a text file which should be reread by the 'deamon'
script and processed. The processing takes about an hour so I don't the cgi
script to do the processing.
> My crystal ball says that you'll either need the four argument form of
> select, with a named pipe or sockets, or you'll need two processes
> instead of one waiting for that 'signal', parent and child.
Very good crystal ball! Haven't implemented the child process yet (too much
new stuff for one evening :) but the select on a named pipe works like a
charm. Thanks for the reply.
Regards,
Willem Joosten
------------------------------
Date: Mon, 20 Nov 2000 23:09:57 -0500
From: Matt <softh@bellsouth.net>
Subject: Re: Strange behavior from localtime() Oct31 2000 or later
Message-Id: <3A19F594.683A03A9@bellsouth.net>
This is a multi-part message in MIME format.
--------------96DEA5C0E4BE6D1F397A6D53
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi Joe
I should have caught that myself.
I'll give it a try tommorrow .
Thanks
Matt
Joe Schaefer wrote:
> Matt <softh@bellsouth.net> writes:
>
> > Joe Schaefer wrote:
> > > ==========
> > > #!/usr/bin/perl -wT
> > > while (<DATA>) {
> > > my ($DateString, $Interval) = split(/::/, $_ );
> > > my $Date=localtime($DateString);
> > > print "$DateString $Interval $Date \n";
> > > }
> > >
> > > _DATA__
> ^^
> That's a typo on my part, sorry about that. Change it
> to
>
> __DATA__
>
> and see what happens.
> --
> Joe Schaefer
--------------96DEA5C0E4BE6D1F397A6D53
Content-Type: text/x-vcard; charset=us-ascii;
name="softh.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Matt
Content-Disposition: attachment;
filename="softh.vcf"
begin:vcard
n:Hill;Matthew
x-mozilla-html:TRUE
url:everyquest.net
org:EveryQuest.Net
adr:;;address confidental for now;Manitou;Ky;;
version:2.1
email;internet:matt@everyquest.net
title:COO
fn:Matt
end:vcard
--------------96DEA5C0E4BE6D1F397A6D53--
------------------------------
Date: Tue, 21 Nov 2000 06:29:38 GMT
From: eastking@my-deja.com
Subject: urgent, regular expression
Message-Id: <8vd4of$rf4$1@nnrp1.deja.com>
Hi,Every one here.
I need to write a regular expression to change my source code. So would
you please help. Thanks in advance.
This oringinal is as following:
Vara = funcA(funcB(funC(something))) + funcA(funcB(funC(otherthing)))
I want it be translated to
Vara = funcA(funcB(funC(something),'para'),'para') + funcA(funcB(funC
(otherthing),'para'),'para')
As you can see, the funcA and funcB both add a parameter in it's
parameter list.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 21 Nov 2000 06:50:07 GMT
From: wyzelli@yahoo.com (Wyzelli)
Subject: Re: urgent, regular expression
Message-Id: <Xns8FF3AECD4wyzelliyahoocom@203.39.3.131>
eastking@my-deja.com wrote in <8vd4of$rf4$1@nnrp1.deja.com>:
>Vara = funcA(funcB(funC(something),'para'),'para') + funcA(funcB(funC
>(otherthing),'para'),'para')
Basically insert a ,'para' between the close bracket for each set of triple
close brackets.
s/\)\)\)/\),'para'\),'para'\)/g;
Wyzelli
------------------------------
Date: Tue, 21 Nov 2000 07:40:44 GMT
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: Weird question: has anyone used Perl to parse the Shoutcast XML feed for display to a browser?
Message-Id: <0GpS5.3722$qP3.550738@dfiatx1-snr1.gtei.net>
<dack@visi.com> wrote in message news:3a198bf3.19656414@news.visi.com...
> Any insights or pointers are appreciated. Thanks.
Here's an easy pointer. Put your question in the body of your message.
It's easier to read and answer that way.
Lauren
------------------------------
Date: Tue, 21 Nov 2000 06:06:40 GMT
From: "John Boy Walton" <johngros@Spam.bigpond.net.au>
Subject: Re: What is a Junior Perl Programmer?
Message-Id: <QhoS5.130$bg5.1080@news-server.bigpond.net.au>
I have Learning Perl on Win32 Systems by a certain comp.lang.perl.misc pinup
guy. ;-)
------------------------------
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 4938
**************************************