[13793] in Perl-Users-Digest
Perl-Users Digest, Issue: 1203 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 27 23:42:58 1999
Date: Wed, 27 Oct 1999 20:42:40 -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: <941082159-v9-i1203@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 27 Oct 1999 Volume: 9 Number: 1203
Today's topics:
ummz .. Regular expressions on multiple lines.. and umm <duthler@tebenet.nl>
Re: ummz .. Regular expressions on multiple lines.. and <rootbeer@redcat.com>
uniq and perl <mr_geek@my-deja.com>
Re: uniq and perl <lr@hpl.hp.com>
Re: uniq and perl <rootbeer@redcat.com>
Re: uniq and perl <lr@hpl.hp.com>
Re: Unix command ´tree´ in Perl? <jseigh@bbnplanet.com>
Re: Unix command ´tree´ in Perl? <jseigh@bbnplanet.com>
Re: Unix command =?iso-8859-1?Q?=B4tree=B4?= in Perl? (Matthew Bafford)
Unpacking modules on <cough> Windows ... ? <genlabs@gmx.net>
Re: Unpacking modules on <cough> Windows ... ? <cassell@mail.cor.epa.gov>
Re: Unpacking modules on <cough> Windows ... ? <gellyfish@gellyfish.com>
Re: Unpacking modules on <cough> Windows ... ? (Jenda Krynicky)
Re: Unpacking modules on <cough> Windows ... ? <genlabs@gmx.net>
Re: Unpacking modules on <cough> Windows ... ? <genlabs@gmx.net>
Re: Unpacking modules on <cough> Windows ... ? <gellyfish@gellyfish.com>
Re: Unpacking modules on <cough> Windows ... ? <gellyfish@gellyfish.com>
Re: Unpacking modules on <cough> Windows ... ? <genlabs@gmx.net>
Re: upload file help (Abigail)
Using an SQL query across OS's via Web browser. wharmon@prodigy.net
Re: Very New Perl User question kennedyjd@my-deja.com
waitpid usage question <biwillia@cisco.com>
Re: waitpid usage question (Martien Verbruggen)
Re: waitpid usage question <rootbeer@redcat.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 27 Oct 1999 16:02:53 +0200
From: "jan smit" <duthler@tebenet.nl>
Subject: ummz .. Regular expressions on multiple lines.. and ummz .. string/chat to dec or hex .. or something
Message-Id: <7v70ll$oth$1@porthos.nl.uu.net>
i have 2 q's .. 1 is about multiple lines ..
i ready about regular expressions in the documentation .. but i didnt really
get is .. asll i understood was that at the ens of the expression there is a
/m .. but how do i get that to works if i hafta read something from a file
.. and i wanted to search for a matching string that might include an \n ..
could somone help me with that .
and the other problem is get the first 3 character of a string and turning
them into a decimal value or hexadecimal .. doesnt really matter .. if
someone could help me with these too .. or does ne1 know where i can find an
example??
thnx
ME =]
------------------------------
Date: Wed, 27 Oct 1999 11:39:35 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: ummz .. Regular expressions on multiple lines.. and ummz .. string/chat to dec or hex .. or something
Message-Id: <Pine.GSO.4.10.9910271135150.29843-100000@user2.teleport.com>
On Wed, 27 Oct 1999, jan smit wrote:
> Subject: ummz .. Regular expressions on multiple lines.. and ummz ..
string/chat to dec or hex .. or something
Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
> i have 2 q's .. 1 is about multiple lines ..
In general, it's better to ask two unrelated questions in two separate
postings. In that way, you'll have an easier time choosing a subject line
for each, someone who can answer only one question won't have to ignore
the other, and follow-ups will be better organized.
> i ready about regular expressions in the documentation .. but i didnt
> really get is .. asll i understood was that at the ens of the
> expression there is a /m .. but how do i get that to works if i hafta
> read something from a file .. and i wanted to search for a matching
> string that might include an \n .. could somone help me with that .
I'm not clear what you want. But if you want to search for a newline, use
\n in the pattern. If you want to make the line anchors ^ and $ match at
newlines which aren't at the start or end of the string, use the /m
modifier. If you want to make the wildcard dot ( . ) match any character
at all, instead of any character except newline, use the /s modifier. See
perlre and perlop.
> and the other problem is get the first 3 character of a string and
> turning them into a decimal value or hexadecimal .. doesnt really
> matter .. if someone could help me with these too .. or does ne1 know
> where i can find an example??
It sounds as if you want substr(), and maybe hex(). See the perlfunc
manpage.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 27 Oct 1999 17:32:23 GMT
From: mr_geek <mr_geek@my-deja.com>
Subject: uniq and perl
Message-Id: <7v7cv7$8fp$1@nnrp1.deja.com>
Hi,
I have multiple occurences of the same string in my output.
print $output;
string
string
string
string1
string1
string2
I want to know how I can (within perl) manipulate my output to print
only 1 occurence of a string (exactly like UNIX's uniq).
Thanks in advance,
Shon
BTW, Do not reply to mr_geek. Instead try shon@ibeauty.com
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 27 Oct 1999 13:01:22 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: uniq and perl
Message-Id: <MPG.1280f9ecd981f4fd98a142@nntp.hpl.hp.com>
In article <7v7cv7$8fp$1@nnrp1.deja.com> on Wed, 27 Oct 1999 17:32:23
GMT, mr_geek <mr_geek@my-deja.com> says...
> I have multiple occurences of the same string in my output.
>
> print $output;
>
> string
> string
> string
> string1
> string1
> string2
>
> I want to know how I can (within perl) manipulate my output to print
> only 1 occurence of a string (exactly like UNIX's uniq).
`perldoc -q uniq` would have come up with the following FAQ:
perlfaq4: "How can I extract just the unique elements of an array?"
> BTW, Do not reply to mr_geek. Instead try shon@ibeauty.com
Then set your 'Reply-to: header properly.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 27 Oct 1999 12:04:59 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: uniq and perl
Message-Id: <Pine.GSO.4.10.9910271203230.29843-100000@user2.teleport.com>
On Wed, 27 Oct 1999, mr_geek wrote:
> I want to know how I can (within perl) manipulate my output to print
> only 1 occurence of a string (exactly like UNIX's uniq).
Have you seen what section four of the FAQ says about this?
> BTW, Do not reply to mr_geek. Instead try shon@ibeauty.com
Please put that address into your headers in the standard way, and I'll be
glad to do so next time. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 27 Oct 1999 12:42:13 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: uniq and perl
Message-Id: <MPG.1280f56bc40bd38798a140@nntp.hpl.hp.com>
In article <7v7cv7$8fp$1@nnrp1.deja.com> on Wed, 27 Oct 1999 17:32:23
GMT, mr_geek <mr_geek@my-deja.com> says...
> I have multiple occurences of the same string in my output.
>
> print $output;
>
> string
> string
> string
> string1
> string1
> string2
>
> I want to know how I can (within perl) manipulate my output to print
> only 1 occurence of a string (exactly like UNIX's uniq).
`perldoc -f uniq` would have come up with the following FAQ:
perlfaq4: "How can I extract just the unique elements of an array?"
> BTW, Do not reply to mr_geek. Instead try shon@ibeauty.com
Then set your 'Reply-to: header properly.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 25 Oct 1999 11:25:27 GMT
From: Joe Seigh <jseigh@bbnplanet.com>
Subject: Re: Unix command ´tree´ in Perl?
Message-Id: <38143D92.AE0A5197@bbnplanet.com>
Daniel Apolinario wrote:
>
> I would like to know if anybody knows how to implement the unix
> command ´tree´ in PERL language.
> Please, mail me if you know how to do it.
>
> Thanks
> Fernando Fatureto
If everyone hasn't figured it out by now, the tree command is /usr/proc/bin/ptree
in solaris at least.
The assignment must have been due by now, so here's a version written in perl. It's
an old script. The one I use now is ksh/nawk because you can't always assume that
perl is going to be on every machine. Anyhow, it still runs in solaris but I haven't
tried other unices lately.
#!/usr/bin/perl
if ($ARGV[0]=~/^-[h?]$/) {
print <<"_HELP";
Display process tree
usage: $0 # no options, display all processes
<...> # any sysV ps options compatible with the -f option
_HELP
exit 1;
}
sub dprocs {
local($z, $pid)=@_;
local($nx);
printf "%8s %5d %5d %s%s\n", $user{$pid}, $pid, $ppid{$pid}, "| "x$z, $args{$pid};
for($nx=$child_of{$pid}; $nx; $nx=$sibling_of{$nx}) {
&dprocs($z+1, $nx);
}
}
if ($#ARGV<0) {
open(PS, "ps -f -e |") || die("ps");
}
else {
open(PS, "ps -f @ARGV |") || die("ps");
}
$x=<PS>; # read header
$c1=index($x, " TIME ")+5; # where command starts - 1
$c2=index($x, "PPID")+4; # where PPID should end
while(<PS>) {
chop;
$args=substr($_, $c1);
$args=~s/^\S*\s+//; # fix munging of command field
$xx=substr($_, 0, $c2); # USER PID & PPID (fix Solaris munge)
$xx=~s/^\s*//; # delete leading blanks if any
($user, $pid, $ppid)=split(/\s+/, $xx);
$seen{$pid}=1;
$user{$pid}=$user;
$ppid{$pid}=$ppid;
$args{$pid}=$args;
next if $pid==$ppid; # in this case ppid == 0 also
$sibling_of{$pid}=$child_of{$ppid}; # push onto child/sibling list ...
$child_of{$ppid}=$pid; # ...
}
foreach $pid (keys(%seen)) {
if ($pid==$ppid{$pid} || !$seen{$ppid{$pid}}) { # root of process tree?
&dprocs(0, $pid);
}
}
exit 0;
Joe Seigh
------------------------------
Date: Mon, 25 Oct 1999 12:46:23 GMT
From: Joe Seigh <jseigh@bbnplanet.com>
Subject: Re: Unix command ´tree´ in Perl?
Message-Id: <3814508B.3A0B9DC5@bbnplanet.com>
Matthew Bafford wrote:
>
> Joe Seigh <jseigh@bbnplanet.com>, thinking with his hands, posted the
> following to comp.lang.perl.misc:
> : If everyone hasn't figured it out by now, the tree command is /usr/proc/bin/ptree
> : in solaris at least.
>
> On Linux systems, tree tends to be similar to the DOS tree command. That
> is, it lists directories and files.
>
You're right. I should learn to parse better. That's command 'tree',
not command tree. Plus I guess it didn't that everyone was going on
about the unix command 'tree'.
Joe Seigh
------------------------------
Date: Mon, 25 Oct 1999 12:16:45 GMT
From: *@dragons.duesouth.net (Matthew Bafford)
Subject: Re: Unix command =?iso-8859-1?Q?=B4tree=B4?= in Perl?
Message-Id: <slrn818i7p.185.*@dragons.duesouth.net>
Joe Seigh <jseigh@bbnplanet.com>, thinking with his hands, posted the
following to comp.lang.perl.misc:
: Daniel Apolinario wrote:
: > I would like to know if anybody knows how to implement the unix
: > command ´tree´ in PERL language.
:
: If everyone hasn't figured it out by now, the tree command is /usr/proc/bin/ptree
: in solaris at least.
On Linux systems, tree tends to be similar to the DOS tree command. That
is, it lists directories and files.
While this doesn't output the same, it does do something similar, and in
only two lines [0]. :)
perl -MFile::Find -we 'sub w{print " " x $File::Find::dir =~ tr{/}{},
$_, -d $File::Find::name ? "/\n" : "\n"} find(\&w, @ARGV ? shift : ".")'
Yes, I do know this only works on operating systems where the directory
separator is a '/'.
: Joe Seigh
--Matthew
[0] That should bring all of the golfers out of the woodwork... :)
------------------------------
Date: Mon, 25 Oct 1999 15:08:53 +0200
From: "make@money.com" <genlabs@gmx.net>
Subject: Unpacking modules on <cough> Windows ... ?
Message-Id: <940857039.356616@news.vbs.at>
Hello again,
I hope this is not FAQ #xx or the daily question but in search of
a solution to my problem with installing ActiveState packages that come in
.ppm format i ended up here.
The Readme says :
'To install this ActiveState PPM package, run the following command
in the current directory:
ppm install Win32-API.ppd'
That's what I did which resulted in DOS Error File not found ...
I think there has to be a package manager or something similar to 'make' ,
for Perl-Win-32.
Where can I get it ?
Or maybe I made another mistake ?
This time I really took my time reading the documentation and searching
cpan,
although my interest in Perl increased and I don't feel totally awestruck by
the many directions and options
anymore, I couldn't find any information on this,
except that the FAQ's and manpages assume that there is no problem with
the installation of modules.
Btw, is there a path where to install modules ? I pseudo-installed them in
perl\lib\win32\ .
Thanks for your truly appreciated efforts helping me.
------------------------------
Date: Tue, 26 Oct 1999 16:29:20 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Unpacking modules on <cough> Windows ... ?
Message-Id: <38163950.54BD87B6@mail.cor.epa.gov>
make@money.com wrote:
>
> The API rules, so does the documentation , so don't expect any Win32::XXX
> questions ... they'll likely come anyway :-)
> Thanks for the hint .
Well, you'll probably want to read the docs which come with
ActiveState Perl, including the ActivePerl [win32] FAQ...
And then subscribe to one or more of the win32-Perl mailing
lists available at
http://www.activestate.com/support/mailing_lists.htm
You can get a lot of support from these listservs.
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 25 Oct 1999 19:45:46 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Unpacking modules on <cough> Windows ... ?
Message-Id: <7v2c1a$hte$1@gellyfish.btinternet.com>
On Mon, 25 Oct 1999 20:07:22 +0200 make@money.com wrote:
> That's a yes ....ok I just downloaded ActivePerl .
>
Yes Its a yes. I was confused by your Jepoardic post and managed to delete
my actual comment whilst trying to rearrange your quoting ...
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Tue, 26 Oct 1999 20:53:13 GMT
From: Jenda@Krynicky.cz (Jenda Krynicky)
Subject: Re: Unpacking modules on <cough> Windows ... ?
Message-Id: <1106_940971193@prague_main>
On Mon, 25 Oct 1999 17:14:03 +0200, "make@money.com" <genlabs@gmx.net> wrote:
> I use Perl 5.005_03 .
> Please, don't say that I need ActivePerl to use ActiveState modules .
Well ... since ActiveState modules (as you call it) are just CPAN modules precomiled
for ActivePerl I would say yes.
Of course you may install CPAN modules the normal way
perl Makefile.PL
make
make test
make install
But if you compiled your own perl you probably know that already.
Jenda
http://Jenda.Krynicky.cz
P.S.: If you want to compile modules for ActivePerl yourself you need to have MSVC (AFAIK),
and you will use "nmake" instead of "make"
------------------------------
Date: Tue, 26 Oct 1999 02:04:48 +0200
From: "make@money.com" <genlabs@gmx.net>
Subject: Re: Unpacking modules on <cough> Windows ... ?
Message-Id: <940896291.490244@news.vbs.at>
The API rules, so does the documentation , so don't expect any Win32::XXX
questions ... they'll likely come anyway :-)
Thanks for the hint .
make@money.com <genlabs@gmx.net> schrieb in im Newsbeitrag:
940874843.996354@news.vbs.at...
> That's a yes ....ok I just downloaded ActivePerl .
>
> Jonathan Stowe <gellyfish@gellyfish.com> schrieb in im Newsbeitrag:
> 38148350_1@newsread3.dircon.co.uk...
> > make@money.com <genlabs@gmx.net> wrote:
> > > I use Perl 5.005_03 .
> > > Please, don't say that I need ActivePerl to use ActiveState modules .
> > >
> > > Jonathan Stowe <gellyfish@gellyfish.com> schrieb in im Newsbeitrag:
> > > 38145952_2@newsread3.dircon.co.uk...
> > >> make@money.com <genlabs@gmx.net> wrote:
> > >> > Hello again,
> > >> >
> > >> > I hope this is not FAQ #xx or the daily question but in search of
> > >> > a solution to my problem with installing ActiveState packages that
> come
> > > in
> > >> > .ppm format i ended up here.
> > >> > The Readme says :
> > >> >
> > >> > 'To install this ActiveState PPM package, run the following command
> > >> > in the current directory:
> > >> > ppm install Win32-API.ppd'
> > >> >
> > >>
> > >> That is a correct way of installing the module - it assumes that you
> have
> > >> downloaded the .zip file <Win32-API.zip> from
> > >> <http://www.activestate.com/packages/zips> and that you have unpacked
> this
> > >> into a temporary directory - there now should be a Win32-API.ppd file
> and
> > >> a .gz file in that directory - you change directory to the directory
> > >> where you have unpacked these files and then run the command as
above.
> > >>
> > >> If you get a"Bad command or filename" error then this means that
> ppm.bat
> > >> is not in your path - it should be in c:\perl\bin ...
> > >>
> > >> Of course this is all addressed in the documentation that comes with
> > >> ActivePerl - you can find it under the Active Perl start menu item
...
> > >>
> > >> /J\
> > >> --
> > >> "The internet is like a car boot sale" - Jon Sopel, BBC News
> > >
> > >
> >
> > --
> > "I must call a man in - I want to get felt laid down in the loft" -
> > Graham Norton
>
>
------------------------------
Date: Mon, 25 Oct 1999 20:07:22 +0200
From: "make@money.com" <genlabs@gmx.net>
Subject: Re: Unpacking modules on <cough> Windows ... ?
Message-Id: <940874843.996354@news.vbs.at>
That's a yes ....ok I just downloaded ActivePerl .
Jonathan Stowe <gellyfish@gellyfish.com> schrieb in im Newsbeitrag:
38148350_1@newsread3.dircon.co.uk...
> make@money.com <genlabs@gmx.net> wrote:
> > I use Perl 5.005_03 .
> > Please, don't say that I need ActivePerl to use ActiveState modules .
> >
> > Jonathan Stowe <gellyfish@gellyfish.com> schrieb in im Newsbeitrag:
> > 38145952_2@newsread3.dircon.co.uk...
> >> make@money.com <genlabs@gmx.net> wrote:
> >> > Hello again,
> >> >
> >> > I hope this is not FAQ #xx or the daily question but in search of
> >> > a solution to my problem with installing ActiveState packages that
come
> > in
> >> > .ppm format i ended up here.
> >> > The Readme says :
> >> >
> >> > 'To install this ActiveState PPM package, run the following command
> >> > in the current directory:
> >> > ppm install Win32-API.ppd'
> >> >
> >>
> >> That is a correct way of installing the module - it assumes that you
have
> >> downloaded the .zip file <Win32-API.zip> from
> >> <http://www.activestate.com/packages/zips> and that you have unpacked
this
> >> into a temporary directory - there now should be a Win32-API.ppd file
and
> >> a .gz file in that directory - you change directory to the directory
> >> where you have unpacked these files and then run the command as above.
> >>
> >> If you get a"Bad command or filename" error then this means that
ppm.bat
> >> is not in your path - it should be in c:\perl\bin ...
> >>
> >> Of course this is all addressed in the documentation that comes with
> >> ActivePerl - you can find it under the Active Perl start menu item ...
> >>
> >> /J\
> >> --
> >> "The internet is like a car boot sale" - Jon Sopel, BBC News
> >
> >
>
> --
> "I must call a man in - I want to get felt laid down in the loft" -
> Graham Norton
------------------------------
Date: 25 Oct 1999 17:20:32 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Unpacking modules on <cough> Windows ... ?
Message-Id: <38148350_1@newsread3.dircon.co.uk>
make@money.com <genlabs@gmx.net> wrote:
> I use Perl 5.005_03 .
> Please, don't say that I need ActivePerl to use ActiveState modules .
>
> Jonathan Stowe <gellyfish@gellyfish.com> schrieb in im Newsbeitrag:
> 38145952_2@newsread3.dircon.co.uk...
>> make@money.com <genlabs@gmx.net> wrote:
>> > Hello again,
>> >
>> > I hope this is not FAQ #xx or the daily question but in search of
>> > a solution to my problem with installing ActiveState packages that come
> in
>> > .ppm format i ended up here.
>> > The Readme says :
>> >
>> > 'To install this ActiveState PPM package, run the following command
>> > in the current directory:
>> > ppm install Win32-API.ppd'
>> >
>>
>> That is a correct way of installing the module - it assumes that you have
>> downloaded the .zip file <Win32-API.zip> from
>> <http://www.activestate.com/packages/zips> and that you have unpacked this
>> into a temporary directory - there now should be a Win32-API.ppd file and
>> a .gz file in that directory - you change directory to the directory
>> where you have unpacked these files and then run the command as above.
>>
>> If you get a"Bad command or filename" error then this means that ppm.bat
>> is not in your path - it should be in c:\perl\bin ...
>>
>> Of course this is all addressed in the documentation that comes with
>> ActivePerl - you can find it under the Active Perl start menu item ...
>>
>> /J\
>> --
>> "The internet is like a car boot sale" - Jon Sopel, BBC News
>
>
--
"I must call a man in - I want to get felt laid down in the loft" -
Graham Norton
------------------------------
Date: 25 Oct 1999 14:21:22 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Unpacking modules on <cough> Windows ... ?
Message-Id: <38145952_2@newsread3.dircon.co.uk>
make@money.com <genlabs@gmx.net> wrote:
> Hello again,
>
> I hope this is not FAQ #xx or the daily question but in search of
> a solution to my problem with installing ActiveState packages that come in
> .ppm format i ended up here.
> The Readme says :
>
> 'To install this ActiveState PPM package, run the following command
> in the current directory:
> ppm install Win32-API.ppd'
>
That is a correct way of installing the module - it assumes that you have
downloaded the .zip file <Win32-API.zip> from
<http://www.activestate.com/packages/zips> and that you have unpacked this
into a temporary directory - there now should be a Win32-API.ppd file and
a .gz file in that directory - you change directory to the directory
where you have unpacked these files and then run the command as above.
If you get a"Bad command or filename" error then this means that ppm.bat
is not in your path - it should be in c:\perl\bin ...
Of course this is all addressed in the documentation that comes with
ActivePerl - you can find it under the Active Perl start menu item ...
/J\
--
"The internet is like a car boot sale" - Jon Sopel, BBC News
------------------------------
Date: Mon, 25 Oct 1999 17:14:03 +0200
From: "make@money.com" <genlabs@gmx.net>
Subject: Re: Unpacking modules on <cough> Windows ... ?
Message-Id: <940864441.267200@news.vbs.at>
I use Perl 5.005_03 .
Please, don't say that I need ActivePerl to use ActiveState modules .
Jonathan Stowe <gellyfish@gellyfish.com> schrieb in im Newsbeitrag:
38145952_2@newsread3.dircon.co.uk...
> make@money.com <genlabs@gmx.net> wrote:
> > Hello again,
> >
> > I hope this is not FAQ #xx or the daily question but in search of
> > a solution to my problem with installing ActiveState packages that come
in
> > .ppm format i ended up here.
> > The Readme says :
> >
> > 'To install this ActiveState PPM package, run the following command
> > in the current directory:
> > ppm install Win32-API.ppd'
> >
>
> That is a correct way of installing the module - it assumes that you have
> downloaded the .zip file <Win32-API.zip> from
> <http://www.activestate.com/packages/zips> and that you have unpacked this
> into a temporary directory - there now should be a Win32-API.ppd file and
> a .gz file in that directory - you change directory to the directory
> where you have unpacked these files and then run the command as above.
>
> If you get a"Bad command or filename" error then this means that ppm.bat
> is not in your path - it should be in c:\perl\bin ...
>
> Of course this is all addressed in the documentation that comes with
> ActivePerl - you can find it under the Active Perl start menu item ...
>
> /J\
> --
> "The internet is like a car boot sale" - Jon Sopel, BBC News
------------------------------
Date: 25 Oct 1999 06:09:11 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: upload file help
Message-Id: <slrn818ehv.fji.abigail@alexandra.delanet.com>
F Timothy Martin (fmartin@steel.ucs.indiana.edu) wrote on MMCCXLI
September MCMXCIII in <URL:news:7ul1f4$nv3$1@flotsam.uits.indiana.edu>:
??
?? Is it possible to upload a file from an html form using cgi? I know what
?? to do on the html side to get an upload form box, what do I need to write
?? in the cgi? Right now I can get the name of the file, but can't retrieve
?? the actual file.
And your Perl question is?
Abigail
--
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Wed, 27 Oct 1999 04:05:43 GMT
From: wharmon@prodigy.net
Subject: Using an SQL query across OS's via Web browser.
Message-Id: <381679c8.911503082@news.rio.com>
A coupleof questions to hopefully point me in the right direction.
I have a Perl CGI script that currently loads a text db into an
arrary, allows a user to search that db, and produces a paged display
of the results. My first working CGI program, and, for me, that's
pretty neat.
Now, I would like to improve it.
Our Web server is an Apache server with Red Hat Linux as the OS. My
workplace has a NT server running IIS where they intend to locate
Access db's that are intended for Web access. I am wondering if it
is asking too much if I try and access the MSAccess db from our Apache
Web server using SQL ? I have noted posts that the DBI module is the
tool of choice, but I am wondering if cross-platform SQL queries are a
sane approach or not.
Queries will be made from a Web browser.
If I am not off in cyber-dreamland, is there a Web reference where I
can get a look at how it is done?
Thanks.
Will
------------------------------
Date: Mon, 25 Oct 1999 12:44:40 GMT
From: kennedyjd@my-deja.com
Subject: Re: Very New Perl User question
Message-Id: <7v1jbo$t6$1@nnrp1.deja.com>
Yes, the $ENV{REMOTE_ADDR} environmet variable is set. I finally got
this script working via a different way.
Thanks again all!
-- Joe
In article <381934e8.4362582@news.skynet.be>,
bart.lateur@skynet.be (Bart Lateur) wrote:
> kennedyjd@my-deja.com wrote:
>
> >The problem is that if I assign $Host with a IP address, it works,
yet
> >in the current state $Host and $name are blank.
> >
> >Thoughts?
>
> Is you $ENV{REMOTE_ADDR} environmet variable even set? Try printing it
> out to the browser, you'll soon know.
>
> --
> Bart.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 25 Oct 1999 13:48:35 -0400
From: Bill Williams <biwillia@cisco.com>
Subject: waitpid usage question
Message-Id: <381497F3.54698B51@cisco.com>
I am trying to regulate some spawned processes (see below) and am
trying to make sure that the return codes are caught and the processes
are logged *after* completion. What happens however is that the logging
occurs as soon as the process is kicked off. I am obviously not using
Waitpid correctly. Any ideas? The processes are kicking off fine, but if
I change the waitpid call to "waitpid (-1, &WNOHANG)" it has the
same effect as just "wait" where only one process is kicked off.
<snip>
$id = exec qq{/usr/local/bin/rsync --rsync-path
/usr/local/bin/rsync --timeout=120 -opgtuz $file
$remote_sys:$remote_arch_dir/}
unless ($pid = fork);
$rc = $?;
print "rc is $rc\n";
$no_of_streams++;
waitpid ($pid, 1);
if ($rc == 0 && $transferred{$file} != 1) {
open (XFER,
">>$local_arch_dir/.files_transferred.$name") || die "can't update
transfer log $!\n";
flock (XFER,1) || warn "unable to lock xfer file
-- $!\n";
print XFER "$file\n" || die "can't update
transfer log\n";
close XFER;
}
flock (XFER,8);
print "$file transferred successfully \n";
flock (DBF,8) || warn "Can't unlock $file --
$!\n";
<snip>
--
Thanks,
__________________________
Bill Williams
ERP Systems Administrator
Cisco Systems - RTP-IS
------------------------------
Date: Tue, 26 Oct 1999 00:37:45 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: waitpid usage question
Message-Id: <tJ6R3.358$8F2.4260@nsw.nnrp.telstra.net>
On Mon, 25 Oct 1999 13:48:35 -0400,
Bill Williams <biwillia@cisco.com> wrote:
> I am trying to regulate some spawned processes (see below) and am
> trying to make sure that the return codes are caught and the processes
> are logged *after* completion. What happens however is that the logging
> occurs as soon as the process is kicked off. I am obviously not using
> Waitpid correctly. Any ideas? The processes are kicking off fine, but if
>
> I change the waitpid call to "waitpid (-1, &WNOHANG)" it has the
> same effect as just "wait" where only one process is kicked off.
>
> <snip>
> $id = exec qq{/usr/local/bin/rsync --rsync-path
> /usr/local/bin/rsync --timeout=120 -opgtuz $file
> $remote_sys:$remote_arch_dir/}
> unless ($pid = fork);
> $rc = $?;
> print "rc is $rc\n";
> $no_of_streams++;
>
> waitpid ($pid, 1);
You should probably use constants here. And why the 1? A 0 should do,
shouldn't it? Don't you really want a wait? Maybe that option doesn't
do what you think it does :)
And I would probably write the code a little bit different. It's hard
to tell in this mishmash what's being done by the child and what by
the parent. I find a clear
if ($pid = fork)
{
# Do parent things
}
else
{
# Do child things
}
much more easy to read and debug. (and of course you should also check
for $pid not being defined)
Martien
--
Martien Verbruggen |
Interactive Media Division | Think of the average person. Half of
Commercial Dynamics Pty. Ltd. | the people out there are dumber.
NSW, Australia |
------------------------------
Date: Mon, 25 Oct 1999 14:14:46 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: waitpid usage question
Message-Id: <Pine.GSO.4.10.9910251409340.29843-100000@user2.teleport.com>
On Mon, 25 Oct 1999, Bill Williams wrote:
> I change the waitpid call to "waitpid (-1, &WNOHANG)" it has the
> same effect as just "wait" where only one process is kicked off.
That sounds as if you're not doing it right. Alas, your code is too
complex for me to be sure what you're saying.
> unless ($pid = fork);
> $rc = $?;
You should check that fork returns a defined value, since it may fail. But
what do you think will be in the $? variable? At least one of us is
confused at this point.
> $no_of_streams++;
>
> waitpid ($pid, 1);
Wait - is this the code you're running in the child? The child can't wait
for itself!
> flock (XFER,8);
It's hardly ever correct to attempt to release a file lock from a perl
program.
Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
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 1203
**************************************