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
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
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
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
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
Hello all,
Someone try this module on Windows Workstations?
It is not in the PPM , so I try to install it manually.
Regards
OXx
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
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
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,
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
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
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
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
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
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
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
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
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
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')){
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
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
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
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
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
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
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
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
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
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).
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]
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
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:
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
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,
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
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
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'
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.
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
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
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.
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";
}
[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.??
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
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
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
46 matches
Mail list logo