RE: CVS and Perl

2003-08-04 Thread denis
Jess, Dont know/remeber if I thanked you for your input, but thanks.. Denis On Wed, 30 Jul 2003, Balint, Jess wrote: > You could make an rc file in your home directory, store the username and > password, use 600 permissions and read the file when the script is run. > > --Jess-- > > > -Ori

Re: %EXPORT_TAGS question

2003-08-04 Thread Jenda Krynicky
From: "Dan Muey" <[EMAIL PROTECTED]> > perldoc Exporter says: > > %EXPORT_TAGS = (T1 => [qw(A1 A2 B1 B2)], T2 => [qw(A1 A2 B3 B4)]); > > So I am wondering if I can do something like this wilst filling in > tags: > > %EXPORT_TAGS = ( > T1 => [EMAIL PROTECTED],qw(A1 A2 B1 B2)], > T2 => [qw(A1 A

RE: extracting text

2003-08-04 Thread Bryan Irvine
> > Assuming there is only one set of brackets on a line, and you only want the IP > address between them, and READLOG is an open handle to your log: > > - Not Tested - > my @ips; > while (my $line = ) { >if ($line =~ /\[(.*)\]/) { > push @ips, $1; >} >else { > print STD

Apache-Session Error

2003-08-04 Thread mmbodji
Hello: I am just testing with the following code that I copied from the web (module): use Apache::Session::Store::MySQL; my $store = new Apache::Session::Store::MySQL; $store->insert($ref); $store->update($ref); $store->materialize($ref); $store->remove($ref); tie %hash, "Apache::Ses

%EXPORT_TAGS question

2003-08-04 Thread Dan Muey
perldoc Exporter says: %EXPORT_TAGS = (T1 => [qw(A1 A2 B1 B2)], T2 => [qw(A1 A2 B3 B4)]); So I am wondering if I can do something like this wilst filling in tags: %EXPORT_TAGS = ( T1 => [EMAIL PROTECTED],qw(A1 A2 B1 B2)], T2 => [qw(A1 A2 B3 B4)]), T3 => ['joemama','bendo

Re: SQL/Win32::ODBC/MSAccess from Perl 5.6?

2003-08-04 Thread Jenda Krynicky
From: Richard Heintze <[EMAIL PROTECTED]> > Is this an appropriate place to post questions on > Win32::ODBC/MSAccess 2000/Perl 5.6 cgi/Apache HTTPD? Yes. For CGI related questions [EMAIL PROTECTED] would be better, but since this one is not related to CGI at all ... > If not, can someone direct

Re: question about coderefs

2003-08-04 Thread Jenda Krynicky
From: Kevin Pfeiffer <[EMAIL PROTECTED]> > I'm doing an exercise with coderefs and wondering if there is much > difference between my answer and the one given... > > Here is my subroutine that returns two coderefs... > > sub gather_mtime_between { >my ($start, $stop) = @_; >my @files = ()

RE: extracting text

2003-08-04 Thread wiggins
On 04 Aug 2003 14:08:29 -0700, Bryan Irvine <[EMAIL PROTECTED]> wrote: > I'm trying to build a script to automagically black-list spammers. How > can I extract the ip address from between [ ]? > > turn this: > > Received: from 24.60.195.149 (h0

RE: Structuring Data in Perl

2003-08-04 Thread wiggins
On Mon, 4 Aug 2003 17:09:40 -0400 , Smith Jeff D <[EMAIL PROTECTED]> wrote: > This is a request for insight on structuring data from a log file for later > retrieval and stuffing into a mail message. > I'm having trouble trying to set up the proper

extracting text

2003-08-04 Thread Bryan Irvine
I'm trying to build a script to automagically black-list spammers. How can I extract the ip address from between [ ]? turn this: Received: from 24.60.195.149 (h00a0cce008a4.ne.client2.attbi.com [24.60.195.149]) Received: from 11.139.74.233 ([11.139.74.233]) by n7.groups.yahoo.com with NNFMP; M

Re: Splitting a path

2003-08-04 Thread Steve Grazzini
On Mon, Aug 04, 2003 at 02:00:03PM -0700, Gupta, Sharad wrote: > I may be missing something, but the doc for ENV says: > > " Arrays are implemented in terms of split and join, > using $Config::Config{path_sep} as the delimiter. " > > Now if i split this: > > Foo = C:\foo\bar:D:\foo\bar > > usi

Structuring Data in Perl

2003-08-04 Thread Smith Jeff D
This is a request for insight on structuring data from a log file for later retrieval and stuffing into a mail message. I'm having trouble trying to set up the proper form of references to store this data. Here's the source log file format(line numbers are shown for clarification): Line1: Status

RE: Splitting a path

2003-08-04 Thread Gupta, Sharad
I may be missing something, but the doc for ENV says: " Arrays are implemented in terms of split and join, using $Config::Config{path_sep} as the delimiter. " Now if i split this: Foo = C:\foo\bar:D:\foo\bar using: use Env qw(@Foo); print "$_\n" foreach (@Foo); i guess it would print the wh

combinations

2003-08-04 Thread David Byrne
I am fairly new to Perl and haven't approached a scipt this complex or computation this intensive. So I would certainly appreciate any advice. I have successfully created a hash of arrays equivalent to a 122 x 6152 matrix that I want to run in 'pairwise combinations' and execute the 'sum of the

Re: arrays

2003-08-04 Thread John W. Krahn
Jonathan Musto wrote: > > Hi there, Hello, > I've got an array of lines, split up by spaces as follows: > > Sun-router rack1.2 leeds > Cisco-router rack3.2 skem > Sun-switch rack2.3 manchester > etc. > > How can i add the following to the end of each line, P *NULL*?... e.g. > > Sun-router

Re: print <<"HTML code"; in NETSCAPE

2003-08-04 Thread Ovid
--- mario kulka <[EMAIL PROTECTED]> wrote: > I'm using the following to print HTML to the browser: > > print <<"HTML code"; > > "my html here" > > HTML code > > It works fine in IE but when I execute the script under Netscape it displays > the source instead of loading the page based on the so

Re: I just work this out.. but seems no point to use it

2003-08-04 Thread Steve Grazzini
On Sun, Aug 03, 2003 at 03:04:00PM -0400, Todd W. wrote: > "Li Ngok Lam" <[EMAIL PROTECTED]> wrote: > > $x = sub { $y = shift; print $y }; [ snip ] > > 2. Any "name" for this kind of coding style ? > > I dont know of a name, but I guess I wouldnt call it a coding style. > Storing code in variab

RE: 'use' and 'require'

2003-08-04 Thread Allison, Jason (JALLISON)
The 'use' is giving me warning's against 5.6.1 code with 5.8.0: v-string in use/require non-portable at /PATH line #. I will need to update all of the 'use' statements from "use 5.6.1;" to "use 5.006_001"; My question is: How are others implementing common 'use' clauses across the applications s

RE: 'use' and 'require'

2003-08-04 Thread Bob Showalter
Allison, Jason (JALLISON) wrote: > Hello all, > > Is there a way to 'variablize' the version for a 'use' statement. > This way, if I wanted to change version I could only change it in one > place with those changes cascading across all apps. Where would that "one place" be? Wherever that is, put

'use' and 'require'

2003-08-04 Thread Allison, Jason (JALLISON)
Hello all, Is there a way to 'variablize' the version for a 'use' statement. This way, if I wanted to change version I could only change it in one place with those changes cascading across all apps. Usage would look something like this: use $perl_version; Thanks in advance, Jason Allison Prin

Re: print <<"HTML code"; in NETSCAPE

2003-08-04 Thread Li Ngok Lam
You are possibly missing this line : print "Content-type: text/html\n\n"; HTH - Original Message - From: "mario kulka" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, August 05, 2003 2:32 AM Subject: print <<"HTML code"; in NETSCAPE > I'm using the following to print HTML to

print <<"HTML code"; in NETSCAPE

2003-08-04 Thread mario kulka
I'm using the following to print HTML to the browser: print <<"HTML code"; "my html here" HTML code It works fine in IE but when I execute the script under Netscape it displays the source instead of loading the page based on the source. Please help. Mariusz ___

RE: Quick DBI connection

2003-08-04 Thread Dan Muey
> > So what I need to know I guess is: > > 1) in MYSuperModule.pm do I > > a) use DBI; > > b) sub DBI::db::myfunc {} or sub ???::Myfunc {} > > 2) What is the best way to do that without causing namespace > > problems? > > > > So answer a question with a question! >

Re: connecting oracle

2003-08-04 Thread Rob Dixon
Visu wrote: > Hi, > Kindly guide me to connect oracle through > perl.Any pointers and directions are welcome You'll need to install the DBD::Oracle database driver as well as the generic DBI interface module. After that all databases (in theory) behave similarly. HTH, Rob -- To unsubs

RE: arrays

2003-08-04 Thread Charles K. Clarkson
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: : @array = map {"$_ P *NULL*"} (@array); That solution makes a nice subroutine: my @array = ( 'Sun-router rack1.2 leeds', 'Cisco-router rack3.2 skem', 'Sun-switch rack2.3 manchester', ); concat_array( ' P *NULL*', [EMAIL PROTECTED] );

Re: Mail::Sender question

2003-08-04 Thread Jenda Krynicky
From: "Dan Muey" <[EMAIL PROTECTED]> > For a simple plain text message I do new( with smtp and from) then > Open (with to and subject) Since that is the minimal setup for me. > > What I'd like to do is add headers if they are specifed, after Open() > and SendLineEnc(). No. When Open() or OpenMult

Re: a hash reference is not a hash-> lesson learned the hard way...

2003-08-04 Thread Jenda Krynicky
From: "West, William M" <[EMAIL PROTECTED]> > i tried for the longest time to get something like > the following to work:: > > foreach $section (keys %board){ > > for my $a (1..19){ > for (1..19){ > $board->{"Q1S1"}->[$a]->[$_] and print "\n$a$_"; > ...

RE: Mail::Sender question

2003-08-04 Thread Jenda Krynicky
From: "Dan Muey" <[EMAIL PROTECTED]> > If I do this: > > use Mail::Sender; > > my $sender = new Mail::Sender {smtp => $ip, from => $frm}; > $sender->Open({ > to => $to, > subject => $sb, > priority => 5, > cc => $cc, > bcc => $bcc, > confirm => $cfm, > }); > $sender->SendLineEnc($msg); > $s

RE: Mail::Sender question

2003-08-04 Thread Dan Muey
> > What I'd like to do is add headers if they are specifed, > after Open() > > and SendLineEnc(). > > No. When Open() or OpenMultipart() returns all headers have already > been sent and the message body is expected. There is no way to add > any more headers. > > Unlike MIME::Lite Mail::Sen

RE: connecting oracle

2003-08-04 Thread Dan Muey
> Hi, Howdy > Kindly guide me to connect oracle through > perl.Any pointers and directions are welcome > I'm a mysql fellow myself but I'd start with DBI.pm. It lets you connect to db and do queries. perldoc DBI HTH DMuey > Thanks, > SV -- To unsubscribe, e-mail: [EMAIL PROTECTED]

RE: Mail::Sender question

2003-08-04 Thread Dan Muey
> From: "Dan Muey" <[EMAIL PROTECTED]> > > If I do this: > > > > use Mail::Sender; > > > > my $sender = new Mail::Sender {smtp => $ip, from => $frm}; > > $sender->Open({ to => $to, > > subject => $sb, > > priority => 5, > > cc => $cc, > > bcc => $bcc, > > confirm => $cfm, > > }); > > $sen

Re: Line Numbering

2003-08-04 Thread Rob Dixon
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Thank you everyone for your suggestions. > > This is getting more and more interesting. The script I am looking at > actually worked once!! > > I tried to use dianostics to no avail. I got the following message: > > syntax error at sy

Re: arrays

2003-08-04 Thread awarsd
Hi, sorry my last post but actually this is quite good and better @array = map {"$_ P *NULL*"} (@array); Award -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: arrays

2003-08-04 Thread awarsd
Hi, if we have @routers. you can do this my ($c, $line); $c=0; foreach $line(@routers){ $line = $line." P *NULL*"; push @newrouters, $line; } or to use the $c foreach $line (@routers){ @routers[$c] = $line." P *NULL*"; $c++; } "Jonathan Musto" <[EMAIL PROTECTED]> wro

RE: arrays

2003-08-04 Thread Marcos . Rebelo
@array = map {"$_ P *NULL*"} (@array); -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, August 04, 2003 12:18 PM To: [EMAIL PROTECTED] Subject: arrays Hi there, I've got an array of lines, split up by spaces as follows: Sun-router rack1.2 leeds Cisco

arrays

2003-08-04 Thread jonathan . musto
Hi there, I've got an array of lines, split up by spaces as follows: Sun-router rack1.2 leeds Cisco-router rack3.2 skem Sun-switch rack2.3 manchester etc. How can i add the following to the end of each line, P *NULL*?... e.g. Sun-router rack1.2 leeds P *NULL* Cisco-router rack3.2 skem P

RE: Line Numbering

2003-08-04 Thread johnstonp
Thank you everyone for your suggestions. This is getting more and more interesting. The script I am looking at actually worked once!! I tried to use dianostics to no avail. I got the following message: syntax error at sys:\perl\lib/diagnostics.pm line 171, near "use 5.005_64" I then did a p

Re: Emacs and Perl syntax compile

2003-08-04 Thread Ramprasad
Douglas Harter wrote: I am creating a good many perl scripts on a Unix using emacs. Can someone tell me what I need in my .emacs to do perl syntax compiles from emacs? . This is available as a menu drop down in the X version For the console version I couldnt figure that out , but I did a work ar

RE: connecting oracle

2003-08-04 Thread NYIMI Jose (BMB)
use DBI module. Here some usefull links: http://dbi.perl.org/index.html http://www.saturn5.com/~jwb/dbi-examples.html#connect José. -Original Message- From: Visu [mailto:[EMAIL PROTECTED] Sent: Monday, August 04, 2003 7:12 AM To: [EMAIL PROTECTED] Subject: connecting oracle Hi, Kindl

Re: Difficulties installing the Tk module

2003-08-04 Thread Ramprasad
John Burski wrote: Greetings, All! I was going to attempt to learn a bit of Perl/Tk, but I've run into a bit of trouble installing the Tk module. Here's some information about my system: Red Hat 8.0, Perl version 5.8.0. I downloaded Tk-800.024.tar.gz from CPAN. I gunzipped and extracted everyt

Re: connecting oracle

2003-08-04 Thread Ramprasad
Visu wrote: Hi, Kindly guide me to connect oracle through perl.Any pointers and directions are welcome Thanks, SV Use a module like DBI http://search.cpan.org/author/TIMB/DBI-1.37/DBI.pm use DBI; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTEC

MIME::Parser how to encapsulate a message in another multipart

2003-08-04 Thread Ramprasad
I am using MIME::Parser to add an attachment to every mail that hits an smtp server. This script replaces whatever mime-type of the mail with multipart/mixed and adds new attachment Works fine with text/plain or multipart/mixed incoming messages but the problem is when a multipart/alternative