Hi,

$foo=~  s/.*a-(.*)/\1/ ;
should work.


----- Original Message ----- From: "Chris Cappelletti" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, March 16, 2005 7:57 PM
Subject: RegExp help



I don't write regular expressions...ever...

So can someone give me a regular expression that will remove all of the
characters at the start of a string up to and including a "-" (without
quotes).

Chris Cappelletti
IT Programmer/Analyst, Sr.
TTM Technologies
Desk: 425-202-9326
Cell:  425-246-8295
[EMAIL PROTECTED]

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of $Bill
Luebkert
Sent: Wednesday, March 09, 2005 10:35 AM
To: '[EMAIL PROTECTED]'
Cc: [email protected]
Subject: Re: More time calculations

Chris Cappelletti wrote:

I don't know what database you are using, but you should make your
database eliminate all duplicate records before perl ever gets it.  For
instance using MS SQL you can use the word DISTINCT as in "select
distinct blah" which will give you one of each "blah" even if you had
more than one.  Hope that helps.

If that can't be done, a hash would probably be your best bet.



An inexperienced Perl user question, which I hope makes sense.  I am
trying to get a list of items from a database and don't want to repeat
items for viewing on the web. I have tried some regexs but no luck.  Any
thoughts?

@zoo =("family");

my %zoo = (); # or you could preload if family is a title: ('family' => 1);

while ( @row = $cursor_title->fetchrow_array)
                {
                    $title                 = $row[0];

        if ($title =~ m/@zoo/       ) # here I don't know what to insert
          {

if ($hash{$title) { print $title; } else { $hash{$title} = 1; }
          }
        else
          {
            print "$title";
          }

                    push(@zoo, "$title");

}


--
 ,-/-  __      _  _         $Bill Luebkert    Mailto:[EMAIL PROTECTED]
(_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
 / ) /--<  o // //      Castle of Medieval Myth & Magic
http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
_______________________________________________
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


_______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to