Re: Print statement

2004-05-13 Thread Wiggins d Anconia
Hi, Is there any way in which I can tell perl where to print my data. i.e. Here is my .html That doesn't look like HTML to me? I am thoroughly confused, can you provide better information about the issue? As a hunch you might want to check out one of the various template kits,

Switch

2004-05-13 Thread Werner Otto
Is there some kind of a swtich statement in perl? -- Kind Regards, Werner Otto -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: Switch

2004-05-13 Thread David Dorward
On 13 May 2004, at 10:29, Werner Otto wrote: Is there some kind of a swtich statement in perl? Yes and no. See: perldoc -q switch -- David Dorward http://dorward.me.uk/ http://blog.dorward.me.uk/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: How to Search for running Application

2004-05-13 Thread Wiggins d Anconia
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 httpdbinary Can i search in processes whether that application is running and what is its process id My problem is even if

Re: Incrementing during a regexp substitution

2004-05-13 Thread Jeff 'japhy' Pinyan
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 is a UK

Do this in one step (grab vars with s///)

2004-05-13 Thread Harry Putnam
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/;

recording the position of m// searches

2004-05-13 Thread Tim Kylie Duke
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

RE: recording the position of m// searches

2004-05-13 Thread Tim Johnson
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(INFILE){ if($_ =~ /.{20}$pattern.{20}/){ push(@found,$1); } } -Original Message-

tied variables

2004-05-13 Thread anish mehta
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

RE: Problem using File::RsyncP module

2004-05-13 Thread BERTHOLD Jean
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]

RE: Problem using File::RsyncP module

2004-05-13 Thread BERTHOLD Jean
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

Re: tied variables

2004-05-13 Thread Ramprasad A Padmanabhan
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

Extracting attachment from mail

2004-05-13 Thread NYIMI Jose (BMB)
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

Re: Extracting attachment from mail

2004-05-13 Thread Ramprasad A Padmanabhan
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 content

Re: WWW::Mechanize question

2004-05-13 Thread Paul Johnson
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 commands,

Re: Multi library

2004-05-13 Thread david
[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 variable which

Re: Problem when sort file

2004-05-13 Thread John Doe
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

Re: Problem when sort file

2004-05-13 Thread John Doe
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

Re: dependency tree

2004-05-13 Thread Rob Dixon
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. For

Re: dependency tree

2004-05-13 Thread Rob Dixon
Jeff 'Japhy' Pinyan wrote: my %tree = { package1 = [ package2, package3, package4 ], package2 = [ package7 ], package3 = [ package5 ], package4 = [ package7, package6], package5 = [ ], package6 = [ ],

Finding missing numbers in sequence

2004-05-13 Thread Larry Wissink
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

Re: Finding missing numbers in sequence

2004-05-13 Thread Ramprasad A Padmanabhan
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

Re: dependency tree

2004-05-13 Thread Jeff 'japhy' Pinyan
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 all if

Re: tied variables

2004-05-13 Thread Jeff 'japhy' Pinyan
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

How to Search for running Application

2004-05-13 Thread amrahsa
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 httpdbinary Can i search in processes whether that application is running and what is its process id My problem is even if

Re: recording the position of m// searches

2004-05-13 Thread Jeff 'japhy' Pinyan
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 pattern.

Re: Finding missing numbers in sequence

2004-05-13 Thread Chris Charley
- 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 all

Re: Finding missing numbers in sequence

2004-05-13 Thread Jeff 'japhy' Pinyan
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 problem

RE: Perl::Optomizer

2004-05-13 Thread Bob Showalter
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:

Incrementing during a regexp substitution

2004-05-13 Thread Lee Johnson
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

RE: Extracting attachment from mail

2004-05-13 Thread Bob Showalter
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

RE: Extracting attachment from mail

2004-05-13 Thread Wiggins d Anconia
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) -

Re: Perl::Optomizer

2004-05-13 Thread Ricardo SIGNES
* 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 that cause

RE : Extracting attachment from mail

2004-05-13 Thread Jose Nyimi
-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, 2004 11:23

Re: Perl::Optomizer

2004-05-13 Thread JupiterHost.Net
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 that

Re: Incrementing during a regexp substitution

2004-05-13 Thread John W. Krahn
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 want to use the day

date manipulation mods

2004-05-13 Thread Harry Putnam
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

Re: date manipulation mods

2004-05-13 Thread Jeff 'japhy' Pinyan
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:28 You

Re: Do this in one step (grab vars with s///)

2004-05-13 Thread John W. Krahn
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) =~ s/(^

Re: How to Search for running Application

2004-05-13 Thread Harry Putnam
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 httpdbinary Can i search in processes whether that application is running

RE: date manipulation mods

2004-05-13 Thread Bob Showalter
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

Re: date manipulation mods

2004-05-13 Thread Harry Putnam
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 with: date

perldoc display with data missing

2004-05-13 Thread Harry Putnam
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

Re: date manipulation mods

2004-05-13 Thread Harry Putnam
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:

Re: Do this in one step (grab vars with s///)

2004-05-13 Thread Harry Putnam
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-mail:

Re: Perl::Optomizer

2004-05-13 Thread JupiterHost.Net
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

RE: Perl::Optomizer

2004-05-13 Thread Jean-Sébastien Guay
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... Looks like

Re: date manipulation mods

2004-05-13 Thread Jeff 'japhy' Pinyan
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. Like what gnu

Re: Perl::Optomizer

2004-05-13 Thread JupiterHost.Net
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

check my split

2004-05-13 Thread rmck
Hello, This code below works. But I am wondering if it can be made more efficient: while (FHOREAD) { 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

Re: check my split

2004-05-13 Thread Wiggins d'Anconia
rmck wrote: Hello, This code below works. But I am wondering if it can be made more efficient: while (FHOREAD) { my $sport = (split(/\s/,$_))[8]; my $sdport = (split(/\s/,$_))[10]; next if $sport =~ /\D/; next if $dport =~ /\D/; if ($sport =~

Re: check my split

2004-05-13 Thread Jeff 'japhy' Pinyan
On May 13, rmck said: while (FHOREAD) { 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 =~

CGI.pm / Upload File / delete temporary file (CGITemp****)

2004-05-13 Thread Toby Stuart
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