Is it the if ($MGMTCMNT =~ /$MGMTNM/) part that is tripping you up? I
believe you could change it to if ($MGMTCMNT =~ /\Q$MGMTNM\E/) if you
need to keep the regular expression. Another idea might be to change it
to
if ( ($start = index($MGMTCMNT, "$MGMTNM (")) > 0) {
-Original Message-
Say I have a foreach loop that I used to modify elements when they match a
pattern that I am searching for, but there is one special case where I get a
match and I need the index for that element. Can I get that index or do I
have to go with a for() loop. If this can be done how would I use it?
Tha
ECTED]]
Sent: Friday, November 22, 2002 4:12 PM
To: [EMAIL PROTECTED]
Subject: Re: howto: array index inside a foreach loop
Ken Lehman wrote:
> Say I have a foreach loop that I used to modify elements when they match a
> pattern that I am searching for, but there is one special case where I ge
I can't say:
#!/yadayada/perl -w
use strict;
$seen = true;
if( $seen )
{
#whatever
}
else
{
#something different
}
I get a bareword error, I'm using perl 5.004_04. Does perl support booleans
like this, do I need to use a package?
Thanks in advance
-Ken
---
This works where I am at, you could give it a try
-Original Message-
From: Adam Wilson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 10, 2002 11:27 AM
To: [EMAIL PROTECTED]
Subject: include .pl in html
Hi,
can anyone help me, i want to include the ouput of a perl file within an
h
I would like to write a perl script for windows that in the right situation
fires off another program, the problem is I can't get it to work using
system or exec calls. The file is in the program files directory I tried
system("c:\program files\etc...") and some variations but I can't get it to
wo
Is there a way for my program to execute a few lines of code before dying
when it is sent a kill -9 from a unix shell? The book I have says no, I
don't want to ignore the signal, just some clean up.
Thanks.
-Ken
-
Try putting the -T after the -w at the top of your perl script, make sure
that your script ends in .cgi and your iis is setup to run scripts and
change
print $q->header ("text/plain");
to
print $q->header ("text/html");
-Original Message-
From: Paul Kraus [mailto:[EMAIL PROTECTED]]
S
cgi mailing list.
-Ken
-Original Message-
From: Paul Kraus [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 07, 2003 3:11 PM
To: 'Ken Lehman'; 'Perl'
Subject: RE: Cgi Win xp Perl
It still just displays the contents of my script rather then running it.
Do I need to some
Pink is first edition, blue is second edition, i think there is a third
edition out now, may as well go for the latest and greatest
-Ken
-Original Message-
From: Robbie Staufer [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 15, 2003 12:20 PM
To: [EMAIL PROTECTED]
Subject: Re: Perl boo
How do I test a variable to see what type of variable it is(scalar, array,
hash, etc...)?
What I am trying to accomplish is I have a hash and some values are scalar
data and some values are nested hashes and
I need a way to tell the difference.
Book or web site references are welcome, thanks in adv
Have you tried using printf?
-Original Message-
From: Ramón Chávez [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 9:07 AM
To: [EMAIL PROTECTED]
Subject: Formatting Variables.
Hello boys and girls.
Is there a way to give format to a Variable.
I mean, if I don't want to get
I want to be able to return a true or false value from a function in a
module and populate the $! variable with the specific errors. Is this
possible? Is there documentation on how to do this? I can find docs on how
to use $! but not how to set it. Thanks for any help
-Ken
---
Is it possible to open/create a file with open that does not exist and give
it a umask that makes it executable, say for the purpose of generating shell
scripts?
For example, say
open OUT_FILE, MAGIC_UMASK, "/scripts/new_script";
where the current umask is 2.
Is the only option to chmod the file
Is there an easy way to go back and forth between decimal and hex in perl.
I know of the hex function which solves my hex to dec problem but how about
a dec->hex function or module? I need the value which is why printf isn't
working for me.
Thanks for any help.
-Ken
---
I would like to write a function that will get all the global variables that
are declared in my script plus their values( which will all be strings if
that matters). This is what I have so far:
my ( $varName, $globValue );
while ( ($varName, $globValue) = each %main:: )
{
print "\$$varName $glo
16 matches
Mail list logo