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