Simplest solution... He's testing for string EQUALITY when he should be using a regex:
$description =~ /^ST:/;
That's what he needs, if he's doing the matching in Perl.
Deane Rothenmaier
Systems Architect
Walgreens Corp.
847-914-5150
"Truth is eternal, knowledge is changeable. It is disastrous to confuse them." -- Madeleine L'Engle
| "Roode, Eric" <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED] 09/19/2006 08:32 AM
|
To: <[email protected]> cc: Subject: RE: Query in Perl |
It depends on whether you want to do the comparison in Perl or in the database.
If in Perl, it depends on whether you want to do it in the main code, in a library, read from a config file, etc.
If in the database, it depends on which database product you're using and what interface you're using.
Eric J. Roode
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Swaminathan Vijay-A20615
Sent: Tuesday, September 19, 2006 9:20 AM
To: [email protected]
Subject: Query in Perl
Hi All,
I'm running a Perl statement to fetch some data from a database.
Lets assume that I want to pull out some data whose description starts with "ST:"
I'm passing description as one of my parameter in my Perl code. I want to assign a value to the description such that It pulls out all the data starting with "ST:"
I tried using the following:
$description == 'ST:' but it was looking for the exact text.
I tried using some wildcards but it did not support.
can any one help me with a code to find out to pull all the rows whose description starts with ST:?
Thanks for your help.
- Vijay Swaminathan
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
