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
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
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
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
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
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
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
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