RE: [Perl-unix-users] extract the last character or a string

2002-04-11 Thread david . b . deline
Kwabena, Here is an example of how to pull off the last character of a string and print it. You could also store the value returned by the substr function into a variable... $dir='d:/abs/fez'; print substr($dir, length($dir)-1) . "\n"; Here is an example of checking the last character of a strin

RE: [Perl-unix-users] Please help on GREP command

2002-02-18 Thread david . b . deline
Sorry All... The 'die' command should have read: die "ERROR: Problem executing grep, ($!), stopped" if ( $? == 2 ); grep return codes: 0=Found Match; 1=No Match Found; 2=Error. Dave. -Original Message- From: Deline, David B. Sent: Monday, February 18, 2002 3:08 PM To: 'ba2984' C

RE: [Perl-unix-users] Please help on GREP command

2002-02-18 Thread david . b . deline
The back-tics will automatically execute the grep command. So, $var=`grep -E -i -c "abc|xyz|pqr" test.txt`; will execute the grep command just like from the shell command line. The output from the grep command will be captured in $var. You can check the value of $? for the return value from

RE: [Perl-unix-users] Please help on GREP command

2002-02-18 Thread david . b . deline
Is that the exact line...? Try: $var=`grep -E -i -c "abc|xyz|pqr" test.txt`; Remember to put your shell commands in back-tics... Dave. -Original Message- From: ba2984 [mailto:[EMAIL PROTECTED]] Sent: Monday, February 18, 2002 1:23 PM To: perl-unix-users Subject: [Perl-unix-users] Please

RE: [Perl-unix-users] (no subject)

2001-11-01 Thread david . b . deline
Look into DBM files. I've created a process that is similar to yours (parent process forks child processes) and they are all daemons. I used a DBM file to communicate between them. The only draw back was you will have to implement a file locking schema to prevent corrupting your DBM file. Regar

[Perl-unix-users] DBM functionality via tie & untie

2001-10-03 Thread david . b . deline
I'm using 'tie' & 'untie' in manipulating DBM files for IPC (Inter-Process Communication). I know I have to implement a 'locking' strategy to ensure not to corrupt my DBM files. 1) If I 'tie' to the same DBM file in each of my processes do I ever need to 'tie' again with in each process...? I'm

RE: [Perl-unix-users] Frameset

2001-09-27 Thread david . b . deline
Jeb, I sounds like you should be able to incorporate the "HIDDEN" object/variable method I mentioned in my previous email. I use this technique all of the time to ensure I "keep my data around" between submissions... Example: #!/usr/bin/perl use strict; use CGI qw(:sta

RE: [Perl-unix-users] Frameset

2001-09-27 Thread david . b . deline
Well Jeb, (If I understand your question correctly...) You can accomplish this by imbedding JavaScript in your query & response HTML. You will need to have named FORMs in each of your FRAMEs to use the following JavaScript examples: Say you have a text object in your query frame. You can update