Re: simple substitution question

2005-02-18 Thread Ing. Branislav Gerzo
Harold Castro [HC], on Thursday, February 17, 2005 at 22:47 (-0800 (PST)) typed: HC> for example: HC> here is my string: HC> $_ = "but"; HC> s/u/a/g; HC> print $_; what about this: ( my $string = "but" ) =~ s/u/a/g; -- ...m8s, cu l8r, Brano. [Old Farts don't have to be politically correct.]

Re: Regex to extract numbers between "[ ]"

2005-02-18 Thread Ing. Branislav Gerzo
Harold Castro [HC], on Thursday, February 17, 2005 at 22:03 (-0800 (PST)) wrote: HC> I'm parsing a log file that contains numbers HC> enclosed by []. Ex. [1108702375] $string = '[1108702375] text [232134324] text...'; while ( $string =~ /\[(\d+)\]/g ) { print $1 } helps ? -- ...m8s, cu l8

RE: simple substitution question

2005-02-18 Thread Manav Mathur
=~ is the bind operator. see perldoc perlop. Manav -Original Message- From: Harold Castro [mailto:[EMAIL PROTECTED] Sent: Friday, February 18, 2005 12:17 PM To: beginners@perl.org Subject: simple substitution question Hi, There is something that's bothering me for so long regarding

Send email to microsoft exhange distribution list

2005-02-18 Thread Hany Nagaty
I have a small question. Using Perl, I'd like to send an email to an exchange distribution list. How can it be done. Is there a module that acts like an outlook client to connect to the exchange server. I've searched a lot on CPAN but couldn't find anything. I want to use it from Linux and not W

Re: Send email to microsoft exhange distribution list

2005-02-18 Thread Chris Devers
On Fri, 18 Feb 2005, Hany Nagaty wrote: > I have a small question. > > Using Perl, I'd like to send an email to an exchange distribution > list. How can it be done. Is there a module that acts like an outlook > client to connect to the exchange server. I've searched a lot on CPAN > but couldn'

Example of hash and array movement correct?

2005-02-18 Thread Bastian Angerstein
Hello, I am looking for ways to move data between array and hashes. Does anybody has a better way or idea to do some of this: Example 1: @indatas = $datas [0 .. 4]; Example 2: $nkey = $dataln[3] . $dataln[4]; Example 3: $base{$bv[0]} = [ $bv[1], $bv[2], $bv[3], $bv[4] ];

Re: Send email to microsoft exhange distribution list

2005-02-18 Thread Joel Merrick
On Fri, 2005-02-18 at 06:49 -0500, Chris Devers wrote: > On Fri, 18 Feb 2005, Hany Nagaty wrote: > > > I have a small question. > > > > Using Perl, I'd like to send an email to an exchange distribution > > list. How can it be done. Is there a module that acts like an outlook > > client to conne

Never done perl before

2005-02-18 Thread Lucio Crusca
"Perl newbie" is way too much when referred to me. I've never even thought to try to understand a single character of a perl program. Now I need to. But, still, I don't want. I live more than well with my knowledge of other languages. However I'm facing a wonderful Courier ESMTP setup that require

Re: Never done perl before

2005-02-18 Thread Ankur Gupta
Lucio Crusca wrote: "Perl newbie" is way too much when referred to me. I've never even thought to try to understand a single character of a perl program. Now I need to. But, still, I don't want. I live more than well with my knowledge of other languages. However I'm facing a wonderful Courier ESMTP

Re: Never done perl before

2005-02-18 Thread Chris Devers
On Fri, 18 Feb 2005, Lucio Crusca wrote: > What I need is to call an external executable passing a filename as > the only argument and then returning its output to the caller of the > perl script, e.g: > > $reply=`myfilter.sh $filename`; > print $reply; > > Is the above code correct for my pur

RE: Example of hash and array movement correct?

2005-02-18 Thread Larsen, Errin M HMMA/IT
> Subject: Example of hash and array movement correct? > > > > Hello, Hello > I am looking for ways to move data > between array and hashes. > In all 3 of your examples, you don't show us the declaration of your variables nor how they are filled with data. I can make some ass

RE: Example of hash and array movement correct?

2005-02-18 Thread Charles K. Clarkson
Bastian Angerstein <[EMAIL PROTECTED]> wrote: : Hello, : I am looking for ways to move data : between array and hashes. : : Does anybody has a better way or idea to do some of this: Not really. What you have works, though the first example will throw a warning under strictures and wa

Re: Never done perl before

2005-02-18 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Lucio Crusca) writes: >However I'm facing a wonderful Courier ESMTP setup that requires me to use >perl in order to write a filter. And I don't want to use perl. So I could >use one single perl operator I've found: backticks. > >What I need is to

Re: splitting by number

2005-02-18 Thread Ken Gillett
On 17 Feb 2005, at 21:40, Doug Essinger-Hileman wrote: On 17 Feb 2005 at 11:27, Ken Gillett wrote: Initially the storage requirements are 2:1, so simply dividing the name by 3 would (I think) work, i.e. if the name is exactly divisible by 3 or not could determine in which location to place it. But

Looking for easy sessions using mod_perl

2005-02-18 Thread Boysenberry Payne
I'm moving from PHP to mod_perl. What a jump... Normally in php it's as simple as: session_start(); Then depending on your settings the session is kept in a cookie or in the url. I've looked into Apache::Session a bit, also Session (which is a wrapper for Apache:Session.) I set it up locally usin

Undef value trouble

2005-02-18 Thread Nicolay Vasiliev
Hello there! As we know and as Larry Wall said in a Camel-book 0 in scalar variable is equal to undef. I have in my database PID columns with unique values. When I try to perform this column data by "while my $pid = $sth->fetchrow_array()" I lost one record because it has the "0" value. How cou

Re: Looking for easy sessions using mod_perl

2005-02-18 Thread Perrin Harkins
On Fri, 2005-02-18 at 12:43 -0600, Boysenberry Payne wrote: > Normally in php it's as simple as: > session_start(); It's that easy with mod_perl too if you use Apache::SessionManager. Save yourself some trouble and just use that. http://search.cpan.org/search?query=Apache-SessionManager&mode=dist

Re: Undef value trouble

2005-02-18 Thread Lawrence Statton
> Hello there! > > As we know and as Larry Wall said in a Camel-book 0 in scalar variable > is equal to undef. I have in my database PID columns with unique values. > When I try to perform this column data by "while my $pid = > $sth->fetchrow_array()" I lost one record because it has the "0" va

Re: Undef value trouble

2005-02-18 Thread Wiggins d'Anconia
Lawrence Statton wrote: Hello there! As we know and as Larry Wall said in a Camel-book 0 in scalar variable is equal to undef. I have in my database PID columns with unique values. When I try to perform this column data by "while my $pid = $sth->fetchrow_array()" I lost one record because it has

Securing user data

2005-02-18 Thread Tyson Sommer
Are there any not-so-obvious problems with untainting user input for passing to the shell with something like (for the sake of simplicity): # need to be able to use "." and "-" characters as well as alphanumerics chomp ( my $input = ); $input =~ s/[^A-Za-z0-9\-\.]//g;

Diamond Operator and Filenames

2005-02-18 Thread Larsen, Errin M HMMA/IT
Hi Perl-Crunchers, I've got the following code: #!/usr/bin/perl use warnings; use strict; my $logdir = '/some/application/logs'; my @logs = <$logdir/*>; push @ARGV, @logs; while( <> ) { print "$filename:\n$_" if( /with errors/ ); } Of course, my problem is that I'm not filling in $f

RE: Diamond Operator and Filenames

2005-02-18 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Larsen, Errin M HMMA/IT wrote: > Hi Perl-Crunchers, > > I've got the following code: > > #!/usr/bin/perl > > use warnings; > use strict; > > my $logdir = '/some/application/logs'; > my @logs = <$logdir/*>; > > push @ARGV, @logs; > while( <> ) { > print "$filename:\n$_" if( /with errors

RE: Diamond Operator and Filenames

2005-02-18 Thread Larsen, Errin M HMMA/IT
> Larsen, Errin M HMMA/IT wrote: > > Hi Perl-Crunchers, > > > > I've got the following code: > > <> > > push @ARGV, @logs; > > while( <> ) { > > print "$filename:\n$_" if( /with errors/ ); > > } > > > > Of course, my problem is that I'm not filling in $filename in that > > print state

RE: Diamond Operator and Filenames

2005-02-18 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Larsen, Errin M HMMA/IT wrote: >> Larsen, Errin M HMMA/IT wrote: >>> Hi Perl-Crunchers, >>> >>> I've got the following code: >>> > > <> > >>> push @ARGV, @logs; >>> while( <> ) { >>> print "$filename:\n$_" if( /with errors/ ); >>> } >>> >>> Of course, my problem is that I'm not filling

Re: Diamond Operator and Filenames

2005-02-18 Thread John W. Krahn
Larsen, Errin M HMMA/IT wrote: Hi Perl-Crunchers, Hello, I've got the following code: #!/usr/bin/perl use warnings; use strict; my $logdir = '/some/application/logs'; my @logs = <$logdir/*>; push @ARGV, @logs; while( <> ) { print "$filename:\n$_" if( /with errors/ ); } Of course, my probl

Re: Diamond Operator and Filenames

2005-02-18 Thread John W. Krahn
Wagner, David --- Senior Programmer Analyst --- WGO wrote: Larsen, Errin M HMMA/IT wrote: Hi Perl-Crunchers, I've got the following code: #!/usr/bin/perl use warnings; use strict; my $logdir = '/some/application/logs'; my @logs = <$logdir/*>; push @ARGV, @logs; while( <> ) { print "$filena

RE: Diamond Operator and Filenames

2005-02-18 Thread Wagner, David --- Senior Programmer Analyst --- WGO
John W. Krahn wrote: > Wagner, David --- Senior Programmer Analyst --- WGO wrote: >> Larsen, Errin M HMMA/IT wrote: >> >>> Hi Perl-Crunchers, >>> >>> I've got the following code: >>> >>> #!/usr/bin/perl >>> >>> use warnings; >>> use strict; >>> >>> my $logdir = '/some/application/logs'; >>> m

Re: Diamond Operator and Filenames

2005-02-18 Thread John W. Krahn
Larsen, Errin M HMMA/IT wrote: So, the <> operator shift()s the filenames off the top of @ARGV? That's usefull knowledge. Yes, but it does it before the loop starts! $ perl -le' print for @ARGV; print; while (<>) { print "$ARGV\t$ARGV[0]" if $. == 1; close ARGV if eof } print; print for @

Re: Diamond Operator and Filenames

2005-02-18 Thread John W. Krahn
John W. Krahn wrote: Wagner, David --- Senior Programmer Analyst --- WGO wrote: Larsen, Errin M HMMA/IT wrote: Hi Perl-Crunchers, I've got the following code: #!/usr/bin/perl use warnings; use strict; my $logdir = '/some/application/logs'; my @logs = <$logdir/*>; push @ARGV, @logs; while( <> ) {

RE: Securing user data

2005-02-18 Thread Tyson Sommer
> -Original Message- > From: Jay [mailto:[EMAIL PROTECTED] > Sent: Friday, February 18, 2005 3:42 PM > To: [EMAIL PROTECTED] > Subject: Re: Securing user data > > On Fri, 18 Feb 2005 14:33:24 -0600, Tyson Sommer > <[EMAIL PROTECTED]> wrote: > > Are there any not-so-obvious problems wi

Re: Challenge (for me, at least)

2005-02-18 Thread Gavin Henry
On Friday 18 Feb 2005 23:16, Tyson Sommer wrote: > Is there any way to squeeze the following into one line? (assume using > CGI.pm and that my $q = new CGI;): Don't hijack threads. Please start another. -- Just getting into the best language ever... Fancy a [EMAIL PROTECTED] or something on htt

Re: Securing user data

2005-02-18 Thread John W. Krahn
Tyson Sommer wrote: Those are some good points. I should definitely strip any leading "-"s. This appears to work: $input =~ s/^-*|[^A-Za-z0-9.-_]//g; That could be simplified to: $input =~ s/^-*|[^a-z.-_]//g; Because the range [.-_] includes uppercase letters and numbers unless you real

Dir search and concat

2005-02-18 Thread AstroDrabb
Does anyone know if there are any Perl scripts out there that will do the following: I want a script that gets pointed to a directory and searches that directory and all sub-directories for *.html (or I can just pass all the files to it with a simple find command) . When it finds an *.html file i

Re: Dir search and concat

2005-02-18 Thread John W. Krahn
AstroDrabb wrote: Does anyone know if there are any Perl scripts out there that will do the following: I want a script that gets pointed to a directory and searches that directory and all sub-directories for *.html (or I can just pass all the files to it with a simple find command) . When it finds

Re: splitting by number

2005-02-18 Thread Doug Essinger-Hileman
On 18 Feb 2005 at 16:12, Ken Gillett wrote: > That's very much what I had in mind, but I couldn't figure how to > automatically set up which remainders go to which HD. I want just the > ratio to be specified and everything else to be calculated. However, I > think I can see how to do that now. >