Hi All,
Been ages since I last posted to this list...
Anyhoo, I have a script which handles the uploading of a file.
It uses the CGI module to get the form params etc and open/read/close
statements to receive the file. This is fine and all works well. The
problem is a temporary file (of the s
On May 13, rmck said:
> while () {
>my $sport = (split(/\s/,$_))[8];
>my $sdport = (split(/\s/,$_))[10];
You have $sdport here, but you USE $dport.
>next if $sport =~ /\D/;
>next if $dport =~ /\D/;
> if ($sport =~ /^(20|21|22|25|53|80|109|110|123|137|161|443)$/ || $dport =~
>
rmck wrote:
Hello,
This code below works. But I am wondering if it can be made more efficient:
while () {
my $sport = (split(/\s/,$_))[8];
my $sdport = (split(/\s/,$_))[10];
next if $sport =~ /\D/;
next if $dport =~ /\D/;
if ($sport =~ /^(20|21|22|25|53|80|109|110|123|137|161|443)$/ || $dp
Hello,
This code below works. But I am wondering if it can be made more efficient:
while () {
my $sport = (split(/\s/,$_))[8];
my $sdport = (split(/\s/,$_))[10];
next if $sport =~ /\D/;
next if $dport =~ /\D/;
if ($sport =~ /^(20|21|22|25|53|80|109|110|123|137|161|443)$/ || $dport =~
/^(2
Jean-Sébastien Guay wrote:
http://en.wikipedia.org/wiki/Optimization_(computer_science)
Optimization (computer science
From Wikipedia, the free encyclopedia.
(Wikipedia does not have an article on this topic yet. To start the
article, click Edit this page.)
?? :( I was wanting to read it.
On May 13, Harry Putnam said:
>Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> writes:
>
>> On May 13, Harry Putnam said:
>>
>>>Is there a date manipulation module that does the same thing as gnu
>>>`date -d' command? That is, given a spec string, it returns a date in
>>>the past in user selected format.
> > http://en.wikipedia.org/wiki/Optimization_(computer_science)
>
> Optimization (computer science
>
> From Wikipedia, the free encyclopedia.
>
> (Wikipedia does not have an article on this topic yet. To start the
> article, click Edit this page.)
>
> ?? :( I was wanting to read it...
Jeff 'japhy' Pinyan wrote:
The lesson to learn is:
Premature optimization is the root of all evil.
Got ya ;p
http://en.wikipedia.org/wiki/Optimization_(computer_science)
Optimization (computer science
From Wikipedia, the free encyclopedia.
(Wikipedia does not have an article on this topi
"John W. Krahn" <[EMAIL PROTECTED]> writes:
>> (($var1, $var2) = $incoming) =~ s/(^ *\-)([A-Z])( *\-)([a-z])/$2/;
>
> $incoming =~ s/^( *-)([A-Z])( *-)([a-z])/($var1, $var2)=($2,$4)/e;
Ha.. yup thats right, you can put an expression between those last
two slashes... nice.
--
To unsubscribe, e-
Bob Showalter <[EMAIL PROTECTED]> writes:
> Or, you can use something like Date::Manip which handles the '2 weeks ago'
> type of expressions. It has its own UnixDate function that is similar to
> POSIX::strftime.
Aha... now we're talking. Date::Manip is what I was after:
cat test.pl:
#!/usr/
My setup:
OS= Linux (FedoraCore1 test2)
I see an actual loss of data in reading perldoc output from an xterm
if my term is sized a little small.
I'll show a repeatable example (here anyway):
xterm -geometry 65x20 &
In that xterm call:
perldoc POSIX
In that page search for past
(/past )
Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> writes:
> On May 13, Harry Putnam said:
>
>>Is there a date manipulation module that does the same thing as gnu
>>`date -d' command? That is, given a spec string, it returns a date in
>>the past in user selected format.
>>
>>Like what gnu `date' would do wi
Harry Putnam wrote:
> Group,
>
> Is there a date manipulation module that does the same thing as gnu
> `date -d' command? That is, given a spec string, it returns a date in
> the past in user selected format.
>
> Like what gnu `date' would do with:
> date -d '-2 weeks' +"%m%d%Y_%T"
> 042920
"Wiggins d Anconia" <[EMAIL PROTECTED]> writes:
>>
>> Hi All,
>>Is there any way in perl i can search for the running
> application and its process id using perl. e.g. Let us suppose I know
> the name of the application as httpd Can i search in processes
> whether that application is runn
Harry Putnam wrote:
>
> How can I get var1 and var2 in one step using s/// type method?
> (Not using split)
>
> cat test.pl
> #!/usr/local/bin/perl -w
>
> $incoming = shift;
> ## Where incoming looks like '-A -a'
> ($var1 = $incoming) =~ s/(^ *\-)([A-Z])( *\-)([a-z])/$2/;
> ($var2 = $incoming) =
On May 13, Harry Putnam said:
>Is there a date manipulation module that does the same thing as gnu
>`date -d' command? That is, given a spec string, it returns a date in
>the past in user selected format.
>
>Like what gnu `date' would do with:
> date -d '-2 weeks' +"%m%d%Y_%T"
> 04292004_13:20
The lesson to learn is:
Premature optimization is the root of all evil.
http://en.wikipedia.org/wiki/Optimization_(computer_science)
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/
CPAN
Group,
Is there a date manipulation module that does the same thing as gnu
`date -d' command? That is, given a spec string, it returns a date in
the past in user selected format.
Like what gnu `date' would do with:
date -d '-2 weeks' +"%m%d%Y_%T"
04292004_13:20:28
I've written some manipul
Jeff 'Japhy' Pinyan wrote:
>
> On May 13, Lee Johnson said:
> >
> >#
> ># End date is a year after start date
> >#
> >$edate = $sdate;
> >$edate =~ s/\///g;
> >$edate++;
> >$edate =~ s/.*(\d{4})$/01\/04\/$1/;
>
> Are you sure you want to just use April 1st (or January 4th) always? You
> don't wa
Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> writes:
[...]
>>(($var1, $var2) = $incoming) =~ s/(^ *\-)([A-Z])( *\-)([a-z])/$2/;
>
> Use this:
>
> ($var1, $var2) = $incoming =~ /-([A-Z])/g;
Thanks... thats handy.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
Ricardo SIGNES wrote:
* "JupiterHost.Net" <[EMAIL PROTECTED]> [2004-05-13T11:35:58]
Bob Showalter wrote:
for instance:
$newvariable = "$howdy";
should be:
$newvariable = $howdy;
That's not an appropriate optimization. Perl objects can overload
stringification.
Interesting...
So when would tha
> -Message d'origine-
> De : Wiggins d Anconia [mailto:[EMAIL PROTECTED]
> Envoyé : jeudi 13 mai 2004 18:02
> À : NYIMI Jose (BMB); [EMAIL PROTECTED]
> Objet : RE: Extracting attachment from mail
>
> > > -Original Message-
> > > From: NYIMI Jose (BMB)
> > > Sent: Thursday, May 13
* "JupiterHost.Net" <[EMAIL PROTECTED]> [2004-05-13T11:35:58]
> Bob Showalter wrote:
> >> for instance:
> >> $newvariable = "$howdy";
> >> should be:
> >> $newvariable = $howdy;
> >
> >That's not an appropriate optimization. Perl objects can overload
> >stringification.
>
> Interesting...
> So
How can I get var1 and var2 in one step using s/// type method?
(Not using split)
cat test.pl
#!/usr/local/bin/perl -w
$incoming = shift;
## Where incoming looks like '-A -a'
($var1 = $incoming) =~ s/(^ *\-)([A-Z])( *\-)([a-z])/$2/;
($var2 = $incoming) =~ s/(^ *\-)([A-Z])( *\-)([a-z])/$4/;
print
>
> Hi All,
>Is there any way in perl i can search for the running
application and its process id using perl. e.g. Let us suppose I know
the name of the application as httpd Can i search in processes
whether that application is running and what is its process id My
problem is even if some
On May 13, Lee Johnson said:
>#
># End date is a year after start date
>#
>$edate = $sdate;
>$edate =~ s/\///g;
>$edate++;
>$edate =~ s/.*(\d{4})$/01\/04\/$1/;
Are you sure you want to just use April 1st (or January 4th) always? You
don't want to use the day and month in $sdate?
>where $sdate i
> NYIMI Jose (BMB) wrote:
> > I need to write a perl script that will run on solaris and the job of
> > this script will be :
> >
> > - read a mail from a predefined shared mail box (Outlook/Exchange
> > Server)
>
> Mail::IMAPClient or Mail::POP3Client
>
> > - extract the mail attachment (text
NYIMI Jose (BMB) wrote:
> I need to write a perl script that will run on solaris and the job of
> this script will be :
>
> - read a mail from a predefined shared mail box (Outlook/Exchange
> Server)
Mail::IMAPClient or Mail::POP3Client
> - extract the mail attachment (text file)
> - parse the
Is there a faster and/or cleaner way to do the following:
#
# End date is a year after start date
#
$edate = $sdate;
$edate =~ s/\///g;
$edate++;
$edate =~ s/.*(\d{4})$/01\/04\/$1/;
where $sdate is a UK date of the type "dd/mm/"
I've tried ($edate = $sdate) =~ s/(.*)(\d)$/$1($2++)/e; to
JupiterHost.Net wrote:
> Hello list,
>
> Perl::Tidy is very excellent for making source look nice.
> I was wondering if anyone knew of anything that is the same type of
> idea but it optomizes your Perl code to run a bit faster:
> for instance:
> $newvariable = "$howdy";
> should be:
>
On May 12, Larry Wissink said:
>We have a backup server that is missing records from the production
>server for a particular table. We know that it should have sequential
>records and that it is missing some records. We want to get a sense of
>the number of records missing. So, we know the prob
- Original Message -
From: "Larry Wissink" <[EMAIL PROTECTED]>
Newsgroups: perl.beginners
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 12, 2004 6:39 PM
Subject: Finding missing numbers in sequence
I have a problem that I thought would be perfect for Perl, except that I
seem to be using
On May 13, Tim & Kylie Duke said:
>I am trying to build a perl program that reads through a very large text
>file, searches for a pattern, and prints the pattern - within its context -
>into a log file for later study. The context is defined as, say, 20
>characters before and after the found patt
Hi All,
Is there any way in perl i can search for the running application and its
process id using perl. e.g. Let us suppose I know the name of the application as
httpd Can i search in processes whether that application is running and what
is its process id My problem is even if some file
On May 13, anish mehta said:
>Pls tell me what are the tied variables in perl. I have tried it to read it
>from book but some words from the experts will be quite useful to make
>further progress and clarity in understanding those in general terms.
A tied variable can be explained in two ways; I
On May 12, Rob Dixon said:
>> >Now, I want to walk the tree starting with a known "package1" and build an
>> >ordered list of packages to install. For example:
>
>But in the general caase there's a problem with finding the root of the
>tree. Indeed there may be several independent trees or none at
I think there will be some optimizations always possible, but You wont
get any dramatic improvements.
What I would do is something like this
First make sure that all the data is sorted in the file
Create a sequence array of all the required numbers, In your example it
was all numbers from 1..10
#
I have a problem that I thought would be perfect for Perl, except that I
seem to be using all my system resources to run it. Of course this
probably means I'm doing it the wrong way...
The problem:
We have a backup server that is missing records from the production
server for a particular tab
Jeff 'Japhy' Pinyan wrote:
>
> >my %tree = { package1 => [ package2, package3, package4 ],
> > package2 => [ package7 ],
> > package3 => [ package5 ],
> > package4 => [ package7, package6],
> > package5 => [ ],
> > package6 => [ ],
>
Andrew Gaffney wrote:
>
> In a program I'm working on, I build a hash "tree" of sorts that contains
> package dependencies. Each key contains an array with the first level
> dependencies of the key. Each one of those dependencies have their own key with
> their first level dependencies in the hash.
John McKown wrote:
On Sun, 9 May 2004, John Doe wrote:
Hello all,
i trying to sort one my file that is 10 MB and contain
records:
---
aa
adsad
dasd
das
aa
---
i want to sort and eleminate double records.
I use:
$perl -0777ane '$, = "\n"; @[EMAIL PROTECTED] = (); print sort keys %uniq' \ out.log
B
John W. Krahn wrote:
John Doe wrote:
Hello all,
Hello,
i trying to sort one my file that is 10 MB and contain
records:
---
aa
adsad
dasd
das
aa
---
i want to sort and eleminate double records.
I use:
$perl -0777ane '$, = "\n"; @[EMAIL PROTECTED] = (); print sort keys %uniq' \ out.log
But i rec
[EMAIL PROTECTED] wrote:
> my openconf function contains:
>
> sub openconf {
>my $pkg = shift;
>my $self = bless([EMAIL PROTECTED],$pkg);
>open(...
>
>return($self);
> }
>
> I have "my @config;" set at the beggining of the module
>
you have defined @config as a class va
On Wed, May 12, 2004 at 12:59:44PM -0500, Ben Miller wrote:
> my @links = $mech->find_all_links(tag = "a", text_regex => qr/\bWORD\b/i );
... tag => "a", ...
I suspect.
--
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional comma
On Thu, 2004-05-13 at 14:52, NYIMI Jose (BMB) wrote:
> Hello,
>
> I need to write a perl script that will run on solaris and the job of this script
> will be :
>
> - read a mail from a predefined shared mail box (Outlook/Exchange Server)
> - extract the mail attachment (text file)
> - parse the
Hello,
I need to write a perl script that will run on solaris and the job of this script will
be :
- read a mail from a predefined shared mail box (Outlook/Exchange Server)
- extract the mail attachment (text file)
- parse the content
- create an excel sheet (same content)
Any input is welcome
On Thu, 2004-05-13 at 14:12, anish mehta wrote:
> Hi !!
>
> Pls tell me what are the tied variables in perl. I have tried it to read it
> from book but some words from the experts will be quite useful to make
> further progress and clarity in understanding those in general terms.
By tying a va
Hello José,
Unfortunately, these different syntax don't work ...
Perhaps I will ask directly to the module's author to find what is wrong in my code.
Thanks again for your help !
Jean
-Message d'origine-
De : NYIMI Jose (BMB) [mailto:[EMAIL PROTECTED]
Envoyé : mardi, 11. mai 2004 16:2
Hello José,
Unfortunatel
-Message d'origine-
De : NYIMI Jose (BMB) [mailto:[EMAIL PROTECTED]
Envoyé : mardi, 11. mai 2004 16:27
À : BERTHOLD Jean; [EMAIL PROTECTED]
Objet : RE: Problem using File::RsyncP module
> -Original Message-
> From: BERTHOLD Jean [mailto:[EMAIL PROTECTED
Hi !!
Pls tell me what are the tied variables in perl. I have tried it to read it
from book but some words from the experts will be quite useful to make
further progress and clarity in understanding those in general terms.
Thanks in advance,
Regards,
Anish
___
Two thoughts here:
1) The $. Variable has the line number of the file you are iterating
through, so you could use that combined with pos()
2) You could also try something like this:
while(){
if($_ =~ /.{20}$pattern.{20}/){
push(@found,$1);
}
}
-Original Message-
From:
Hi,
I am trying to build a perl program that reads through a very large text
file, searches for a pattern, and prints the pattern - within its context -
into a log file for later study. The context is defined as, say, 20
characters before and after the found pattern. I intend to use this for
lin
52 matches
Mail list logo