Re: Removing Leading Zeros

2001-08-17 Thread Peter Scott
>Lightning flashed, thunder crashed and Walnut <[EMAIL PROTECTED]> >whispered: >| Why not split it into an array first: >| >| @fields =~ split(!/!, $string); >| >| $index = $fields(3); >| $value = $fields(5); > >This does not do what I think you think it does. ;-) Neither does this bit: >| @f

Re: Removing Leading Zeros

2001-08-17 Thread Stephen P. Potter
Lightning flashed, thunder crashed and Walnut <[EMAIL PROTECTED]> whispered: | Why not split it into an array first: | | @fields =~ split(!/!, $string); | | $index = $fields(3); | $value = $fields(5); This does not do what I think you think it does. ;-) This will try to call a function that is

Re: Removing Leading Zeros

2001-08-17 Thread Walnut
Why not split it into an array first: @fields =~ split(!/!, $string); $index = $fields(3); $value = $fields(5); Just remember that arrays start at an index of zero so in each case you will be asking for the field you want - 1. On Thu, 19 Apr 2001 15:40:27 +, [EMAIL PROTECTED] (Mark Martin

RE: Removing Leading Zeros

2001-04-19 Thread blowther
hat's the good thing about loosly typed languages... (I guess it's also the bad thing.) Bruce W. Lowther -Original Message- From: David M. Lloyd [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 19, 2001 8:48 AM To: Mark Martin Cc: [EMAIL PROTECTED] Subject: Re: Removing Leading

Re: Removing Leading Zeros

2001-04-19 Thread David M. Lloyd
On Thu, 19 Apr 2001, Mark Martin wrote: > Hi all, > I have sucked two substrings into two variables : > > $index = substr $_, 35, 11; > $value = substr $_, 64, 6; > > These variables may or may not have leading zero/s : > > 09/99/000999and so on. > > If they do I need to

Re: Removing Leading Zeros

2001-04-19 Thread Timothy Kimball
: I have sucked two substrings into two variables : : : $index = substr $_, 35, 11; : $value = substr $_, 64, 6; : : These variables may or may not have leading zero/s : : : 09/99/000999and so on. : : If they do I need to strip away the leading zeros. A regexp replacemen

Re: Removing Leading Zeros

2001-04-19 Thread Collin Rogowski
that's easy.    $index =~ s/^0*//;    if $index contained leading zeros they are gone, otherwise  nothing has happened.    cr  On Thu, 19 Apr 2001 15:38:09 +, Mark Martin said: > Hi all, > I have sucked two substrings into two variables : > > $index = substr $_, 35, 11; > $value = subst

Removing Leading Zeros

2001-04-19 Thread Mark Martin
Hi all, I have sucked two substrings into two variables : $index = substr $_, 35, 11; $value = substr $_, 64, 6; These variables may or may not have leading zero/s : 09/99/000999and so on. If they do I need to strip away the leading zeros. Any ideas? Mark

Removing Leading Zeros

2001-04-19 Thread Mark Martin
Hi all, I have sucked two substrings into two variables : $index = substr $_, 35, 11; $value = substr $_, 64, 6; These variables may or may not have leading zero/s : 09/99/000999and so on. If they do I need to strip away the leading zeros. Any ideas? Mark