RE: Escaping a plus sign

2006-05-31 Thread Ken Lehman
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-

Can I set '$!' ?

2003-12-16 Thread Ken Lehman
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

HOWTO:Dynamically getting all of the global variables and their v alues

2003-07-01 Thread Ken Lehman
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

hex to dec and dec to hex

2003-06-11 Thread Ken Lehman
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

RE: Javascript and Perl Problem

2003-05-31 Thread Ken Lehman
One issue I ran into was using Here document without single quotes print EOJS and perl was trying to interpret things in my javascript. Saying print 'EOJS' fixed it, perl trying to interpret things may also be the problem if you are using print statements. -Ken -Original Message-

RE: warning message

2003-04-02 Thread Ken Lehman
looks like you tried to call the sub before you defined it, try putting a definition just below all the use statements or just move the whole sub up there -Ken -Original Message- From: Christopher G Tantalo [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 02, 2003 3:43 PM To: [EMAIL

howto: open/create a file as executable

2003-03-28 Thread Ken Lehman
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

RE: Formatting Variables.

2003-02-11 Thread Ken Lehman
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

How do I test a variable to see if it is a scalar or a hash?

2003-01-23 Thread Ken Lehman
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

RE: Perl book

2003-01-15 Thread Ken Lehman
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

RE: Cgi Win xp Perl

2003-01-07 Thread Ken Lehman
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]] Sent:

RE: Cgi Win xp Perl

2003-01-07 Thread Ken Lehman
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 how associate .cgi

catch kill -9 from unix command prompt

2002-12-17 Thread Ken Lehman
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

RE: include .pl in html

2002-12-11 Thread Ken Lehman
This works where I am at, you could give it a try !--#exec cmd=./my_perl_script_here.pl-- -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

HOWTO use system call on windows with a space in the path

2002-12-11 Thread Ken Lehman
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

does perl have boolean variables?

2002-12-04 Thread Ken Lehman
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

howto: array index inside a foreach loop

2002-11-22 Thread Ken Lehman
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?

RE: howto: array index inside a foreach loop

2002-11-22 Thread Ken Lehman
]] 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 get a match