Re: problems parsing a DHCP.leases file.

2006-02-27 Thread Jeff Pang
Hi, here is wrong: elsif ($line =~ /^client-hostname/) { $hostname = $1; } for the line like that: client-hostname HOST1; I think maybe you should do: elsif ($line =~ /^\s*client-hostname\s+\(.*?)\){ $hostname = $1;} HTH. -- Jeff Pang NetEase AntiSpam Team

Re: problems parsing a DHCP.leases file.

2006-02-27 Thread The Ghost
you need to match something. You probably meant: elsif ($line =~ /^client-hostname\s+([a-z0-9\-\.]+)/i) { On the other hand, there is probably a module that already deals with this and would save you even more coding time. Ryan On Feb 27, 2006, at 1:25 AM, Angus wrote: elsif ($line

RE: problems parsing a DHCP.leases file.

2006-02-27 Thread Angus
Ryan, Thanks for the tip however, in this case what I am trying to do (I think) is find a line that starts with client-hostname then match my variable $hostname to the second thing that the regex matches in that line $1. It works for the ip address but fails for the hostname. I did try to regex

Re: problems parsing a DHCP.leases file.

2006-02-27 Thread The Ghost
When I change to : ... elsif ($line =~ /^\s+?client-hostname\s+([a-z0-9\-\.]+)/i) { ... I found IP:10.10.97.207 I found Hostname: I found IP:10.10.97.207 I found Hostname: HOST1 Seems you have some space there. Also, you probably want to move your my $hostname and my $ip statements. If a

Re: problems parsing a DHCP.leases file.

2006-02-27 Thread Hans Meier (John Doe)
Angus am Montag, 27. Februar 2006 08.25: Hi all, I am having some problems filling a variable based on the contents of a dhcpd.leases file. All I want at this time is the hostname and ip address. My eventual goal is to create hash of hashes with this information but for now I just want to

Net::ARP On Windows

2006-02-27 Thread OXx
Hello all, Someone try this module on Windows Workstations? It is not in the PPM , so I try to install it manually. Regards OXx

cant process string in system()

2006-02-27 Thread Brent Clark
Hey all Im trying to run the following system ('fetchmail -f '.$fetchmailconf.' -a -k -r \'.$folderitem.'\'); What im getting is: Processing INBOX.Astro Computers : for [EMAIL PROTECTED]: - this is wrong, must be INBOX.Astro Computers My code is as so: foreach my $folderitem

survive with exec

2006-02-27 Thread a b
Hello , i want to execute some batch/perl file from my perl program and continue to do some changes and then re-execute some files. my code is like st.pl - exec (wperl hang.pl a.txt); exec (wperl hang.pl b.txt); exec (wperl hang.pl c.txt); hang.pl - #!/usr/bin/perl

Re: survive with exec

2006-02-27 Thread Bob Showalter
a b wrote: Here i want to execute one and then execute another but don't wait for previous command i.e.something in background but im unable to do it. see: perldoc -q 'How do I start a process in the background?' -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: survive with exec

2006-02-27 Thread Jeff Pang
exec (wperl hang.pl a.txt); exec (wperl hang.pl b.txt); exec (wperl hang.pl c.txt); hi, here I think you could fork the childs,and call the 'exec' in childs,it should be good for your purpose. for example, for (my $i=0;$i3;$i++){ my $child = fork();die can't fork $! unless defined

Re: survive with exec

2006-02-27 Thread Jeff Pang
exec (wperl hang.pl a.txt); exec (wperl hang.pl b.txt); exec (wperl hang.pl c.txt); and,I'm a little strange here. if your first 'exec' is executed successfully,the main script process should be replaced with the exec call.In other words,the executing of 'wperl hang.pl a.txt' should replace

Re: cant process string in system()

2006-02-27 Thread Chas Owens
On 2/27/06, Brent Clark [EMAIL PROTECTED] wrote: snip Basically what happening is, when I pass the variable to system() the spaces are not escaped etc, and therefore fetchmail only processing only half the string. If anyone knows how I can achieve in processing the string as is, would be most

error messege: subroutine Cwd::fastcwd redefined

2006-02-27 Thread Frank Lee
When I add use Bio:Perl in my script and run it in windows XP, it complains: subroutine Cwd::fastcwd redefined at C:/per/lib/Cwd.pm line 700 subroutine Cwd::getcwd redefined at C:/per/lib/Cwd.pm line 700 subroutine Cwd::abs_path redefined at C:/per/lib/Cwd.pm line 700 The script can still

Re: Net::ARP On Windows

2006-02-27 Thread Chas Owens
On 2/27/06, OXx [EMAIL PROTECTED] wrote: Hello all, Someone try this module on Windows Workstations? It is not in the PPM , so I try to install it manually. Regards OXx Unfortunatly for you that module contains C code. It will have to be compiled. If you have an account with

Re: error messege: subroutine Cwd::fastcwd redefined

2006-02-27 Thread Chas Owens
On 2/27/06, Frank Lee [EMAIL PROTECTED] wrote: When I add use Bio:Perl in my script and run it in windows XP, it complains: subroutine Cwd::fastcwd redefined at C:/per/lib/Cwd.pm line 700 subroutine Cwd::getcwd redefined at C:/per/lib/Cwd.pm line 700 subroutine Cwd::abs_path redefined at

Perl for Perforce (P4)

2006-02-27 Thread SCM Linux
Up to now I've been using CVS for source control. There's a plethora of Perl scripts out there for CVS (extended acces control and etc.) that I love to use, but now that I'm learning P4 at my current company, I'm looking to extend existing P4 functionality the same way. Maybe I'm not looking

Re: Perl for Perforce (P4)

2006-02-27 Thread Tom Phoenix
On 2/26/06, SCM Linux [EMAIL PROTECTED] wrote: Up to now I've been using CVS for source control. There's a plethora of Perl scripts out there for CVS (extended acces control and etc.) that I love to use, but now that I'm learning P4 at my current company, I'm looking to extend existing P4

Help with creating http links

2006-02-27 Thread anu p
Hi, I have a script which runs a regression and generates a log of failed tests. Eg: Test: dir1/test1.v failed My manager wants me to create a link to the file, so that if we click on the link the actual log pops up in a browser. I know the path to open the test in a browser, it's like

replacing multiple elsif statements question

2006-02-27 Thread Graeme McLaren
Afternoon all, I want to change some repetitive code so its more dynamic, basiaclly I want to replace the elsif statements below with one statement which gets the number dynamically so I only need one if statement. Any ideas? Something like this: elsif ($q-param('delete_aoc1.x')){

Re: replacing multiple elsif statements question

2006-02-27 Thread Tom Phoenix
On 2/27/06, Graeme McLaren [EMAIL PROTECTED] wrote: elsif ($q-param(delete_aoc$number.x)){ return Delete AOC $number; You could do this sort of thing in a loop, such as a 'foreach' loop. Have you tried writing it that way? Of course, you still have to call the 'param' method once each

Re: Help with creating http links

2006-02-27 Thread Chas Owens
On 2/27/06, anu p [EMAIL PROTECTED] wrote: Hi, I have a script which runs a regression and generates a log of failed tests. Eg: Test: dir1/test1.v failed My manager wants me to create a link to the file, so that if we click on the link the actual log pops up in a browser. I know

Re: replacing multiple elsif statements question

2006-02-27 Thread Chas Owens
On 2/27/06, Graeme McLaren [EMAIL PROTECTED] wrote: Afternoon all, I want to change some repetitive code so its more dynamic, basiaclly I want to replace the elsif statements below with one statement which gets the number dynamically so I only need one if statement. Any ideas? snip A lot

SQLite 3

2006-02-27 Thread Octavian Rasnita
Hi, Is there a perl module for SQLite3? Thanks. Teddy -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: SQLite 3

2006-02-27 Thread Tom Phoenix
On 2/27/06, Octavian Rasnita [EMAIL PROTECTED] wrote: Is there a perl module for SQLite3? Have you looked on CPAN? http://search.cpan.org/search?query=SQLite3mode=all Hope this helps! --Tom Phoenix Stonehenge Perl Training -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: SQLite 3

2006-02-27 Thread Octavian Rasnita
From: Tom Phoenix [EMAIL PROTECTED] Is there a perl module for SQLite3? Have you looked on CPAN? Yes I did but I have found only DBD::SQLite and DBD::SQLite2, so I thought that there should be DBD::SQLite3, but now I have seen that DBD::SQLite can access SQLite3 databases. (I have tried only

Re: SQLite 3

2006-02-27 Thread David Kaufman
Tom Phoenix [EMAIL PROTECTED] wrote: On 2/27/06, Octavian Rasnita [EMAIL PROTECTED] wrote: Is there a perl module for SQLite3? Have you looked on CPAN? http://search.cpan.org/search?query=SQLite3mode=all Hope this helps! Also, the SQLite DBD driver for DBI (available as

mailing labels

2006-02-27 Thread The Ghost
I need to print some mailing labels and include an image of a barcode on the label. I'd like some suggestions on modules to use, I've never used perl to print anything before. (Creating a PDF or something in the right way would be fine too). Thanks! -- To unsubscribe, e-mail: [EMAIL

Need to improve throughput - Any thoughts

2006-02-27 Thread Gladstone Daniel - dglads
I have a text file with around 1 million lines and I need to do a search And replace on over 9000 words. I am currently reading a line and passing A hash table against it and any matches it is replacing the word in the string. It is running real slow. Any thoughts on how to improve it? Daniel

Re: mailing labels

2006-02-27 Thread Chas Owens
On 2/27/06, The Ghost [EMAIL PROTECTED] wrote: I need to print some mailing labels and include an image of a barcode on the label. I'd like some suggestions on modules to use, I've never used perl to print anything before. (Creating a PDF or something in the right way would be fine too).

Re: mailing labels

2006-02-27 Thread The Ghost
I looked around on CPAN. I'm already using GD::Barcode to create the barcode, I'm more concerned about the formatting to get the labels printed correctly. I'll look at PDFLib some more. Thanks! Ryan On Feb 27, 2006, at 2:46 PM, Chas Owens wrote: On 2/27/06, The Ghost [EMAIL PROTECTED]

Re: mailing labels

2006-02-27 Thread Chas Owens
On 2/27/06, The Ghost [EMAIL PROTECTED] wrote: I looked around on CPAN. I'm already using GD::Barcode to create the barcode, I'm more concerned about the formatting to get the labels printed correctly. I'll look at PDFLib some more. Thanks! Ryan snip If the barcode is supposed to be the

RE: Need to improve throughput - Any thoughts

2006-02-27 Thread Timothy Johnson
Since you haven't provided any code, it would be difficult. Here are some thoughts: * Make sure you're doing a while(INFILE){ instead of @array = INFILE * Try precompiling your regular expressions. (see qr// in perlop under Quote and Quote-like Operators) -Original Message- From:

RE: num to alpha

2006-02-27 Thread Timothy Johnson
Just for the sake of one more way to do it: ### use strict; use warnings; my %numbers; my $letter = 'a'; my $userinput = 23; foreach(1..26){ $numbers{$_} = $letter; $letter++; } if(defined($numbers{$userinput})){ print It's good!\n; }else{ print Invalid

RE: survive with exec

2006-02-27 Thread Timothy Johnson
What operating system are you running, and how important is the return code to you? If you are using Windows, for example, you can use the start or call commands along with system() to spawn a process and immediately return. The only problem is that you won't be able to check the return code,

Re: replacing multiple elsif statements question

2006-02-27 Thread Jeff Pang
elsif ($q-param(delete_aoc$number.x)){ return Delete AOC $number; } I'm not so sure,is it right for you? elsif ($q-param(eval delete_aoc$number.x)){ return Delete AOC $number; } I just tested under my environment,it could work. -- Jeff Pang NetEase AntiSpam Team

RE: num to alpha

2006-02-27 Thread Keenan, Greg John (Greg)** CTR **
my %convert = qw[ 1 a 2 b 3 c 4 d 5 e 6 f 7 g 8 h 9 i 10 j 11 k 12 l 13 m 14 n 15 o 16 p 17 q 18 r 19 s 20 t 21 u 22 v 23 w 24 x 25 y 26 z ]; Hi, I know John Krahn is a fan of %map. He has advised me on using it before. Just wondering if there was any reason he chose to use %convert instead

Re: num to alpha

2006-02-27 Thread John W. Krahn
Timothy Johnson wrote: Just for the sake of one more way to do it: ### use strict; use warnings; my %numbers; my $letter = 'a'; my $userinput = 23; foreach(1..26){ $numbers{$_} = $letter; $letter++; } Or: my %numbers; @numbers{ 1 .. 26 } = 'a'

Re: replacing multiple elsif statements question

2006-02-27 Thread John W. Krahn
Jeff Pang wrote: elsif ($q-param(delete_aoc$number.x)){ return Delete AOC $number; } I'm not so sure,is it right for you? elsif ($q-param(eval delete_aoc$number.x)){ eval() runs _Perl_ code. delete_aoc$number.x is NOT Perl code so you shouldn't use eval() on it.

Re: num to alpha

2006-02-27 Thread John W. Krahn
Keenan, Greg John (Greg)** CTR ** wrote: my %convert = qw[ 1 a 2 b 3 c 4 d 5 e 6 f 7 g 8 h 9 i 10 j 11 k 12 l 13 m 14 n 15 o 16 p 17 q 18 r 19 s 20 t 21 u 22 v 23 w 24 x 25 y 26 z ]; Hi, Hello, I know John Krahn is a fan of %map. I am? He has advised me on using it before. Just

RE: num to alpha

2006-02-27 Thread Keenan, Greg John (Greg)** CTR **
I know John Krahn is a fan of %map. I am? He has advised me on using it before. Just wondering if there was any reason he chose to use %convert instead in his example above. %map and %convert are just hash names, you can use any name that you want. Sorry - my mistake. Still trying to

Re: num to alpha

2006-02-27 Thread John W. Krahn
Keenan, Greg John (Greg)** CTR ** wrote: I know John Krahn is a fan of %map. I am? He has advised me on using it before. Just wondering if there was any reason he chose to use %convert instead in his example above. %map and %convert are just hash names, you can use any name that you want.

the way to get current index of an array

2006-02-27 Thread zhao_bingfeng
hi, perlers, Is there a simple way to get the current index of an array in loop statement? the procondition is you cannot get this information from array element. For example #!usr/bin/perl my @arr = qw/a b c d e/; for(@arr) { print "The No.?? element is $_\n"; }

Re: the way to get current index of an array

2006-02-27 Thread John W. Krahn
[EMAIL PROTECTED] wrote: hi, perlers, Hello, Is there a simple way to get the current index of an array in loop statement? the procondition is you cannot get this information from array element. For example #!usr/bin/perl my @arr = qw/a b c d e/; for(@arr) { print The No.??

Re: survive with exec

2006-02-27 Thread a b
Hello, The Os was windows and use of start along with system is working fine. Thanks Regards a b On 2/28/06, Timothy Johnson [EMAIL PROTECTED] wrote: What operating system are you running, and how important is the return code to you? If you are using Windows, for example, you can use the

PDF::API2

2006-02-27 Thread The Ghost
Does anyone know how to use the barcoding of PDF::API2? The documentation is lacking. Ryan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: PDF::API2

2006-02-27 Thread Owen Cook
On Tue, 28 Feb 2006, The Ghost wrote: Does anyone know how to use the barcoding of PDF::API2? The documentation is lacking. Place 'PDF API2 documentation barcoding' into Google and it may give you some more clues. Owen -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional