[EMAIL PROTECTED]
To: [EMAIL PROTECTED]
cc:
Subject:Using qw() on data from database.
I'm using.
while(($nums) = $sth->fetchrow_array) {
print $nums;
}
This will give me "01 02 03 04"
I want to push this into an array.
push @nums, $nums;
But I want the result
I think what you want is
push @nums, qw($nums);
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 16, 2002 12:15 PM
> To: [EMAIL PROTECTED]
> Subject: Using qw(....) on data from database.
>
>
> I'm usi
At 18:28 2002-05-16 +0200, Johan Lindstrom wrote:
>If you only want numbers:
>push(@nums, split(/\D+/, $nums);
Add a ) for syntactic completeness :)
/J
-- --- -- -- -- -- - - -
Johan LindströmSourcerer @ Boss Casinos [EMAIL PROTECTED]
Latest bo
At 12:14 2002-05-16 -0400, [EMAIL PROTECTED] wrote:
>This will give me "01 02 03 04"
>
>I want to push this into an array.
>
>push @nums, $nums;
If you only want numbers:
push(@nums, split(/\D+/, $nums);
i.e. split on one or more chars that are not numbers (\d is "any number",
\D is the opposite
I'm using.
while(($nums) = $sth->fetchrow_array) {
print $nums;
}
This will give me "01 02 03 04"
I want to push this into an array.
push @nums, $nums;
But I want the result of
@nums = qw(01 02 03 04);
The same as:
@nums = ('01', '02', '03', '04');
How do I get this? I have tried "and I k