RE: How to Install Perl 5.8

2002-09-30 Thread Timothy Johnson
If you are using WinNT, I would seriously suggest waiting until ActiveState puts out a stable version of 5.8. Until then I'd stick with ActivePerl 5.6.1 build 633. It really is the most stable version of Perl for all Win32 platforms, and comes with PPM, which is a great way to get started with

Re: another regx ...

2002-09-30 Thread John W. Krahn
"John W. Krahn" wrote: > > my ( $ref, $numt, $id, $ext ) = $PATH[ 7 ] =~ /(\w)-(\d{7})-(\d{2}).(\w+)/; Sorry, that should be: my ( $ref, $numt, $id, $ext ) = $PATH[ 7 ] =~ /(\w)-(\d{7})-(\d{2})\.(\w+)/; John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] Fo

How to Install Perl 5.8

2002-09-30 Thread Ajay Singh Tomar (RBIN/EDC3) *
Hello, I have downloaded and extracted stable.tar from www.cpan.org for version 5.8. I have older version of Perl i.e., 5.003. How to uninstall and install 5.8 on WinNT? Regards, Ajay -Original Message- From: Timothy Johnson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 01, 2002 1

RE: Install Question

2002-09-30 Thread Timothy Johnson
What distribution of Perl are you using? What operating system are you using? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, September 30, 2002 8:07 PM To: [EMAIL PROTECTED] Subject: Install Question Hi: I have both perl 5.6.1 and perl 5.6.0 on m

Re: another regx ...

2002-09-30 Thread John W. Krahn
Jerry Preston wrote: > > Hi! Hello, > I am getting no where on this and it is not that hard. > I am trying to break down the following: > > D-2165033-10.TKB61a > > into > > D 2165033 10 > > and > > 4-2175587-08.TKB63a > > into > 4 2175587 08 > > using > > (( $ref, $numt, $id, $ex

Re: What Type Of Data Structure Is This?

2002-09-30 Thread John W. Krahn
Ken Hammer wrote: > > A strange question. > > I'm using the following data structure to > store information from a data base query: > > $tablename{"$table"} = { > "table_name"=> ["$table"], > "index_name"=> ["$index_name"], > "columns"

Install Question

2002-09-30 Thread [EMAIL PROTECTED]
Hi: I have both perl 5.6.1 and perl 5.6.0 on my system. What're the steps to remove them, and prepare for install of perl 5.8? When I run locate perl 5.6.0, I get a list of files. Is this the way to do it? File by file? Thanks for any help in advance. Tom -- To unsubscribe, e-mail: [EMAIL

Re: SQL Table Rows

2002-09-30 Thread Hengky
> > How is it possible to cycle through an SQL table row by row, without having > > to increment an ID by 1 in a while loop and go > > SELECT * FROM table WHERE id=$id > > ? > > And how can I find out how many rows are in the table? > > i hope this one can help you i'm using MySQL on my server

Re: Comparison: finding if a value is gt some value AND lt another

2002-09-30 Thread eric-perl
On Fri, 27 Sep 2002, Jeff 'japhy' Pinyan wrote: > On Sep 27, [EMAIL PROTECTED] said: > >Is there a simple way to find if a variable's value is within a range? > > if (1 < $x < 5) { print 'foo'; } > >...or do I have to join two separate comparisons using the logical AND > >operator? e.g., > > if

Re: Condition Evaluation

2002-09-30 Thread eric-perl
I found my mistake: I misread the line number in the error message. DOH!!! The complaints were related to the block that prints individualized error messages: unless (defined $directory && defined $comment && defined $max_rows && defined $max_cols && defined $lg_dim && $lg_dim =~ m/[1-9][0-9]?/

Re: Condition Evaluation

2002-09-30 Thread eric-perl
On Mon, 30 Sep 2002, Michael Fowler wrote: > I cannot duplicate your problem. Given the code: > > perl -wle 'print "hi" if defined $bar && (!defined $foo || abs($foo) >< 100)' > > I see no 'Use of uninitialized value' warnings, and no print. Are you > certain the code you posted is

Re: Anyone want to help modify a script?

2002-09-30 Thread david
Eric Gregory wrote: > Ok, I've got this script which I pulled off of a website for rotating > apache logfiles. But since I'm runnig numberous sites on my server it > doesn't quite do what I need. > > It works just fine for a single set of logfiles for instance if the files > are in /logs/test i

Re: Last day of Month

2002-09-30 Thread david
Charlie Farinella wrote: > I have an error popping up in an application that runs monthly reports > and everymonth seems to leave off the last day's entries. > > The subroutine that determines the last day of the month is here: > > sub GetLastDayOfMonth { > my( $sec, $min, $hours, $mday, $mon,

Can someone help me.

2002-09-30 Thread Bootscat
I'm setting up a list for free and pro members. I want the pro members to be able to mail daily. I have this part working. I want the free members to only be able to mail every 4 Days to the list. Using the localtime(time) = (second,minute,hour,day-of-month,month,year,day-of-week,day-of-year)

Re: "Or" Syntax

2002-09-30 Thread Michael Fowler
On Mon, Sep 30, 2002 at 02:37:52PM -0500, Lance Prais wrote: [original code, slightly reformatted] if ($partition eq "Public"){ open(PUBLIC_ALERTSFILE,">$public_alerts_index_txt_filename"); print PUBLIC_ALERTSFILE"$oid". "::" ."$title". "::" .."$partition". "::" ."$date\n"; close(PUB

Re: CGI Script and getting the PID

2002-09-30 Thread david
Jessee Parker wrote: > Hi all, I've run into a bit of a problem. I need to see if a program is > currently running. If it is, I want to display this on a web page that > tells the status of the program (either on or off). The script I created > which is probably longer than it needs to be, basica

Re: Last day of Month

2002-09-30 Thread Jenda Krynicky
From: Charlie Farinella <[EMAIL PROTECTED]> > I have an error popping up in an application that runs monthly reports > and everymonth seems to leave off the last day's entries. > > The subroutine that determines the last day of the month is here: > > sub GetLastDayOfMonth { >

Re: Reading mail headers from mqueue

2002-09-30 Thread Michael Fowler
On Mon, Sep 30, 2002 at 03:34:10PM -0400, Scot wrote: > Looking to read in mail headers from /var/spool/mqueue/ > and load them into an array or hash to filter based on > some rules. > > I know there must be a good module out there to do this. > I just want To,From,CC and Subject. given you

Re: Last day of Month

2002-09-30 Thread Felix Geerinckx
on Mon, 30 Sep 2002 21:38:34 GMT, Charlie Farinella wrote: > I don't know if this is helpful. Let me know. > >> a) how this function is called, and > > if( $hashref->{'period'} eq '1' ) { > $starttime = GetFirstDayOfMonth( $curtime ); > $endtime = GetLastDayOfMonth( $c

Re: Condition Evaluation

2002-09-30 Thread Michael Fowler
On Mon, Sep 30, 2002 at 12:52:47PM +0800, [EMAIL PROTECTED] wrote: [snip] > unless (defined $directory && defined $comment && defined $max_rows && > defined $max_cols && (!defined $saturation || abs($saturation) < 100)) { > # Print error messages > } > > WHAT'S HAPPENING: > Without setti

Anyone want to help modify a script?

2002-09-30 Thread eric gregory
Ok, I've got this script which I pulled off of a website for rotating apache logfiles. But since I'm runnig numberous sites on my server it doesn't quite do what I need. It works just fine for a single set of logfiles for instance if the files are in /logs/test in the example below. but what

Re: Last day of Month

2002-09-30 Thread Charlie Farinella
On Mon, 2002-09-30 at 17:18, Felix Geerinckx wrote: > on Mon, 30 Sep 2002 21:12:56 GMT, Charlie Farinella wrote: > > > I have an error popping up in an application that runs monthly reports > > and everymonth seems to leave off the last day's entries. > > > > The subroutine that determines the l

Re: Can I append @INC before use

2002-09-30 Thread david
Paul Johnson wrote: > > Remember that . is in @INC by default. sorry, i use this only as an example > > In this case you want the use statement after the BEGIN block. > > But really you want "use lib". It goes back to before anything that > anyone should reasonably be using now. > agree.

RE: "Or" Syntax

2002-09-30 Thread Janek Schleicher
Lance Prais wrote at Mon, 30 Sep 2002 21:37:52 +0200: >When I read about this Module it really was not clear about using it with > strings. It's not its [Quantum::Superposition's] main purpose. It deals with another kind of logic handling. However, I forgot to mention, it's perhaps better n

RE: Win32::SetupSup module problems?

2002-09-30 Thread Timothy Johnson
This module is pretty old, and it is entirely possible that it does not work with WinXP, although it's highly unlikely, since it works fine with Win2k. Does this work for you? use Win32::Setupsup; use strict; my $handle = ''; system("start Notepad"); if(Win32::Setupsup::WaitForAnyWindow("notepa

RE: Last day of Month

2002-09-30 Thread Nikola Janceski
er... my bad.. typo use Date::Calc qw(Days_in_Month); > -Original Message- > From: Nikola Janceski [mailto:[EMAIL PROTECTED]] > Sent: Monday, September 30, 2002 5:17 PM > To: 'Charlie Farinella'; Perl Beginners > Subject: RE: Last day of Month > > > The error you have is you didn't us

Re: Last day of Month

2002-09-30 Thread Felix Geerinckx
on Mon, 30 Sep 2002 21:12:56 GMT, Charlie Farinella wrote: > I have an error popping up in an application that runs monthly reports > and everymonth seems to leave off the last day's entries. > > The subroutine that determines the last day of the month is here: > > sub GetLastDayOfMonth { >

RE: Last day of Month

2002-09-30 Thread Nikola Janceski
The error you have is you didn't use the module that already does this for you. use Data::Calc qw(Days_in_Month); > -Original Message- > From: Charlie Farinella [mailto:[EMAIL PROTECTED]] > Sent: Monday, September 30, 2002 5:13 PM > To: Perl Beginners > Subject: Last day of Month > >

Re: Expect-like Perl script

2002-09-30 Thread Felix Geerinckx
on Mon, 30 Sep 2002 20:52:54 GMT, Jose Malacara wrote: > Hello. I am interested in writing a Perl script that can do the > following: > > 1. read a list of user defined commands from a file > 2. telnet (or possibly ssh) to a device such as a router, login, and > interactively issue the commands

RE: "Or" Syntax

2002-09-30 Thread david
Lance Prais wrote: > >When I read about this Module it really was not clear about using it >with > strings. > > I tried it with the following code and it is causing so many problems. If > anyone has any Ideas it would be appreciated, I have been pounding my head > with this for a while

Last day of Month

2002-09-30 Thread Charlie Farinella
I have an error popping up in an application that runs monthly reports and everymonth seems to leave off the last day's entries. The subroutine that determines the last day of the month is here: sub GetLastDayOfMonth { my( $sec, $min, $hours, $mday, $mon, $year ) = localtime( $_[0] );

RE: another regx ...

2002-09-30 Thread Janek Schleicher
Nkuipers wrote at Mon, 30 Sep 2002 19:24:18 +0200: > This idea is even simpler though not purely regex: > > $yourstring =~ s/\..*//; > @result = split /-/, $yourstring; Or still simpler: my ( $ref, $numt, $id, $ext ) = split /\W/, $string, 3; Greetings, Janek -- To unsubscribe, e-mail: [EM

Expect-like Perl script

2002-09-30 Thread Jose Malacara
Hello. I am interested in writing a Perl script that can do the following: 1. read a list of user defined commands from a file 2. telnet (or possibly ssh) to a device such as a router, login, and interactively issue the commands read from the command list. 3. return the output from the commands

Re: CGI Script and getting the PID

2002-09-30 Thread Felix Geerinckx
on Mon, 30 Sep 2002 19:39:05 GMT, Jessee Parker wrote: > Hi all, I've run into a bit of a problem. I need to see if a program > is currently running. If it is, I want to display this on a web page > that tells the status of the program (either on or off). The script I > created which is probably

Condition Evaluation

2002-09-30 Thread eric-perl
Hello, All: I'm testing to determine that a list of variables has been set and am baffled by how this conditional is evaluating: CODE SNIPPET: GetOptions( 'comment=s' => \$comment, # Req'd arg 'directory=s' => \$directory, # Req'd arg 'rows=i'

Re: $1, $2, $3, ... as array

2002-09-30 Thread Jeff 'japhy' Pinyan
On Sep 30, Jenda Krynicky said: >$text =~ s{$regexp}{ > my $tagname = $1; > my %params = ('' => '%'); > my $i = 2; > no strict 'refs'; > while (defined ${$i}) { > $params{${$i}} = ${$i+1}; > ... > $i+=2; > } > ...

Re: Printing A Hash of Hashes

2002-09-30 Thread Ken Hammer
Mark Anderson wrote: > > Why are you wrapping these in arrays? If you used: > $tablename{$table} -> {con_name} = $constraint_name; > $tablename{$table} -> {con_type} = $type; > $tablename{$table} -> {rem_con_name} = $r_constraint_name; > $tablename{$table} -> {created_by} = $generated;

Re: Printing A Hash of Hashes

2002-09-30 Thread James Edward Gray II
In your adding lines you add entries line [ $entry ], which means, make an array reference (the brackets) which has $entry as the first element of the array. You then have a hash of hashes of arrays (for at least some entries). If you meant the arrays, you'll have to add a third loop to the

RE: Printing A Hash of Hashes

2002-09-30 Thread Mark Anderson
> This is from Chapter 9, page 281 slighly >changed to reflect my values: > >for $table ( keys %tablename) { >print "Table Name: $table \n"; > >for $items ( keys %{ $tablename{$table} } ) { >print "\t$items=$tablename{$table}{$items}\n "; > >} > >print "\n"; That looks re

Win32::SetupSup module problems?

2002-09-30 Thread Cacialli, Doug
Has anybody had any problems with the Win32::SetupSup module?  Specifically, whenever I try to use it, my system crashes.  It's pretty weird.  I'm running WinXP Pro, using the latest ActiveState build of Perl.  And like I said in my last post, this is my first program; I am extremely new to

Printing A Hash of Hashes

2002-09-30 Thread Ken Hammer
From a previous post I needed to identify a particular data structure. It is a hash of hashes. Now, I need to print the hash out. I'm using the code from the "Programing Perl" 3rd edition from O'Reilly on how to print out the hash and of course I'm having a problem. This is from Chapter 9, p

RE: "Or" Syntax

2002-09-30 Thread Lance Prais
David, Thank you for your help but I think I am not explaining myself correctly. I am writing to four separate .txt files file where the array [2] is assigned to the variable "$partition" If $partition eq "Public" only write to a file called $public_text If $partition eq "Public" or $partit

RE: What Type Of Data Structure Is This (Summary)

2002-09-30 Thread Ken Hammer
The structure is a hash of hashes. Thanks to: nkuipers <[EMAIL PROTECTED]> Robin Cragg <[EMAIL PROTECTED]> Timothy Johnson <[EMAIL PROTECTED]> who correctly pointed this also to me. They also provided some information on how to add items to the array, and an easier way to populate the

Reading mail headers from mqueue

2002-09-30 Thread Scot
Hi; Looking to read in mail headers from /var/spool/mqueue/ and load them into an array or hash to filter based on some rules. I know there must be a good module out there to do this. I just want To,From,CC and Subject. given you have a file with the headers in $_ anybody out there us

RE: "Or" Syntax

2002-09-30 Thread Lance Prais
When I read about this Module it really was not clear about using it with strings. I tried it with the following code and it is causing so many problems. If anyone has any Ideas it would be appreciated, I have been pounding my head with this for a while now. if ($partition

CGI Script and getting the PID

2002-09-30 Thread Jessee Parker
Hi all, I've run into a bit of a problem. I need to see if a program is currently running. If it is, I want to display this on a web page that tells the status of the program (either on or off). The script I created which is probably longer than it needs to be, basically issues a system(ps -A) cal

Re: Can I append @INC before use

2002-09-30 Thread Paul Johnson
On Mon, Sep 30, 2002 at 11:25:32AM -0700, david wrote: > what sort of error message do you get? assume i have: /home/david/perl/A.pm, > the following works for me: > > BEGIN{ > push @INC, '/home/david/perl'; > use A; > } Are you sure? Remember that . is in @INC by default.

Re: $1, $2, $3, ... as array

2002-09-30 Thread Jenda Krynicky
From: david <[EMAIL PROTECTED]> > Jenda Krynicky wrote: > > > Are the $n variables accessible as an array as well? > > > > Currently I am using > > > > no strict 'refs'; > > ... > > ... ${$i} ... > > > > but I don't really like that. > > > > I know I can do > > > > @array = ($string =~ /rege

Re: check process state

2002-09-30 Thread david
Zentara wrote: > > My top command dosn't allow for -U or $user. Maybe you > meant to use ps ? > the -U argument only exist for a certain version of top Top version 3.4 has it in my UNIX machine in my Linux box: [david@panda]$ top -V top (procps version 2.0.7) doesn't have it. david --

Re: STDIN

2002-09-30 Thread david
Janfek Esquivel wrote: > I have an HTML in which I have a text box and 2 combo boxes, what I want > to do, is to read the information entered by text and also the informatios > selected from the combo boxes (not always used) to compare it with the > information on it, I already have the code to g

Re: check process state

2002-09-30 Thread david
Jean-Pierre Sylvanie wrote: > Hi guys, > > I want to do a sub that check if a process is sleeping > or not... > > I wrote the following sub, but I was wondering if it > was possible to to it without shell calls... > > Thanks, > jp. > > > >

Re: Can I append @INC before use

2002-09-30 Thread david
Ramprasad A Padmanabhan wrote: > Hello All, > > I have a perl script which has > > (assuming BAR.pm is in /tmp/foo/) > > > BEGIN { > push @::INC , "/tmp/foo"; > # use BAR; # Does not work > require BAR; # Works fine > } > > Can I get to use 'use' instead of require any how

Re: $1, $2, $3, ... as array

2002-09-30 Thread david
Jenda Krynicky wrote: > Are the $n variables accessible as an array as well? > > Currently I am using > > no strict 'refs'; > ... > ... ${$i} ... > > but I don't really like that. > > I know I can do > > @array = ($string =~ /regexp/); > > but I need to access the matched strings in the cod

Re: how to know weather perl script is already running?

2002-09-30 Thread david
Theuerkorn Johannes wrote: > Hello List, > > i have a perl script that i have running from a cron Job. It usually opens > every 4 hours. But sometimes it takes the script longer to execute its job > so after cron opens up the perl script as usual, i have two perl jobs > running. Is there any pos

Re: Finding if a module is already 'require'd

2002-09-30 Thread david
Ramprasad A Padmanabhan wrote: > > > How do I find in a function if a particular module is already loaded > > for eg, > > sub mysub { > my @vars = @_; > require Data::Dumper unless ( already_required('Data::Dumper')); > print Data::Dumper::Dumper(\@vars); > } > > I want help writing the func

Re: SQL Table Rows

2002-09-30 Thread david
Dan wrote: > How is it possible to cycle through an SQL table row by row, without > having to increment an ID by 1 in a while loop and go > SELECT * FROM table WHERE id=$id > ? > And how can I find out how many rows are in the table? > > Dan have you try: SELECT * FROM table; and then just cy

Re: Breaking out of STDIN Question

2002-09-30 Thread david
Jenda Krynicky wrote: >> >> If you want to stop input based on what the user entered on the >> command line then you have to read ONE line at a time and not use an >> array for input. BTW your loop will only read numbers and not strings >> because the test '== 0' will evaluate strings in a nume

Re: How to snip the end of a huge log file

2002-09-30 Thread david
Mark Richmond wrote: > > Hi: > > I have may huge log files where all I care about is the error at the end > how can seek backwards to find my pattern and snip off the end. > I'm looking for strings like. " Rebuilding "link" " which > only occur once when reading backwards but m

Re: Permission Problems

2002-09-30 Thread david
Josh wrote: > To clarify in my earlier posting, the part where I say, > > I have played with chown but the fact is "nobody" can't chown a > file > that belongs to "root". For grins I did: > > chown nobody:nobody ./fooness.cfg > chmod 666 ./fooness.cfg > > I meant that I issued

Re: check process state

2002-09-30 Thread zentara
On Mon, 30 Sep 2002 11:38:40 -0400, [EMAIL PROTECTED] (Jean-Pierre Sylvanie) wrote: >Hi guys, > >I want to do a sub that check if a process is sleeping >or not... > >I wrote the following sub, but I was wondering if it >was possible to to it without shell calls... My top command dosn't allow for

Re: pop-up window with database access

2002-09-30 Thread david
Jim Lundeen wrote: > Hello, > > I'm creating a web site for our department at my school. We have a > sign-up form for a society that people can join. I want to create a > MySQL database of university names and allow the user to click on a > "Lookup" button on the sign-up form when they get to

Re: system call troubles...

2002-09-30 Thread david
Jenda Krynicky wrote: > Windows is one example. > > There you do not create a new process by forking and then changin the > program your process executes, but by a CreateProcess(): > > (from MSDN) > The CreateProcess function creates a new process and its primary > thread. The new process runs

Re: Searching & Storing

2002-09-30 Thread david
Henry Wong wrote: > Ok, i've decided to skip using the Date::Manip coz its giving me lots of > problems. Is there a way to compare dates (e.g. Thu Jun 20 12:00:00 2002) > and sort them in order? What i've always wanted is to sort them, and > subsequently using User's input of Start & End date to

RE: opening MS ACCESS via the system function

2002-09-30 Thread Timothy Johnson
Check out the Win32::SetupSup module. You should be able to open the program via system, find the window, and send the keystrokes to it using this module. -Original Message- From: Cacialli, Doug [mailto:[EMAIL PROTECTED]] Sent: Monday, September 30, 2002 10:16 AM To: '[EMAIL PROTECTED]'

RE: another regx ...

2002-09-30 Thread nkuipers
This idea is even simpler though not purely regex: $yourstring =~ s/\..*//; @result = split /-/, $yourstring; >= Original Message From "Mark Anderson" <[EMAIL PROTECTED]> = >-Original Question- > >D-2165033-10.TKB61a => D 2165033 10 > >and > >4-2175587-08.TKB63a => 4 21755

Re: Searching & Storing

2002-09-30 Thread david
Henry Wong wrote: > Hi all, I tried using the below codes provided but i got an error saying > "Can't locate Date/Manip.pm in @INC...etc". I reckon that the Date::Manip > do not exist in my library. Any other alternatives for my problem below? > > > Regards, > you just have to install Date::M

opening MS ACCESS via the system function

2002-09-30 Thread Cacialli, Doug
Lo, I'm attempting to write a program that will run daily, and perform the following actions: 1. Open a database in MS Access 2002, 2. Execute a program in SAS v8.02 that will, simply put, do a lot of statistical analyses and compare the current database to the backup from the night before to i

RE: another regx ...

2002-09-30 Thread Mark Anderson
-Original Question- D-2165033-10.TKB61a => D 2165033 10 and 4-2175587-08.TKB63a => 4 2175587 08 using (( $ref, $numt, $id, $ext ) = $PATH[ 7 ] ) =~ /\w-(\d{7})-(\d{2}).[\w+|\d+]/; What am I doing wring? -My Response- Your parens are in the wrong place. You aren't capt

another regx ...

2002-09-30 Thread Jerry Preston
Hi! I am getting no where on this and it is not that hard. I am trying to break down the following: D-2165033-10.TKB61a into D 2165033 10 and 4-2175587-08.TKB63a into 4 2175587 08 using (( $ref, $numt, $id, $ext ) = $PATH[ 7 ] ) =~ /\w-(\d{7})-(\d{2}).[\w+|\d+]/; What am I doing

Weekly posting statistics - 39/2002

2002-09-30 Thread Felix Geerinckx
Weekly posting statistics for perl.beginners - week 39 of 2002. >From Monday 2002-09-23 to Sunday 2002-09-29 there were 483 articles posted (22798 lines) by 136 authors, giving an average 3.55 articles per author, and an average article length of 47 lpa. The average number of articles per day w

RE: check process state

2002-09-30 Thread Kipp, James
you could use the Proc::ProcessTable module > -Original Message- > From: Sylvanie, Jean-Pierre [mailto:[EMAIL PROTECTED]] > Sent: Monday, September 30, 2002 11:39 AM > To: '[EMAIL PROTECTED]' > Subject: check process state > > > Hi guys, > > I want to do a sub that check if a process i

STDIN

2002-09-30 Thread Janfek Esquivel
I have an HTML in which I have a text box and 2 combo boxes, what I want to do, is to read the information entered by text and also the informatios selected from the combo boxes (not always used) to compare it with the information on it, I already have the code to get from the database the inf

RE: What Type Of Data Structure Is This?

2002-09-30 Thread Timothy Johnson
What you have is a hash of hashes, the values of which is a reference to a hash of arrays. The original scalar is a reference to an anonymous hash. The value of each hash key is a reference to an anonymous array. The reason why what you tried doesn't work is that you are assigning a reference t

Re: What Type Of Data Structure Is This?

2002-09-30 Thread Robin Cragg
Hi Ken, the reason you lose your data is simple. You have something of the form: $myscalar = "A weird hested hash"; you then try to add an entry by doing: $myscalar = "Some other data"; What you look at it like that, it's clear what is going wrong. What you want is: $tablename{$table}{"con_

RE: What Type Of Data Structure Is This?

2002-09-30 Thread nkuipers
>$tablename{"$table"} = { >"table_name"=> ["$table"], >"index_name"=> ["$index_name"], >"columns" => ["@column_name"], >"type" => ["$index_type"], >"tablespace"=> ["$tablespace_name"] > > Thi

check process state

2002-09-30 Thread Sylvanie, Jean-Pierre
Hi guys, I want to do a sub that check if a process is sleeping or not... I wrote the following sub, but I was wondering if it was possible to to it without shell calls... Thanks, jp. sub isSleeping{ # get PID of process to check my

What Type Of Data Structure Is This?

2002-09-30 Thread Ken Hammer
A strange question. I'm using the following data structure to store information from a data base query: $tablename{"$table"} = { "table_name"=> ["$table"], "index_name"=> ["$index_name"], "columns" => ["@column_name"],

RE: Microsoft Exchange

2002-09-30 Thread Timothy Johnson
There is a new module that was just introduced called Win32::Exchange that can do that very easily. If you are using ActiveState's ActivePerl then you can get it via PPM at Dave Roth's repository. PPM> set repository dave http://www.roth.net/perl/packages PPM> set save PPM> install win32-exchan

Re: AW: Exiting loop to higher level

2002-09-30 Thread James Edward Gray II
Sorry, but this isn't accurate. Try it and I think you'll be surprised. The next() subroutine takes you to the next iteration of the enclosing LOOP. Control statements, like if, are not loops and thus have nothing to do with where next() sends you. When you do have two loops and want to bre

AW: Exiting loop to higher level

2002-09-30 Thread Hughes, James
Thanks, but I need something that will take me past the first "if" statement... Something that itterates past the if, and tells the while to go on with the next lump of data... "next" will only break the inner "if" loop. best regards, James Hughes -Ursprungliche Nachricht- V

Re: $1, $2, $3, ... as array

2002-09-30 Thread Jeff 'japhy' Pinyan
On Sep 30, Jenda Krynicky said: >Are the $n variables accessible as an array as well? You can use the @- and @+ arrays (which hold offsets) to do your work: for (0 .. $#-) { # do something with substr($X, $-[$_], $+[$_] - $-[$_]) } -- Jeff "japhy" Pinyan [EMAIL PROTECTED] ht

Re: Exiting loop to higher level

2002-09-30 Thread James Edward Gray II
Drop the double. 'next' is what you're looking for. James Gray On Monday, September 30, 2002, at 09:28 AM, Hughes, James wrote: > Hi folks, > > > Quick question I left my books at home. I am sure I'e seen a way > to next > a loop to a higher level. > > > Let me explain.. > > > wh

Exiting loop to higher level

2002-09-30 Thread Hughes, James
Hi folks, Quick question I left my books at home. I am sure I'e seen a way to next a loop to a higher level. Let me explain.. while <> { if ($_ =~ /something I need to find/) { if ($_=~/something that tells me I need to look elsewhere/) {

AW: AW: how to know weather perl script is already running?

2002-09-30 Thread Theuerkorn Johannes
Jea, thats it! Thats exactly what i had in mind! Thank you very much! This List and it´s members are excellent! Greets Johannes -Ursprüngliche Nachricht- Von: Robin Cragg [mailto:[EMAIL PROTECTED]] Gesendet: Montag, 30. September 2002 15:10 An: Theuerkorn Johannes Betreff: Re: AW: how

Re: SQL Table Rows

2002-09-30 Thread Cleiton L. Siqueira
Dan, In MySQL I don't know how you can do, but I believe that in theory is the same thing. #!/usr/bin/perl use Pg; $db= Pg::connectdb("dbname=database"); open (FILE, ">>/var/log/file.log"); $result = $db->exec("SELECT * FROM table;"); for($i=0;$i<$result->ntuples;$i++) {

RE: how to know weather perl script is already running?

2002-09-30 Thread Jeff AA
> -Original Message- > From: Theuerkorn Johannes [mailto:[EMAIL PROTECTED]] > Sent: 30 September 2002 10:18 > To: '[EMAIL PROTECTED]' > Subject: how to know weather perl script is already running? > > > Hello List, > > i have a perl script that i have running from a cron Job. It > us

Re: Can Someone Help Me?

2002-09-30 Thread Frank Wiles
.--[ Bootscat wrote (2002/09/30 at 09:13:19) ]-- | | I'm setting up a list for free and pro members. | I want the pro members to be able to mail daily. I have this part working. | | I want the free members to only be able to mail every 4 Days to the list. | | Using the loc

RE: SQL Table Rows

2002-09-30 Thread Jeff AA
> -Original Message- > From: dan [mailto:[EMAIL PROTECTED]] > Sent: 30 September 2002 13:55 > To: [EMAIL PROTECTED] > Subject: Re: SQL Table Rows > > snip > __ START __ > $id = 1; > $sth = $dbh->prepare("SELECT * FROM table WHERE id=$id"); > $sth->execute; > @ary = $sth->fetchrow_array

Re: SQL Table Rows

2002-09-30 Thread Gary Stainburn
Hi Dan, I'm used to PostgreSQL, but using DBI, that shouldn't matter for what we're doing. On Monday 30 Sep 2002 1:54 pm, dan wrote: > right, this is like an outline to what i want to be able to achieve.. > > -- my table --- > row # : id , myid2 , myid3 > ---

Can Someone Help Me?

2002-09-30 Thread Bootscat
I'm setting up a list for free and pro members. I want the pro members to be able to mail daily. I have this part working. I want the free members to only be able to mail every 4 Days to the list. Using the localtime(time) = (second,minute,hour,day-of-month,month,year,day-of-week,day-of-year)

RE: Can I append @INC before use

2002-09-30 Thread NYIMI Jose (BMB)
set PERL5LIB environment varible to /tmp/foo then you will be able to use 'use BAR;' Or give a look at 'perldoc lib' José. > -Original Message- > From: Ramprasad A Padmanabhan [mailto:[EMAIL PROTECTED]] > Sent: Monday, September 30, 2002 2:53 PM > To: [EMAIL PROTECTED] > Subject: Ca

Re: NET::Netrc

2002-09-30 Thread Ramprasad A Padmanabhan
I havent used this module but look at catching errors it "could be" something like this $mach = Net::Netrc->lookup('Name') || die Net::Netrc->error() Bye the way you have you created your .netrc file William Black wrote: > Hello All, > > I'm trying to use the Netrc module to read from t

Re: Postgres Select

2002-09-30 Thread Cleiton L. Siqueira
Dear friend, I don't know if I've figured out what you want, but I've written a script for you. You can test it! Warning!!! I didn't test it, ok! So. It's the following. #!/usr/bin/perl use Pg; # In you must change to your database name. $conn = Pg::connectdb("dbname="

Re: SQL Table Rows

2002-09-30 Thread dan
right, this is like an outline to what i want to be able to achieve.. -- my table --- row # : id , myid2 , myid3 --- row 1 : 1 , item 1 , item 2 row 2 : 2 , item 3 , item 4 row 3 : 3 , item 5 , item 6 row 4 : 4 , item 7 , item 8

re: NET::Netrc

2002-09-30 Thread William Black
Hello All, I'm trying to use the Netrc module to read from the netrc file. Anyone familiar with it? Below is the code. I'm getting an error stating Can't call method "password" on an undefined value at ftp.pl line 28. Here is the code. Anyone see the problem. #Get the username and passwd

Re: Microsoft Exchange

2002-09-30 Thread Ramprasad A Padmanabhan
Steve wrote: > Can anyone tell me if it's possible to create a mailbox > in Exchange 5.5 from perl? > > Thanks, >Steve > > I Dont think that will be the straightforward Why dont u use a mailer and send the mails using SMTP instead of directly creating the mailbox U could use Net::SMTP

Re: Finding if a module is already 'require'd

2002-09-30 Thread Jenda Krynicky
From: Ramprasad A Padmanabhan <[EMAIL PROTECTED]> > How do I find in a function if a particular module is already loaded Look at the %INC hash. Jenda === [EMAIL PROTECTED] == http://Jenda.Krynicky.cz == There is a reason for living. There must be. I've seen it s

Can I append @INC before use

2002-09-30 Thread Ramprasad A Padmanabhan
Hello All, I have a perl script which has (assuming BAR.pm is in /tmp/foo/) BEGIN { push @::INC , "/tmp/foo"; # use BAR; # Does not work require BAR; # Works fine } Can I get to use 'use' instead of require any how Thanx Ram -- To unsubscribe, e-mail: [EMAIL PROTECTED] F

Re: SQL Table Rows

2002-09-30 Thread Cleiton L. Siqueira
Dear Dan, I don't know if I understood what you really want. Therefore I will try to help, ok. I use Postgres as Database. You can find out how many rows have in a table after you run a SQL like this. #!/usr/bin/perl use Pg; $db= Pg::connectdb("dbname=database"); # This

Re: how to know weather perl script is already running?

2002-09-30 Thread Robin Cragg
There are two easy ways... If your file creates a lock file when it starts and removes it when it finishes, a chec to see if the file exists will tell you if the script is already running./ On linux / unix systems do a ps and looks for any occurrances of your script name. If there are more t

  1   2   >