Majian wrote:
Hi ,all :
Hello,
I want to know if there is a way in which I can randomnize(?) the content in
an array.
In this example :
my @array = ('uriel', 'daniel', 'joel', 'samuel');
Now what I want is create a process so every time I print the array it
prints one element from the arr
On Tue, 03 Nov 2009 17:48:55 +1000, Thomas Bätzler
wrote:
Dave Tang asked:
Just a quick question, how does Perl interpret something like
$array[0.7995038473872]?
Just like $array[ int(0.7995038473872) ], i.e. the floating point number
is coerced into an integer value by cutting off the
2009/11/3 John W. Krahn :
> Majian wrote:
>> my @array = ('uriel', 'daniel', 'joel', 'samuel');
>>
>> Now what I want is create a process so every time I print the array it
>> prints one element from the array .
>>
>> I wrote it like this :
>>
>> #!/usr/bin/perl -w
>>
>> use strict;
>
> use List::
On Mon, Nov 2, 2009 at 7:41 PM, Remy Guo wrote:
> hi folks,
> i've got problem when trying to perform a substitution.
>
> the text file i want to process is like this:
> ...
> XX {
> ABDADADGA
> afj*DHFHH
> } (a123)
> XXDFAAF {
> af2hwefh
> fauufui
> } (b332)
> ...
>
> i want to match the
On Tue, Nov 3, 2009 at 12:11 AM, Majian wrote:
> Hi ,all :
>
> I want to know if there is a way in which I can randomnize(?) the content
> in
> an array.
>
> In this example :
>
> my @array = ('uriel', 'daniel', 'joel', 'samuel');
>
> Now what I want is create a process so every time I print the
Thanks all .
But I found an another question :
If I wrote this script like this :
#!/usr/bin/perl
while (){
@lines = $_;
print "$lines[rand @lines]";
}
__DATA__
uriel
daniel
joel
samue
It would not display the random element of the array
Why ?
Or if I want to display the random element of t
Philip Potter wrote:
2009/11/3 John W. Krahn :
Majian wrote:
my @array = ('uriel', 'daniel', 'joel', 'samuel');
Now what I want is create a process so every time I print the array it
prints one element from the array .
I wrote it like this :
#!/usr/bin/perl -w
use strict;
use List::Util '
Majian wrote:
Thanks all .
Hello,
But I found an another question :
If I wrote this script like this :
#!/usr/bin/perl
use warnings;
use strict;
while (){
@lines = $_;
You are assigning one scalar value to the whole array the array will
only ever have one element in it.
You need to
tom smith wrote:
On Mon, Nov 2, 2009 at 7:41 PM, Remy Guo wrote:
i've got problem when trying to perform a substitution.
the text file i want to process is like this:
...
XX {
ABDADADGA
afj*DHFHH
} (a123)
XXDFAAF {
af2hwefh
fauufui
} (b332)
...
i want to match the content in the paren
Hi ,all:
When I test the increment operator in Perl and find a question :
The question is :
#!/usr/bin/perl
use warnings;
my $i = 1;
print ++$i + ++$i, "\n";
The above code prints out the answer 6 .
But in the other language the anser is 5 ,
So I don't understand the reason why it is
2009/11/3 Majian :
>
> my $i = 1;
> print ++$i + ++$i, "\n";
>
> The above code prints out the answer 6 .
> But in the other language the anser is 5 ,
>
>From the documentation
(http://perldoc.perl.org/perlop.html#Auto-increment-and-Auto-decrement):
"Note that just as in C, Perl doesn't defi
2009/11/3 Majian :
> Hi ,all:
>
> When I test the increment operator in Perl and find a question :
>
> The question is :
> #!/usr/bin/perl
> use warnings;
>
> my $i = 1;
> print ++$i + ++$i, "\n";
>
> The above code prints out the answer 6 .
> But in the other language the anser is 5 ,
>
>
On Tue, Nov 03, 2009 at 07:15:43PM +0800, Majian wrote:
> Hi ,all:
Hello,
> When I test the increment operator in Perl and find a question :
>
> The question is :
> #!/usr/bin/perl
> use warnings;
>
> my $i = 1;
> print ++$i + ++$i, "\n";
>
> The above code prints out the answer 6 .
>
Majian wrote:
Hi ,all:
Hello,
When I test the increment operator in Perl and find a question :
The question is :
#!/usr/bin/perl
use warnings;
my $i = 1;
print ++$i + ++$i, "\n";
The above code prints out the answer 6 .
But in the other language the anser is 5 ,
And the lesson t
On Oct 27, 1:52 pm, aim...@sfbrgenetics.org (Aimee Cardenas) wrote:
> Hi, All!
>
> I need to fix the width of some strings padding with leading spaces if
> necessary. I wanted to use printf but I don't know if you can put a
> variable in the format part the the printf statement. For example,
On Nov 2, 9:54 am, brentgclarkl...@gmail.com (Brent Clark) wrote:
> Hiya
>
> I was hoping that someone would be kind to help me.
>
> I have a string like so :
>
> Haresources : 10.203.4.5, Interfaces : 10.203.4.5 10.203.4.7
>
> Im trying to get the ip's after Interfaces into an array, but for the
>
Thanks a lot.
>>> "Hack, Gabi (ext)" 11/3/2009 1:35 AM >>>
hi bruce,
warn throws a warning message on STDERR. see
perldoc -f warn
warn LIST
Produces a message on STDERR just like "die", but doesn't exit
or throw an excep-
tion.
If LIST is
Hello,
I subscribed to perl.beginners via Google groups but none of my posts
get through
Can you help or suggest what might be amiss?
--
Charles DeRykus
Although I've used perl for many years, I've just been surprised (in the
unpleasant sense) by a recent event. Given a variable, say "$int",
which is a growing integer, I would expect "print $int" to print it as a
simple integer; indeed it usually does so. But when its size takes it
from 15 de
tom smith wrote:
On Tue, Nov 3, 2009 at 4:33 PM, tom smith wrote:
Thanks for the tips! More comments below.
I saw it written the other way somewhere, and I thought it looked cleaner.
I'll do it your way from now on.
if ($line =~ /\((.*?)\)/) {
$line =~ s/$1/$i;$j/;
If you hav
> "DT" == Dave Tang writes:
DT> On Tue, 03 Nov 2009 17:48:55 +1000, Thomas Bätzler
DT> wrote:
>> Dave Tang asked:
>>> Just a quick question, how does Perl interpret something like
>>> $array[0.7995038473872]?
>>
>> Just like $array[ int(0.7995038473872) ], i.e. the floating
Thanks for the tips! More comments below.
On Tue, Nov 3, 2009 at 4:10 AM, John W. Krahn wrote:
> tom smith wrote:
>
>> On Mon, Nov 2, 2009 at 7:41 PM, Remy Guo wrote:
>>
>> i've got problem when trying to perform a substitution.
>>>
>>> the text file i want to process is like this:
>>> ...
>>
On Tue, Nov 3, 2009 at 12:51 PM, Bob goolsby wrote:
> Um -- this one got through. What kind of error message did you
> receive from one of the posts that didn't go through?
>
>
> B
>
> On Mon, Nov 2, 2009 at 9:40 PM, Charles DeRykus wrote:
> > Hello,
> >
> > I subscribed to perl.beginners via G
2009/11/3 David Lee :
> Although I've used perl for many years, I've just been surprised (in the
> unpleasant sense) by a recent event. Given a variable, say "$int", which is
> a growing integer, I would expect "print $int" to print it as a simple
> integer; indeed it usually does so. But when it
Brent Clark wrote:
Hiya
Hello,
I was hoping that someone would be kind to help me.
I have a string like so :
Haresources : 10.203.4.5, Interfaces : 10.203.4.5 10.203.4.7
Im trying to get the ip's after Interfaces into an array, but for the
likes of me, im just not getting it right. This i
Um -- this one got through. What kind of error message did you
receive from one of the posts that didn't go through?
B
On Mon, Nov 2, 2009 at 9:40 PM, Charles DeRykus wrote:
> Hello,
>
> I subscribed to perl.beginners via Google groups but none of my posts
> get through
>
> Can you help or
On Mon, Nov 2, 2009 at 3:47 PM, Jeremiah Foster wrote:
>
> On Nov 2, 2009, at 20:38, tom smith wrote:
>
> On Mon, Nov 2, 2009 at 8:02 AM, Peter Scott wrote:
>>
>> On Mon, 02 Nov 2009 04:25:18 -0700, Tom Smith wrote:
>>>
>>> I believe that your HTML::Parser needs upgrading. But you're getting
John W. Krahn wrote:
Brent Clark wrote:
I was hoping that someone would be kind to help me.
I have a string like so :
Haresources : 10.203.4.5, Interfaces : 10.203.4.5 10.203.4.7
Im trying to get the ip's after Interfaces into an array, but for the
likes of me, im just not getting it right.
On Tue, Nov 3, 2009 at 4:33 PM, tom smith wrote:
> Thanks for the tips! More comments below.
> I saw it written the other way somewhere, and I thought it looked cleaner.
> I'll do it your way from now on.
>
>
>>
>> if ($line =~ /\((.*?)\)/) {
>>>
>>>$line =~ s/$1/$i;$j/;
>>>
>>
>> If
Hello,
I have a requirement to add drivers for mysql and mssql for a couple
RH 5.x intel boxes as non-root.
DBM and DBI are already installed.
perl is 64-bit and version 5.8.8 and has been installed as root.
Also there is no Internet access so cpan -e is not possible.
So I wonder if someone could
Hi All,
I want to create few threads and want to share objects of class between
threads. Although there is a package Thread::Queue but it only allows
sharing of scalar data.
I tried sending data as a reference parameter to thread but seems like it is
passed as value to thread function. Here is an
31 matches
Mail list logo