Re: How to check installed Modules in perl

2002-04-16 Thread Gabby Dizon
You can use the ExtUtils::Installed module to list all the modules installed in your copy of perl. It's available in CPAN. Gabby Dizon Web Developer Inq7 Interactive, Inc. http://www.inq7.net http://you.inq7.net - Original Message - From: "Alex Cheung Tin Ka" <[EMAIL PROTECTED]> To: <[EMA

Parsing variables and HTML

2002-04-16 Thread Daniel Falkenberg
Hello All, I am having a little bit of trouble with HTML and perl. I want to be able to parse variable from some HTML code where a user hits a submit button and the data they entered from that from should be parsed to the next sub. At the moment I am using the following code... $action = param(

Module for sending Fax

2002-04-16 Thread Robert Graham
Good day Does anyone know of a perl module I can use to send a fax with? Regards Robert Graham -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: How to check installed Modules in perl

2002-04-16 Thread Jeff 'japhy' Pinyan
On Apr 17, Alex Cheung Tin Ka said: >I am new to perl. I would like to know what can I do to check >whether I have installed particular module in perl. The simplest way is: perl -MModule -e0 If that runs without Perl saying "Can't find Module.pm in ...", you've got the module. Example:

How to check installed Modules in perl

2002-04-16 Thread Alex Cheung Tin Ka
Dear All, I am new to perl. I would like to know what can I do to check whether I have installed particular module in perl. Thanks Alex

RE:regex tester

2002-04-16 Thread Clemens Giegerich
Yesterday I have made regexEvaluater1.0.pl public. It's a perl-Tk script for interactive developing of perl regular expression. Unlike regexp it hasn't any syntax highlighting but it has two text areas one before and after applying the expression and it is fully written in perl. Perl's special var

RE: need help with PPM

2002-04-16 Thread Manoj Jacob
Hi Felix and Timothy and others, Thank you very much for your advice. I have done the required. unfortunately as the machine i have installed Perl is on the Server of our workplace, i am unable to do a restart. Is restarting after assigning the HTTP_proxy variable essential or should the problem b

RE: Counting pairs in a hash.

2002-04-16 Thread Timothy Johnson
I'm sure there is a better way, but you could do it this way: foreach(keys %hash){ $count++; } print "$count keys.\n"; -Original Message- From: Glenn Cannon To: [EMAIL PROTECTED] Sent: 4/16/02 7:20 PM Subject: Counting pairs in a hash. All, What is the simplest way to find out how

Re: setuid ing perl?

2002-04-16 Thread Henk-Jan
> On Tue, Apr 16, 2002 at 11:27:50PM +0200, Henk-Jan wrote: > > I used " perl -MCPAN -e shell" > > to install new perl modules. > > I now also have perl 5.6.1 (I had 5.6.0) > > This was a bug with older versions of the CPAN shell. What version of the > shell are you running? I'd suggest upgradin

Peeking into a return list was - Re: Errors Running Learning Perl in Win32 Scripts

2002-04-16 Thread drieux
On Tuesday, April 16, 2002, at 04:15 , David Gray wrote: Another INSANE, but actually useful, illustration from Jenda: { how does he pop them out? } >> Example: >> >> sub foo { (0,1,2,3,4,5,6,6,8,9) }; >> >> (undef,undef,undef,undef,@a1) = foo(); >> @a2 = (foo())[4]; >> >> pr

Re: Counting pairs in a hash.

2002-04-16 Thread Jeff 'japhy' Pinyan
On Apr 16, Glenn Cannon said: >What is the simplest way to find out how many pairs I have in a hash? Use the keys() function. $nkeys = keys %hash; -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www

Counting pairs in a hash.

2002-04-16 Thread Glenn Cannon
All, What is the simplest way to find out how many pairs I have in a hash? I am putting a variable number in when reading data from a file, and I then need to split the file in half for display. Thx, Glenn.

Re: OT: Old uunet gag was Re: How to thread in Perl?

2002-04-16 Thread Ahmed Moustafa
Is there a way to know the Missile Address from an IP address? -- Ahmed Moustafa http://pobox.com/~amoustafa -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Definition

2002-04-16 Thread Chas Owens
On Tue, 2002-04-16 at 19:48, Bill Lyles wrote: > As I am somewhat new to perl > can someone tell me what this means > > $header = qq~ > > I understand the header but what is the qq~ for? > > Thanks qq sets up the character to use in place of ". Your code probably looks like this $header = qq

Definition

2002-04-16 Thread Bill Lyles
As I am somewhat new to perl can someone tell me what this means   $header = qq~   I understand the header but what is the qq~ for?   Thanks

Meaning

2002-04-16 Thread Bill Lyles
As I am somewhat new to perl can someone tell me what this means   $header = qq~   I understand the header but what is the qq~ for?   Thanks  

RE: Errors Running Learning Perl in Win32 Scripts

2002-04-16 Thread David Gray
> > > Change this line > > > > > >($name, $aliases, $addrtype, $length, @addrs) = > > > gethostbyname($host); > > > > > > To > > > > > >(undef, undef, undef, undef, @addrs) = gethostbyname($host); > > > > I think mine is prettier, at least (see below)... Is there a reason > > why this

Net::SFTP installation on Windows

2002-04-16 Thread Ahmed Moustafa
How can I install Net::SSH and Net::SFTP on ActivePerl (Windows NT), please? Your help will be appreciated so much. Thanks, Ahmed -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Errors Running Learning Perl in Win32 Scripts

2002-04-16 Thread Jenda Krynicky
From: "David Gray" <[EMAIL PROTECTED]> > > Change this line > > > >($name, $aliases, $addrtype, $length, @addrs) = > > gethostbyname($host); > > > > To > > > >(undef, undef, undef, undef, @addrs) = gethostbyname($host); > > I think mine is prettier, at least (see below)... Is there a

RE: Errors Running Learning Perl in Win32 Scripts

2002-04-16 Thread David Gray
> Change this line > >($name, $aliases, $addrtype, $length, @addrs) = > gethostbyname($host); > > To > >(undef, undef, undef, undef, @addrs) = gethostbyname($host); I think mine is prettier, at least (see below)... Is there a reason why this might be considered "Better" than doing: @

Re: setuid ing perl?

2002-04-16 Thread Michael Fowler
On Tue, Apr 16, 2002 at 11:27:50PM +0200, Henk-Jan wrote: > I used " perl -MCPAN -e shell" > to install new perl modules. > I now also have perl 5.6.1 (I had 5.6.0) This was a bug with older versions of the CPAN shell. What version of the shell are you running? I'd suggest upgrading it, so th

Re: Looking for an old project

2002-04-16 Thread Alfred Vahau
Hi, Probably have PPT (Perl Power Tools) project in mind? Check under scripts directory at CPAN. Alfred Vahau Project Breeze SNPS UniPNG -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Errors Running Learning Perl in Win32 Scripts

2002-04-16 Thread John W. Krahn
Anthony Beaman wrote: > > Hi! I have version 5.005_03 and I'm using the Win32 version of the Learning Perl >book. I'm having trouble running a few scripts. For example, when I run the following: > > Exercise 16.1 > > foreach $host (@ARGV) { > ($name, $aliases, $addrtype, $length, @addrs) = g

setuid ing perl?

2002-04-16 Thread Henk-Jan
I used " perl -MCPAN -e shell" to install new perl modules. I now also have perl 5.6.1 (I had 5.6.0) But I am afraid that my perl does not support setuid anymore. How can I simply reinstall perl, but then with setuid support using CPAN? Henk -- To unsubscribe, e-mail: [EMAIL PROTECTED] Fo

Re: localtime help

2002-04-16 Thread Jenda Krynicky
From: "James Kelty" <[EMAIL PROTECTED]> > Can someone point me to the perldoc's that can help me get the > localtime equivalent of the shell command /bin/date +'%Y%m%d' ? I believe you are looking for perldoc POSIX Jenda === [EMAIL PROTECTED] == http://Jenda.Krynicky.cz

Re: localtime help

2002-04-16 Thread Jeff 'japhy' Pinyan
On Apr 16, James Kelty said: >Can someone point me to the perldoc's that can help me get the localtime >equivalent of the shell command /bin/date +'%Y%m%d' ? Either perldoc -f localtime and roll your own, or read perldoc POSIX and look for strftime(). It uses the same format strings as

Re: Errors Running Learning Perl in Win32 Scripts

2002-04-16 Thread Jenda Krynicky
From:bob ackerman <[EMAIL PROTECTED]> > daytime service reports the date on port 13 on unix boxes. > no, you won't find it on NT. I don't have NTs by hand by on Win2k Pro : c:\> telnet localhost 13 11:08:28 PM 4/16/2002 Connection to host lost. But you have to enable/ins

localtime help

2002-04-16 Thread James Kelty
Can someone point me to the perldoc's that can help me get the localtime equivalent of the shell command /bin/date +'%Y%m%d' ? Thanks! -James James Kelty Sr. Unix Systems Administrator Everbase Systems 541.488.0801 [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

RE: Perl CGI with ISP - advice?

2002-04-16 Thread Ron Goral
These modules you mention, except AnyData::CSV, are in a standard Perl install. As such, if the ISP has Perl installed, they will be there. Go to http://www.scriptsolutions.com/programs/free/perldiver/ and download perldiver. It is free. Place it in the cgi-bin directory (or where ever you plan

RE: Errors Running Learning Perl in Win32 Scripts

2002-04-16 Thread Anthony Beaman
Thanks for all of the help. Is the book I'm using (Learning Perl on Win32) a decent book or should I find another? I mean, these scripts were implied to be NT friendly. Also, Should I drop off this list and find a Win32 Beginners list instead since I'm using NT exclusively? Anyone recommend one

Re: how to make local variable retain value

2002-04-16 Thread Michael Fowler
On Tue, Apr 16, 2002 at 03:58:53PM -0400, Chas Owens wrote: > The idea behind this sub is that $static gets incremented each time you > call the subroutine. If that is not what you want then yes, the if-else > is not needed. In that case you would want to say something like: > > sub sub1 { >

Re: how to make local variable retain value

2002-04-16 Thread Chas Owens
On Tue, 2002-04-16 at 15:51, Elias Assmann wrote: > On 16 Apr 2002, Chas Owens wrote: > > sub has_a_static_var { > > #declare a "static" variable > > my $static if 0; > > > > if (defined $static) { $static++ } > > else { $static = 0 } > > > > #do stuff > > } >

Re: Errors Running Learning Perl in Win32 Scripts

2002-04-16 Thread bob ackerman
On Tuesday, April 16, 2002, at 12:13 PM, Anthony Beaman wrote: > Thanks! > I can't find the file anywhere and I'm on NT. What would the name of this > be (or equivalent) be on NT? Plus, as a "FYI", what does this file do? > Thanks! > daytime service reports the date on port 13 on unix boxes.

Re: how to make local variable retain value

2002-04-16 Thread Elias Assmann
On 16 Apr 2002, Chas Owens wrote: > sub has_a_static_var { > #declare a "static" variable > my $static if 0; > > if (defined $static) { $static++ } > else { $static = 0 } > > #do stuff > } May I ask why you do this if-else thing here? It seems super

More Bidirectional Sockets w/ Win32 Client

2002-04-16 Thread James Taylor
I have figured out how to set up bidirectional communication through sockets by forking the server and the client - The client forks just fine under Linux, but if I take the script to Win32 fork doesn't seem to work. This is the code for both the server and client: Here's the server: #!/usr/

Re: Need help getting started using hashes

2002-04-16 Thread Dave K
David Gray, Thanks for the input. Below is another realization using a pseudohash. Some of the code (print stmts at the end) is there to demonstrate concepts (the way your post did). my $sql = "select methodid, method, sname from method order by methodid"; my $sth = $dbh->prepare($sql) or die

RE: Errors Running Learning Perl in Win32 Scripts

2002-04-16 Thread Anthony Beaman
Thanks! I can't find the file anywhere and I'm on NT. What would the name of this be (or equivalent) be on NT? Plus, as a "FYI", what does this file do? Thanks! -Original Message- From: bob ackerman [mailto:[EMAIL PROTECTED]] Sent: Tu

RE: Need help getting started using hashes

2002-04-16 Thread David Gray
> > my $sql = "select * from method"; > > #replace prev. line with: > my $sql = 'select methodid,method,sname from method'; >$sql .= 'order by methodid'; #second line should be $sql .= ' order by methodid'; -dave -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: Errors Running Learning Perl in Win32 Scripts

2002-04-16 Thread bob ackerman
On Tuesday, April 16, 2002, at 11:18 AM, Anthony Beaman wrote: > I did this and I'm now getting the following error: > > IO::Socket::INET: Unknown error at 415b.pl line 2 > Can't connect to daytime port at localhost at 415b.pl line 2. > > That's what I was getting last night (I changed various

RE: Need help getting started using hashes

2002-04-16 Thread David Gray
> First let's let the other list member in on the code: > > use DBI; > use strict; > my $dbname = "test"; > my $host = "localhost"; > my $dbuser = ''; > my $dbpw = ''; > my $mscs = "dbi:mysql:dbname=$dbname;host=$host;"; > my $dbh = DBI->connect($mscs, $dbuser, $dbpw) or die "Connect fails to > $

Re: how to make local variable retain value

2002-04-16 Thread Chas Owens
On Tue, 2002-04-16 at 14:01, richard noel fell wrote: > If in a subroutine, I have a statements > > sub > { > > my $local_var=1 > > > > $local_var=$local_var+1; > > > } > then the next time I run this subroutine, $local_var is reinitialized to > 1. However, I would like to have it r

RE: Errors Running Learning Perl in Win32 Scripts

2002-04-16 Thread Anthony Beaman
I did this and I'm now getting the following error: IO::Socket::INET: Unknown error at 415b.pl line 2 Can't connect to daytime port at localhost at 415b.pl line 2. That's what I was getting last night (I changed various things and compiled but got various errors each time). The problem, to me,

Re: how to make local variable retain value

2002-04-16 Thread Felix Geerinckx
on Tue, 16 Apr 2002 18:01:28 GMT, Richard Noel Fell wrote: > If in a subroutine, I have a statements > > sub > { > > my $local_var=1 > > > > $local_var=$local_var+1; > > > } > then the next time I run this subroutine, $local_var is reinitialized to > 1. However, I would like to hav

RE: Writing formatted results to a file

2002-04-16 Thread Ho, Tony
Hi Bob Thanks for the help. I renamed the format label from ADDRESSLABEL to SUMMARY and it appeared to work also. Thanks again for the help. Tony -Original Message- From: bob ackerman [mailto:[EMAIL PROTECTED]] Sent: 16 April 2002 19:36 To: [EMAIL PROTECTED] Subject: Re: Writing formatted

Re: Looking for an old project

2002-04-16 Thread Felix Geerinckx
on Tue, 16 Apr 2002 17:20:36 GMT, Jeff Barrett wrote: > A year or more ago I remember coming across an ongoing project that > I'm trying to locate. The basic idea was to implement all of the > basic Unix shell commands (e.g. ls, find, cat, etc.) in Perl so as to > be used on any platform that wa

how to make local variable retain value

2002-04-16 Thread richard noel fell
If in a subroutine, I have a statements sub { my $local_var=1 $local_var=$local_var+1; } then the next time I run this subroutine, $local_var is reinitialized to 1. However, I would like to have it retain its value from the previous call to the subroutine. For example, if $local_var

Re: Writing formatted results to a file

2002-04-16 Thread bob ackerman
On Tuesday, April 16, 2002, at 10:11 AM, Ho, Tony wrote: > Hi guys > I was wondering if you could help me. > Does anybody know how to write formatted results to a file ? > > I am getting the following error : > > write() on closed filehandle main::ADDRESSLABEL at ./test.pl line 2785, > line 5.

RE: modules install ...

2002-04-16 Thread Nikola Janceski
you can't get ALL the modules using the ppm executable... sometimes you just have to download it from cpan.org and install it yourself. > -Original Message- > From: Alain Savio [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 16, 2002 1:33 PM > To: [EMAIL PROTECTED] > Subject: modules in

Re: Writing formatted results to a file

2002-04-16 Thread bob ackerman
On Tuesday, April 16, 2002, at 10:11 AM, Ho, Tony wrote: > Hi guys > I was wondering if you could help me. > Does anybody know how to write formatted results to a file ? > > I am getting the following error : > > write() on closed filehandle main::ADDRESSLABEL at ./test.pl line 2785, > line 5.

modules install ...

2002-04-16 Thread Alain Savio
Hi, I'm using ppm3 on windows to install modules and it works fine, the problem is that the releases I'm looking for aren't available from the 'ActiveState Package Repository' installed after having install activestate. Any idea ??? __ Alain Savio Database administrator d

Looking for an old project

2002-04-16 Thread Jeff Barrett
A year or more ago I remember coming across an ongoing project that I'm trying to locate. The basic idea was to implement all of the basic Unix shell commands (e.g. ls, find, cat, etc.) in Perl so as to be used on any platform that was Perl friendly. Has anyone heard of this project, and if so,

Writing formatted results to a file

2002-04-16 Thread Ho, Tony
Hi guys I was wondering if you could help me. Does anybody know how to write formatted results to a file ? I am getting the following error : write() on closed filehandle main::ADDRESSLABEL at ./test.pl line 2785, line 5. write() on closed filehandle main::ADDRESSLABEL at ./test.pl line 2785,

Re: Errors Running Learning Perl in Win32 Scripts

2002-04-16 Thread bob ackerman
On Tuesday, April 16, 2002, at 09:05 AM, Anthony Beaman wrote: > Thanks! I think your advice may apply to the following code that I'm > having trouble with: > > use Win32::NetAdmin; > $username = Win32::LoginName; > Win32::NetAdmin::UserGetAttributes("", $username, $password, > $passwordage, $

RE: Errors Running Learning Perl in Win32 Scripts

2002-04-16 Thread David Gray
> Thanks! I think your advice may apply to the following code > that I'm having trouble with: > > use Win32::NetAdmin; > $username = Win32::LoginName; > Win32::NetAdmin::UserGetAttributes("", $username, $password, > $passwordage, $privilege, $homedir, $comment, $flags, > $scriptpath); > print "

Re: OT: Old uunet gag was Re: How to thread in Perl?

2002-04-16 Thread Chas Owens
On Tue, 2002-04-16 at 11:38, Jonathan E. Paton wrote: > > [..] > > >> Missile Address: 33:48:3.521N 84:23:34.786W > > > > > > By the way, what is the Missile Address? > > > > that is the lattitude and longitude of where the server > > is suppose to be located - an old habit from the UUNET > > en

Re: Need help getting started using hashes

2002-04-16 Thread Dave K
First let's let the other list member in on the code: use DBI; use strict; my $dbname = "test"; my $host = "localhost"; my $dbuser = ''; my $dbpw = ''; my $mscs = "dbi:mysql:dbname=$dbname;host=$host;"; my $dbh = DBI->connect($mscs, $dbuser, $dbpw) or die "Connect fails to $dbname\nError = ", $DB

RE: grep a array element..

2002-04-16 Thread Steven_Massey
To all that help - much appreciated.. Nikola Janceski <[EMAIL PROTECTED]> on 04/16/2002 04:54:00 PM To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>, Nikola Janceski <[EMAIL PROTECTED]> cc: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>, "Beginners (E-mail)" <[EMAIL PROTECTED]> Sub

RE: Need help getting started using hashes

2002-04-16 Thread KEVIN ZEMBOWER
Well, I guess I spoke too soon. I still don't understand something. When I execute your program, David, it returns this www:/cire # ./methodtest3.pl Key: 1 Value: Combined OCs Key: 10 Value: Diaphragm Cervical Cap Key: 11 Value: Fertility Awareness-based Methods Key: 12 Value: Lacationa

RE: Errors Running Learning Perl in Win32 Scripts

2002-04-16 Thread Anthony Beaman
Thanks! I think your advice may apply to the following code that I'm having trouble with: use Win32::NetAdmin; $username = Win32::LoginName; Win32::NetAdmin::UserGetAttributes("", $username, $password, $passwordage, $privilege, $homedir, $comment, $flags, $scriptpath); print "The homedir for $u

Re: Read file symbol by symbol?

2002-04-16 Thread Jonathan E. Paton
> how read a file one by one symbols, not > a whole string once at time? You don't want to, reading one character at a time is VERY slow. At worst, the operating system will cut short your time slot whilst it waits for the file access - perhaps limiting you to a few dozen characters per second..

RE: grep a array element..

2002-04-16 Thread Nikola Janceski
Please do... I thought using qr// to store REs in variables speed up since it gets compiled once instead of over and over again. > -Original Message- > From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 16, 2002 11:50 AM > To: Nikola Janceski > Cc: '[EMAIL PROTECT

RE: Need help getting started using hashes

2002-04-16 Thread KEVIN ZEMBOWER
David, your revisions made your solution even more clear to me. With regard to my earlier question of using this in a subroutine, I think I now see that %thehash would be my persistent repository for methods, and that I could refer to it just like you did in the last three lines, without rereading

RE: grep a array element..

2002-04-16 Thread Jeff 'japhy' Pinyan
On Apr 16, Nikola Janceski said: >Yes but only if you are looking for that pattern.. if you wanted to add >something like "sedan" then you need to use // but the qr would speed up the >compile when using a $var in the //; > >if($element =~ $lookfor) { ## works if $lookfor = qr/car/; the same

RE: grep a array element..

2002-04-16 Thread Jeff 'japhy' Pinyan
On Apr 16, David Gray said: >> my $lookfor = qr/car/; # this is faster and you don't even >> need to put in the // > >> > if ($element =~ /$lookfor/) { > >Are you saying the if inside the foreach could be written as: > >if($element =~ $lookfor) { > >If the search string is defined with qr//?

RE: grep a array element..

2002-04-16 Thread Nikola Janceski
Yes but only if you are looking for that pattern.. if you wanted to add something like "sedan" then you need to use // but the qr would speed up the compile when using a $var in the //; if($element =~ $lookfor) { ## works if $lookfor = qr/car/; the same as $element =~ /car/ if($element =~ /s

RE: grep a array element..

2002-04-16 Thread David Gray
> uh... > > my $lookfor = qr/car/; # this is faster and you don't even > need to put in the // > > --- > > use strict; > > > > my @array = qw(car bus caravan bike cart); > > > > my $lookfor = "car"; > > > > foreach my $element (@array) { > > if ($element =~ /$lookfor/) { > > prin

RE: Errors Running Learning Perl in Win32 Scripts

2002-04-16 Thread David Gray
> Hi! I have version 5.005_03 and I'm using the Win32 version > of the Learning Perl book. I'm having trouble running a few > scripts. For example, when I run the following: > > Exercise 16.1 > > foreach $host (@ARGV) { > ($name, $aliases, $addrtype, $length, @addrs) = > gethostbyname($host

Re: OT: Old uunet gag was Re: How to thread in Perl?

2002-04-16 Thread Jonathan E. Paton
> [..] > >> Missile Address: 33:48:3.521N 84:23:34.786W > > > > By the way, what is the Missile Address? > > that is the lattitude and longitude of where the server > is suppose to be located - an old habit from the UUNET > entries into the UUMAPS - that has held on by some > > in essence,

RE: Need help getting started using hashes

2002-04-16 Thread KEVIN ZEMBOWER
Thank you, David, very much for your solution. With one minor change ("use DBD::mysql"), it worked perfectly. I am in awe of you ability to do this. I was hoping to use this as a subroutine, to build an array in memory, then to use it repeatedly without rereading the database. Can your solution b

RE: question

2002-04-16 Thread Daryl J. Hoyt
If you need to call a function in another Perl script, you must "require" that script in your program. You can then call the desired function. Make sure the script you wand to require is in the same directory or you will have to push its directory into the @INC array. Here is an example. #!/

Re: get PID od existing process

2002-04-16 Thread Jonathan E. Paton
Michael Lamertz: > BTW: it's > > $output = `ps -e` > > You don't need the 'system' inside the backquotes. Think about using > qx{} instead of the backquote operator if you need to do more complex > stuff in the shell. It would be better to start using qx() now, it is far more readable. E.

Re: Variable question

2002-04-16 Thread Chas Owens
On Wed, 2002-04-10 at 11:10, Randal L. Schwartz wrote: > > "Bob" == Bob Ackerman <[EMAIL PROTECTED]> writes: > > >> At no point do you have an "array" in a scalar context, or a "list" > >> in a scalar context. Really. You don't. Ever. Get it? > >> > >> And why I'm harping on this is that

giving up on perlcc, now trying perl -MO=c z.pl, still hasproble ms

2002-04-16 Thread Collins, Joe (EDSI\\BDR)
Perlcc.bat seems to difficult at this stage and thus I tried simplifying it. My platform: Windows 2000 or XP My Perl: v5.6.0 built for MSWin32-x86-multi-thread Binary build 618 z.pl: use strict; my $ans=3*12; print "3x12=$ans\n"; What I tried: perl -MO=c z.pl The results: Undefined sub

Re: OT: Old uunet gag was Re: How to thread in Perl?

2002-04-16 Thread Chas Owens
On Mon, 2002-04-15 at 19:32, drieux wrote: > > On Monday, April 15, 2002, at 03:56 , Ahmed Moustafa wrote: > [..] > >> Missile Address: 33:48:3.521N 84:23:34.786W > > > > By the way, what is the Missile Address? > > > that is the lattitude and longitude of where the server > is suppose to be l

RE: Perl License

2002-04-16 Thread Chas Owens
Be careful if you are including something that is licensed to you under the GPL. The GPL requires that you distribute the source code (only the GPLed stuff and your modifications to that source) to anyone you sell the product to. What this means is that if you have a library foo that is under th

Re: question

2002-04-16 Thread Chas Owens
On Tue, 2002-04-16 at 09:39, Tucker, Ernie wrote: > How can a have one perl script call another perl script ? > > > Ernest P. Tucker II > Network Technician > Charter Communications > Madison Management Area >(608) 373-7625 > That depends on what you mean by call. If you want to run a

Need help getting started using hashes

2002-04-16 Thread KEVIN ZEMBOWER
I'm having a hard time understanding and getting started with hashes. I don't think I get the concept, and so can't go from the concept to the actual code. I have a MySQL database table called "methods" with three fields, methodid, method, and sname. I'd like to read them into a hash, so that I c

RE: grep a array element..

2002-04-16 Thread Nikola Janceski
uh... my $lookfor = qr/car/; # this is faster and you don't even need to put in the // > -Original Message- > From: John Edwards [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 16, 2002 9:42 AM > To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] > Subject: RE: grep a array element.. > > > Y

RE: grep a array element..

2002-04-16 Thread John Edwards
You mean something like this? --- use strict; my @array = qw(car bus caravan bike cart); my $lookfor = "car"; foreach my $element (@array) { if ($element =~ /$lookfor/) { print "Found a match!! => $element\n"; } else { print "$lookfor doesn't match $element\n"; } }

Errors Running Learning Perl in Win32 Scripts

2002-04-16 Thread Anthony Beaman
Hi! I have version 5.005_03 and I'm using the Win32 version of the Learning Perl book. I'm having trouble running a few scripts. For example, when I run the following: Exercise 16.1 foreach $host (@ARGV) { ($name, $aliases, $addrtype, $length, @addrs) = gethostbyname($host); print "$host:\n

question

2002-04-16 Thread Tucker, Ernie
How can a have one perl script call another perl script ? Ernest P. Tucker II Network Technician Charter Communications Madison Management Area (608) 373-7625

grep a array element..

2002-04-16 Thread Steven_Massey
Hi all within a for loop I want to grep/pattern match a variable with each array element what would the syntax be ?? many thanks steve -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Read file symbol by symbol?

2002-04-16 Thread Sudarsan Raghavan
Dave K wrote: > Here is one script I used to inspect files > > use strict; > my $fn; > print"Enter the name of a file you want to examine "; > while (<>) { It is better to write this as while (). The reason being if all the command line arguments (if any are provided) have not been shifted

RE: How to do a cron job?

2002-04-16 Thread Ron Goral
Cool. Thanks for the leads on SSH Telnet. Also, thanks to drieux for all your help and advise. Peace In Christ - Ron Goral [EMAIL PROTECTED] > -Original Message- > From: Roger Morris [mailto:[EMAIL PROTECTED]] > Sent: Monday, April 15, 2002 4:37 PM > To: D

strange cgi error?

2002-04-16 Thread Martin A. Hansen
hi i have a faulty cgi script which hangs my browser (konq). running the cgi script from a shell shows this first line: Something is wrong?Content-type: text/html so, what is wrong? martin -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Read file symbol by symbol?

2002-04-16 Thread Dave K
Here is one script I used to inspect files use strict; my $fn; print"Enter the name of a file you want to examine "; while (<>) { $fn = $_; last if $fn; } print "Opening $fn\n"; open TF, "$fn" or die "Cannot open $fn:$!\n"; my @ov; my $ov; while () { @ov = unpack('U*',$_); print; print"\t\t"

Re: Checking and email address

2002-04-16 Thread Kevin Meltzer
If you want to see if a variable contains a @, do what the other suggested. If you want to see if you have (at least) a well formed email address (with optional MX host checking) look at Email::Valid. Cheers, Kevin On Mon, Apr 15, 2002 at 11:58:11PM -0400, Daniel Falkenberg ([EMAIL PROTECTED]) s

Re: get PID od existing process

2002-04-16 Thread Michael Lamertz
On Tue, Apr 16, 2002 at 12:49:40PM +0100, Dermot Paikkos wrote: > Hi Guru's > > SYS stuff: perl 5.05 on Tru64 Unix. > > I am writing a script that needs to find the process IDs of a couple of > processes (so they can be killed nicely). Under the csh i would usually > do "ps -e| grep process".

RE: perlcc faq ?

2002-04-16 Thread Collins, Joe (EDSI\\BDR)
Here is all of it (code, platform, error message). The code is as simple as it gets and it will not compile. Any ideas are welcome. My source: use strict; my $ans=3*12; print "3x12=$ans\n"; My platform: Windows XP and Windows 2000. My Perl: v5.6.0 built for MSWin32-x86-multi-thread Binary

Read file symbol by symbol?

2002-04-16 Thread Ramis
Friends, how read a file one by one symbols, not a whole string once at time? Thanks. -- ---! My blessing! Ramis. ! ---! http://www.samtan.fromru.com mailto: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

get PID od existing process

2002-04-16 Thread Dermot Paikkos
Hi Guru's SYS stuff: perl 5.05 on Tru64 Unix. I am writing a script that needs to find the process IDs of a couple of processes (so they can be killed nicely). Under the csh i would usually do "ps -e| grep process". I am not sure if I can do something like this using system or if there is a m

Re: swich user

2002-04-16 Thread Michael Lamertz
On Tue, Apr 16, 2002 at 11:30:08AM +0200, walter valenti wrote: > Hi, > i've got a demon i perl that start from root. > > I would like that after the starting (when starts, does some operation > like root), it swiches like other user with low privileges (es. like > Apache, starts from root and

Re: How use command line parameters?

2002-04-16 Thread Ramis
Many thanks! It works. Johannes Franken wrote: > > * Ramis <[EMAIL PROTECTED]> [2002-04-15 22:14 +0200]: > > I want to get a file name from command line > > Perl pushes then to a list named @ARGV . > So you can access them with any function that > operates on lists, like > foreach, shift, pop o

Re: insert in a browseentry

2002-04-16 Thread John W. Krahn
Jorge Goncalvez wrote: > > Hi, I have this: > > opendir(DIR,"$_Globals{CDROM}:/DHS3MGR/$tel_version/DHS3Linux"); > foreach (readdir(DIR)){ > unless (/([Comm]+)/){ > $box3->insert('end', $_); > } > > $box3 is a browse entry. > It works fine but > > My problem is ther

swich user

2002-04-16 Thread walter valenti
Hi, i've got a demon i perl that start from root. I would like that after the starting (when starts, does some operation like root), it swiches like other user with low privileges (es. like Apache, starts from root and swiches at www-data). I'm trying the POSIX module, using the function: POSI

Re:insert in a browseentry

2002-04-16 Thread Jorge Goncalvez
Hi, I have this: opendir(DIR,"$_Globals{CDROM}:/DHS3MGR/$tel_version/DHS3Linux"); foreach (readdir(DIR)){ unless (/([Comm]+)/){ $box3->insert('end', $_); } $box3 is a browse entry. It works fine but My problem is there is a file under DHS3MGR and not only a

RE: PERL Programming Standsrds Help : Urgent

2002-04-16 Thread Timothy Johnson
Standard #1 TIMTOWTDI :) -Original Message- From: Felix Geerinckx To: [EMAIL PROTECTED] Sent: 4/16/02 12:15 AM Subject: Re: PERL Programming Standsrds Help : Urgent on Tue, 16 Apr 2002 06:39:48 GMT, Rajnish_aggarwal wrote: > I am preparing a standards document for defining the PERL C

RE: Perl License

2002-04-16 Thread Timothy Johnson
You might want to do some research on the GPL license and the Artistic License. The upshot of most of these is that you can reuse people's code as long as you give them credit. Technically I think this means that you need to find out who wrote the modules you use. Someone else might have more

RE: need help with PPM

2002-04-16 Thread Timothy Johnson
ActiveState has some documentation on this at their site, but the environment variable you are probably looking for is HTTP_PROXY. Set it to the proxy server you use. I used to have to do this at my last job. -Original Message- From: Manoj Jacob To: '[EMAIL PROTECTED]' Sent: 4/16/02 1

Re: need help with PPM

2002-04-16 Thread Felix Geerinckx
on Tue, 16 Apr 2002 07:29:49 GMT, Manoj Jacob wrote: > I started exploring Activestate Perl very recently. And I wanted to > install some modules. So I gave the command PPM Search to look for the > modules available. But then I get an error message saying there is > difficulty in connecting to th

  1   2   >