You can do something like :
$out =~ m/(^.*Name\:.*$)/xo $name = $1;
or
if ($out =~ m/Name\:/xo)
{
$name = $out;
}
---
Legendo metulas imitabere cancrum
Olivier GĂ©rault
___
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe:
You don't need the 'x' option (white space used in RE for comments) or the
'o' option (compile it - this is used when there is a variable in the RE,
e.g.
$name = Name:
while () {
if ( /$name/o ) {
the colon (:) is not a special char and does not need an escape slash.
The '1' you get now is
Title: RE: Daemon example
win32::daemon::simple required you to be able to use win32::daemon as well... daemon has to be installed as a package =(
-Original Message-
From: Jenda Krynicky [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 29, 2003 10:25 AM
To: FARRINGTON, RYAN
Cc:
From: FARRINGTON, RYAN [EMAIL PROTECTED]
win32::daemon::simple required you to be able to use win32::daemon as
well... daemon has to be installed as a package =(
Oh well ... I did NOT ask you to install Win32::Daemon::Simple !
What do you get if you run
ppm install
But does someone have a proposal how to capture the STDERR output of the
batch script, too?
Up to now, I only could capture the STDOUT output via
@Result=`command line`
and I would like to capture both, ideally in the same array to get the
correct order...
Kind regards
Ekbert Mertens
Hi
It's a bit hard to understand your real question. But here's
a go at it anyway.
If you want to grab the whole lines that have Name: in it:
# Note the use of an array here.
@out = `c:/tmp/test.cmd /i $c`;
@names = grep( /Name:/, @out );
print for @names;
If you want to get the names and
But does someone have a proposal how to capture the STDERR
output of the batch script, too? Up to now, I only could
capture the STDOUT output via
@Result=`command line`
and I would like to capture both, ideally in the same array
to get the correct order...
Kind regards
Ekbert
Title: RE: Daemon example
ARG!!! WTF... why does that work and installing it from www.roth.net doesn't =(
-Original Message-
From: Jenda Krynicky [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 29, 2003 11:00 AM
To: [EMAIL PROTECTED]
Subject: RE: Daemon example
From:
Title: RE: Daemon example
now I get:
Can't locate loadable object for module Win32::Daemon in @INC (@INC contains: d:
/perl/lib d:/perl/site/lib .) at xml_service.pl line 13
ARG... oh well... I'll work it off 5.6 and forget the threading stuff I'm trying to learn =)
-Original
From: FARRINGTON, RYAN [EMAIL PROTECTED]
ARG!!! WTF... why does that work and installing it from www.roth.net
doesn't =(
Because Dave did not compile the module for Perl 5.8 yet. I compiled
the module myself. I did send him the DLL and the files I changed so
I think he will add the 5.8
Hi,
Given a number of days, it is expected to determine the real date from Jan
1, 1970.
The real date should be in the following format: Year-Month-Day.
How do I implement this task using Perl.
For example, write a Perl script to convert 12016 days to its real date from
Jan 1, 1970.
Regards,
perl -e '$days=12016; $seconds=$days*86400; print localtime($seconds) . \n'
Sun Nov 24 16:00:00 2002
HTH,
- Mark
On Wed, 29 Jan 2003, Kenneth Jideofor [ MTN - Ikoyi ] wrote:
Date: Wed, 29 Jan 2003 19:57:10 +0100
From: Kenneth Jideofor [ MTN - Ikoyi ] [EMAIL PROTECTED]
To: [EMAIL
Kenneth Jideofor \[ MTN - Ikoyi \] writes:
Hi,
Given a number of days, it is expected to determine the real date from Jan
1, 1970.
The real date should be in the following format: Year-Month-Day.
How do I implement this task using Perl.
For example, write a Perl script to
Hi all,
I have file whose content is arranged in rows of two lines, each row-pair
separated from the next by a line-space.
I want to rearrange the file in a two-column format such that all the
entries in the first rows in a pair are put in the first column while their
corresponding second rows
Hello Kenneth,
Wednesday, January 29, 2003 you wrote:
KJM Given the content of a file as:
KJM
KJM
KJM
KJM
KJM
KJM
KJM I want it rearranged in the following format using Perl:
KJM
KJM
KJM
one way:
open(FIN, $fpin) or die no
my $cnt = 1;
while (DATA) {
next unless /\w/;
s/\n/\t\t/ if ($cnt++ % 2);
print;
}
__DATA__
More homework?
a
Andy Bach, Sys. Mangler
Internet: [EMAIL PROTECTED]
VOICE: (608) 261-5738 FAX 264-5030
... even if you're mediocre/decent at perl [the cmecf]
16 matches
Mail list logo