Perl defined variables

2003-12-23 Thread Perl
Hi, could anybody please illustrate with an example the use of the following variables : $/ $* or more specifically here is the code i have. what exactly would the following accomplish ? $/ = "Begin"; $* = 1 ; while (<>) { if (/$pattern/){ print; } } my understanding is $/ = "Beg

Re: CORE::GLOBAL override question

2003-12-23 Thread Jesper Noehr
Hey David. I have no idea what just happened, I think santa brought me a present. I tried to insert some print statements here and there, and it seemed to work fine. I started removing the print's and surprisingly, everything worked?! I'm sure I'm an idiot and that I missed something, but I can sw

Re: CORE::GLOBAL override question

2003-12-23 Thread david
Jesper Noehr wrote: >>> On Tue, 23 Dec 2003 14:33:54 -0800, david <[EMAIL PROTECTED]> wrote: >>> exit: 0 Accept returned which shows me that the accept function doesn't exit. am i miss something? >> >>> That IS weird! I tried doing the same to the main program, but there i

Re: Newbie trying to cleanup/format text file

2003-12-23 Thread John W. Krahn
"John W. Krahn" wrote: > > Stuart Clemons wrote: > > > > I'm trying to cleanup and format this text file of user names, so that I > > have one column of user names. Here's the text file: > > > > The request will be processed at a domain controller for domain FOOBAR. > > > > Group name Misc >

Re: CORE::GLOBAL override question

2003-12-23 Thread Jesper Noehr
On Tue, 23 Dec 2003 15:02:19 -0800, david <[EMAIL PROTECTED]> wrote: Jesper Noehr wrote: On Tue, 23 Dec 2003 14:33:54 -0800, david <[EMAIL PROTECTED]> wrote: exit: 0 Accept returned which shows me that the accept function doesn't exit. am i miss something? That IS weird! I tried doing the same

Re: CORE::GLOBAL override question

2003-12-23 Thread david
Jesper Noehr wrote: > On Tue, 23 Dec 2003 14:33:54 -0800, david <[EMAIL PROTECTED]> wrote: > >> exit: 0 >> Accept returned >> >> which shows me that the accept function doesn't exit. am i miss >> something? > That IS weird! I tried doing the same to the main program, but there it > makes no diff

Re: Printing Array of Hashes

2003-12-23 Thread William Martell
Terrific. Thank you. Thank you. Thank you. - Original Message - From: "John W. Krahn" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, December 23, 2003 4:19 PM Subject: Re: Printing Array of Hashes > William Martell wrote: > > > > Hi John, > > Hello, > > > I received your c

Re: Printing Array of Hashes

2003-12-23 Thread John W. Krahn
William Martell wrote: > > Hi John, Hello, > I received your code. Thanks. > I would like to know how to check the values of the keys in the hash. I > checked the Perl cookbook and It showed me how to get the key value pairs > and print them, but I am not familiar with populating an array wit

Re: CORE::GLOBAL override question

2003-12-23 Thread Jesper Noehr
On Tue, 23 Dec 2003 14:33:54 -0800, david <[EMAIL PROTECTED]> wrote: exit: 0 Accept returned which shows me that the accept function doesn't exit. am i miss something? That IS weird! I tried doing the same to the main program, but there it makes no difference. You got any idea what I need to mod

Re: CORE::GLOBAL override question

2003-12-23 Thread david
Jesper Noehr wrote: > Sure, here's an example: > > [snip] > > #!/usr/bin/perl -w > use strict; > use Mail::Audit; > use vars qw/$mail @maildata/; > BEGIN { *CORE::GLOBAL::exit = sub { my($exitcode) = shift; print "exit: > ".$exitcode; die $exitcode; } }; > > @maildata = ; > $mail = Mail::Audit-

Re: CORE::GLOBAL override question

2003-12-23 Thread Jesper Noehr
Sure, here's an example: [snip] #!/usr/bin/perl -w use strict; use Mail::Audit; use vars qw/$mail @maildata/; BEGIN { *CORE::GLOBAL::exit = sub { my($exitcode) = shift; print "exit: ".$exitcode; die $exitcode; } }; @maildata = ; $mail = Mail::Audit->new(data => [EMAIL PROTECTED]); eval { $mail-

Re: Array Representation

2003-12-23 Thread John W. Krahn
Ursala Luttrell wrote: > > I need to modify an existing perl script. Within the code the following > appears: > > @unique_array[12..24]= > $first_total,$second_total,$third_total,$fourth_total,undef,$fifth_total,$si > xth_total,undef,1000); > > I don't understand what the function of [12..24] i

Re: Array Representation

2003-12-23 Thread Rob Dixon
Ursala Luttrell wrote: > > I need to modify an existing perl script. Within the code the following > appears: > > @unique_array[12..24]= > $first_total,$second_total,$third_total,$fourth_total,undef,$fifth_total,$si > xth_total,undef,1000); > > I don't understand what the function of [12..24] is.

Re: CORE::GLOBAL override question

2003-12-23 Thread david
Jesper Noehr wrote: [snip] >> are you sure it's the exit function that cause the problem? > Yes, I am positive. As soon as I insert this into Audit.pm it works > perfectly: > use subs qw/exit/; > sub exit { die shift; } this makes sense but it doesn't make sense that the previous version doesn

RE: Array Representation

2003-12-23 Thread Tom Kinzer
that says assign elements 12 through 24 of that array these values. element numbering in perl starts at zero, so 12 is the 13th element in the array. -Tom Kinzer -Original Message- From: Ursala Luttrell [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 23, 2003 10:41 AM To: [EMAIL PROTEC

Re: CORE::GLOBAL override question

2003-12-23 Thread Jesper Noehr
On Tue, 23 Dec 2003 13:19:40 -0800, David Zhuo <[EMAIL PROTECTED]> wrote: i checked the source of Mail::Audit especially the accept function. there is nothing i can see why my method won't work. the only time accept calls exit directly is when a message has been sent but not when the noexit opti

Array Representation

2003-12-23 Thread Ursala Luttrell
I need to modify an existing perl script. Within the code the following appears: @unique_array[12..24]= $first_total,$second_total,$third_total,$fourth_total,undef,$fifth_total,$si xth_total,undef,1000); I don't understand what the function of [12..24] is. Thanks in advance for an explanation.

Re: CORE::GLOBAL override question

2003-12-23 Thread Jesper Noehr
Sorry, I forgot to send it to the list as well. Stupid mailclient. On Tue, 23 Dec 2003 13:35:48 -0800, david <[EMAIL PROTECTED]> wrote: interesting. i will take a look at the source of Mail::Audit. what function in Mail::Audit is causing the exit? do you know? The function relevant to me, is acc

Re: CORE::GLOBAL override question

2003-12-23 Thread david
Jesper Noehr wrote: [snip] >> if so, give Mail::Audit a chance to see the "new" exit built-in after you >> override it: >> >> BEGIN{ *CORE::GLOBAL::exit = sub { print "EXIT: " . shift } } >> >> use Mail::Audit; >> >> or: >> >> BEGIN{ >> *CORE::GLOBAL::exit = sub { print "EXIT: " . shift }

Re: CORE::GLOBAL override question

2003-12-23 Thread Jesper Noehr
On Tue, 23 Dec 2003 13:28:38 -0800, david <[EMAIL PROTECTED]> wrote: let me try one more time: 1. Mail::Audit calls exit which should call your defined sub but it doesn't 2. after catching the exit call from Mail::Audit, you will CORE::exit so your script can exit. correct? Yes. That is corre

Re: CORE::GLOBAL override question

2003-12-23 Thread david
Jesper Noehr wrote: [snip] >> i have never used Mail::Audit so i am not familiar with it. looking at >> your >> code, i am almost certain that this: >> >> CORE::exit; > I am using CORE::exit because I _need_ the actual exit in my own program. > Mail::Audit does not call CORE::exit, it just calls

Re: get list of files in subdirectories?

2003-12-23 Thread Rob Dixon
Shaunn Johnson wrote: > > I'd like to get a list of files in a directory and > also in it's subdirectory - but I don't know how > far the subdirectory goes. > > I can do a directory like so: > > [snip] > #my $localdir=cwd; > my $localdir="/ddrive/db2_text/"; > chdir $localdir; > > opendir (DIR, $lo

Re: CORE::GLOBAL override question

2003-12-23 Thread Jesper Noehr
On Tue, 23 Dec 2003 13:07:38 -0800, David Zhuo <[EMAIL PROTECTED]> wrote: Jesper, next time when you reply, please remember to reply or CC: the group Of course, sorry. On Tuesday 23 December 2003 12:17, Jesper Noehr wrote: Hey David. Thanks for your reply. It seems you're overriding the sub with

Re: CORE::GLOBAL override question

2003-12-23 Thread David Zhuo
Jesper, next time when you reply, please remember to reply or CC: the group On Tuesday 23 December 2003 12:17, Jesper Noehr wrote: > Hey David. > > Thanks for your reply. > > It seems you're overriding the sub within a package. Is that necesarry? no. it isn't. i put it in the package just for dem

Re: CORE::GLOBAL override question

2003-12-23 Thread david
Jesper Noehr wrote: > Hey list! > > I'm having a problem with overriding a sub in CORE::GLOBAL. > I need to override exit(), and I'm doing that with: > > BEGIN { *CORE::GLOBAL::exit = sub { print "exit: ".shift; } }; > > ..which works for the program itself. > > However! When I call exit() in

Re: Opening two files at once

2003-12-23 Thread denis
On Tue, 23 Dec 2003, drieux wrote: > > On Dec 23, 2003, at 9:03 AM, [EMAIL PROTECTED] wrote: > [..] > > Sorry for the curt thank you. You code looks really good. > > I'd never thought of it that way. What I think might > be the elegant way of saying 'thank you' to folks who > offer an idea/code/

get list of files in subdirectories?

2003-12-23 Thread Johnson, Shaunn
Howdy: I'd like to get a list of files in a directory and also in it's subdirectory - but I don't know how far the subdirectory goes. I can do a directory like so: [snip] #my $localdir=cwd; my $localdir="/ddrive/db2_text/"; chdir $localdir; opendir (DIR, $localdir) or die "can nae access D driv

Mail::Sender weirdness

2003-12-23 Thread Dan Muey
Howdy all, Here's wht I have: $r .= "Sending..."; eval { my $senderx = new Mail::Sender {smtp => $smtp, from => $from }; $senderx->Open({subject => $subj, to => $to }); $senderx->SendLineEnc($msg); $senderx->Close(); }; if($@) { $r .= "Error sending mail: $@ -- $Mail::Sender::Error \n"; }

CORE::GLOBAL override question

2003-12-23 Thread Jesper Noehr
Hey list! I'm having a problem with overriding a sub in CORE::GLOBAL. I need to override exit(), and I'm doing that with: BEGIN { *CORE::GLOBAL::exit = sub { print "exit: ".shift; } }; ..which works for the program itself. However! When I call exit() in a module used by my program, the module a

Re: Installing Modules From CPAN

2003-12-23 Thread Joe Echavarria
I just installed the client package and devel package, and now i get another error : DBD-mysql-2.9003/Makefile.PL /bin/tar: DBD-mysql-2.9003/Makefile.PL: time stamp 2003-10-17 13:20:50 is 17961752 s in the future DBD-mysql-2.9003/ChangeLog /bin/tar: DBD-mysql-2.9003/ChangeLog: time stamp 2003-10-2

RE: win32:netsend

2003-12-23 Thread Tim Johnson
Minor correction below: I forgot to press the enter key before "my @users". -Original Message- From: Tim Johnson Sent: Tuesday, December 23, 2003 10:06 AM To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject: RE: win32:netsend Looking at the documentation ("perldoc Win32:netsend"), it

RE: win32:netsend

2003-12-23 Thread Tim Johnson
Looking at the documentation ("perldoc Win32:netsend"), it looks pretty simple. The module takes a hash as an argument with two keys: to and message. If you wanted to send to a list of users, you could do something like this: ## use strict; use warni

Re: Opening two files at once

2003-12-23 Thread drieux
On Dec 23, 2003, at 9:03 AM, [EMAIL PROTECTED] wrote: [..] Sorry for the curt thank you. You code looks really good. I'd never thought of it that way. What I think might be the elegant way of saying 'thank you' to folks who offer an idea/code/suggestion/BriefPsychoticEpisode would be something on t

Re: Printing Array of Hashes

2003-12-23 Thread Roberto Álamos Moreno
Hi William, This is very simple. The key function will do the work as in this example: my %hash; my @keys; my @values; $hash{key1} = "value1"; $hash{key2} = "value2"; foreach my $key (keys %hash) { push(@keys,$key); push(@values,$hash{$key}); } After the execution of this script

Re: generating GIFs

2003-12-23 Thread Andrew Gaffney
zentara wrote: On Tue, 23 Dec 2003 07:44:59 -0500, [EMAIL PROTECTED] (Zentara) wrote: On Mon, 22 Dec 2003 09:42:31 -0600, [EMAIL PROTECTED] (Andrew Gaffney) wrote: Christian Bolstad wrote: # Write image to temporary PNG file open IMAGE, "> /tmp/genbutton.png"; binmode IMAGE; print IMAGE $im->png;

Re: Opening two files at once

2003-12-23 Thread denis
Drieux, Sorry for the curt thank you. You code looks really good. On Mon, 22 Dec 2003, drieux wrote: > > On Dec 22, 2003, at 4:32 PM, [EMAIL PROTECTED] wrote: > > > I have two text files I would like to open and read at the same time. > > Whats the best way to do this? > > the only problem wi

Re: Opening two files at once

2003-12-23 Thread denis
On Mon, 22 Dec 2003, drieux wrote: > > On Dec 22, 2003, at 4:32 PM, [EMAIL PROTECTED] wrote: > > > I have two text files I would like to open and read at the same time. > > Whats the best way to do this? > > the only problem with your current form, barring > the faux paux of > > while( (

RE: Opening two files at once

2003-12-23 Thread denis
On Mon, 22 Dec 2003, Charles K. Clarkson wrote: > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > : > : I have two text files I would like to open and read at the > : same time. Whats the best way to do this? > : > : I was think along these lines: > : > : open (TESTFILE, " > It is helpful

Re: Installing Modules From CPAN

2003-12-23 Thread Wiggins d Anconia
Please bottom post. > Wiggins, > > > This is the error i get trying installing the package > : > > > [EMAIL PROTECTED] root]# perl -MCPAN -e shell > > cpan shell -- CPAN exploration and modules > installation (v1.61) > ReadLine support available (try 'install > Bundle::CPAN') > > cpan> inst

Re: Installing Modules From CPAN

2003-12-23 Thread Joe Echavarria
Wiggins, This is the error i get trying installing the package : [EMAIL PROTECTED] root]# perl -MCPAN -e shell cpan shell -- CPAN exploration and modules installation (v1.61) ReadLine support available (try 'install Bundle::CPAN') cpan> install DBD::mysql CPAN: Storable loaded ok CPAN: LWP::

Printing Array of Hashes

2003-12-23 Thread William Martell
Hi John, I received your code. Thanks. I would like to know how to check the values of the keys in the hash. I checked the Perl cookbook and It showed me how to get the key value pairs and print them, but I am not familiar with populating an array with a hash, or how to dynamically print the va

Re: Installing Modules From CPAN

2003-12-23 Thread Wiggins d Anconia
Please bottom post... > Hi there, > > Theses are the messages i get when i try to install > dbd::mysql. How can i solve this problems ?, Thanks. > > cpan> install DBD::mysql > Running install for module DBD::mysql > Running make for R/RU/RUDY/DBD-mysql-2.9003.tar.gz > Is already unwrapped

Re: Installing Modules From CPAN

2003-12-23 Thread Joe Echavarria
Hi there, Theses are the messages i get when i try to install dbd::mysql. How can i solve this problems ?, Thanks. cpan> install DBD::mysql Running install for module DBD::mysql Running make for R/RU/RUDY/DBD-mysql-2.9003.tar.gz Is already unwrapped into directory /root/.cpan/build/DBD-mysq

Re: Align Text

2003-12-23 Thread James Edward Gray II
On Dec 23, 2003, at 12:17 AM, Bill Jastram wrote: After taking a look at your last suggested script I have a short question: At what point does this script read in information from the source file 'testing.txt'? Is it during the 'while (<>)' statement? If so what would the syntax be? Yes, you've

Re: Win32::TieRegistry

2003-12-23 Thread Rob Dixon
"Neill Taylor" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > > I have read the man page on using Win32::TieRegistry to find two variables > in the registry, I think I may have missed the point somewhere but I don't > seem to be able to read the keys. > > any clues ? > > # Obtain

Re: Regarding dynamic binding

2003-12-23 Thread Rob Dixon
[EMAIL PROTECTED] wrote: > > Please show me some pointers towards dynamic binding concepts in perl.We > have dynamic binding concepts in c++ and java.Like that how can I implement > dynamic binding in perl. > Thanks in advance, Hi Visu. Dynamic binding is implemented in Perl using the special @IS

Win32::TieRegistry

2003-12-23 Thread neill . taylor
I have read the man page on using Win32::TieRegistry to find two variables in the registry, I think I may have missed the point somewhere but I don't seem to be able to read the keys. any clues ? # Obtain Database user and password from passed variables if (@ARGV ==2) { $user = $ARG

win32:netsend

2003-12-23 Thread neill . taylor
How do I use win32::netsend to send a message to multiple users ? IMPORTANT NOTICE This email (including any attachments) is meant only for the intended recipient. It may also contain confidential and privileged information. If you are not the intended recipient, an

Regarding dynamic binding

2003-12-23 Thread [EMAIL PROTECTED]
Hi, Please show me some pointers towards dynamic binding concepts in perl.We have dynamic binding concepts in c++ and java.Like that how can I implement dynamic binding in perl. Thanks in advance, S.V. mail2web - Check your ema

Re: Align Text

2003-12-23 Thread Bill Jastram
After taking a look at your last suggested script I have a short question: At what point does this script read in information from the source file 'testing.txt'? Is it during the 'while (<>)' statement? If so what would the syntax be? Thanks again for your help. Bill J. __

Re: Align Text

2003-12-23 Thread Bill Jastram
Wow! That's a lot to take in, but consider it, and I'll get back to you with the results of my considerations. Thanks much. Bill J. __ On Mon, 22 Dec 2003, James Edward Gray II wrote: > On Dec 21, 2003, at 10:47 PM, Bill Jastram wrote: > > > Jam

database testing routines

2003-12-23 Thread Goodleaf, John M
Hello, I have to look at doing a lot of testing for a database audit trail (it's a federal regulations thing). It's a big database, so my plan is to write some sort of program that will query out a list of tables and then randomly select N tables to do inserts and updates. Later I'll verify that t