Thanks ALL!  I got it.

-_-Aaron

-----Original Message-----
From: Etienne Marcotte [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 13, 2001 12:25 PM
To: Aaron Shurts; [EMAIL PROTECTED]
Subject: Re: Getting rid of junk.


and while re-reading you post:

why are you using while( ($login) = $sth->fetchrow_array ())
and not while (my @row = $sth->fetchrow_array ()) ??? array is @, no?

foreach %login is a hash abnd you have login as a variable..

I think what you are looking is something like:

my $sth = $dbh->prepare(SELECT usrPass,usrInfo FROM users where usrName
LIKE ?);
$sth->execute($loginname);
while (my @userdata = $sth->fetchrow_array())
{ $userdata[0] = substr($userdata[1],3); }

#do whatever you want with the data...

Etienne

Etienne Marcotte wrote:
> 
> check out substr!
> 
> http://www.perldoc.com/perl5.6.1/pod/func/substr.html
> 
> $var= substr($var,3);
> 
> Etienne
> 
> Aaron Shurts wrote:
> >
> > I am not sure what to use in this case.
> > I am grabbing a bunch of login information from our database.  The
login
> > has 3 leading numbers.  i.e.  The value returned is:
> > 123login
> > I need to strip the 123 off and discard it.  That value is
unimportant
> > to me.  Here is my pseudo-code:
> >
> > while( ($login) = $sth->fetchrow_array ())
> > {
> >         foreach %login
> >         {
> >         get rid of the leading numbers;
> >         }
> > }
> >
> > Aaron Shurts
> >
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> 
> --
> Etienne Marcotte
> Specifications Management - Quality Control
> Imperial Tobacco Ltd. - Montreal (Qc) Canada
> 514.932.6161 x.4001
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 
Etienne Marcotte
Specifications Management - Quality Control
Imperial Tobacco Ltd. - Montreal (Qc) Canada
514.932.6161 x.4001

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to