and exits.
=back
=head1 DESCRIPTION
BThis program will read the given input file(s) and do someting
useful with the contents thereof.
=cut
--
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http
( $target, $_, 1 ) !~ /^$sparts[$_]/,
0 .. $#sparts;
return ( $mismatch_count, scalar(@sparts) );
}
sub enum {
return @{ $_[1] } unless --$_[0];
map {
my $nuc = $_;
map { $nuc . $_ } @{ $_[1] }
} enum( $_[0], $_[1] );
}
__END__
--
Regards,
Edward WIJAYA
for the plus in that case (after a =)
--
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
On Fri, 09 Dec 2005 19:46:56 +0800, Andrej Kastrin
[EMAIL PROTECTED] wrote:
but is there any solution to run it too.
ESC-X path/to/executable
or other alternative is to run it
under e-shell accessible through CTRL-C-D.
--
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail
consist up to 4 bases, i.e.
[ATCG].
--
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
).
To view the hidden string you can use this
command: cat -A filename.txt
Then in Perl you can remove them using regex:
sub remove_trailing_newline {
$_[0] =~ s/[\r\n]+\Z//;
}
Hope that helps.
--
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
Dear John,
Just small correction in the input sample.
my @ar5 = qw(GTATG-4 TGGGT-1);
should be this:
my @ar5 = qw(GTATG-4 TGGGT-7);
In short they are already ordered.
--
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
also want to extend this
to deal with AoA as an input. But with
the same concept.
Is there an efficient way to achieve it?
I truly do not know how to go about it.
Really hope to hear from you again.
--
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
to measure total memory used up
with our script.
Hope that helps.
--
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
',
'c',
'd'
]
];
--
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
('returns') for the desired
result
sub get_array{
my @array = @_;
my @result;
foreach ( 0 .. $#array-1 )
{
my $st = $array[$_+1].$array[$_];
push @result, $st;
}
return @result;
}
__END__
Thanks and hope to hear from you again.
--
Regards,
Edward
or die $!;
@lines = FH;
close FH or die $!;
foreach $i (($#lines - $n) .. $#lines) { print $lines[$i]\n;}
'
--
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first
On Mon, 04 Jul 2005 17:31:03 +0800, Tielman Koekemoer (TNE)
[EMAIL PROTECTED] wrote:
After I passed a hash ref to a subroutine, how can I see what the hash
name was? i.e.:
I don't think that's possible. Why do you need that?
--
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail
5 2 1
2 4 9 2
3 3 3 2
4 6 7 3
5 5 0 5
6 7 9 3
7 8 9 4
8 6 6 4
--
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
)
{
push @{$hash{$j}}, substr $_, $j, $sub_length;
}
}
print Dumper \%hash;
foreach my $hkey (keys %hash)
{
foreach my $i ( 0 .. $#{ $hash{$hkey} } )
{
print $hash{$hkey}[$i];
# or do some regex with it
}
}
__DATA__
ABDC
EFGH
--
Regards,
Edward WIJAYA
SINGAPORE
Dumper [EMAIL PROTECTED];
__END__
Gives:
$VAR1 = [
'12',
'1',
'12.435',
'13.66',
'34.6',
'32.1',
'32'
];
Hope that's what yo wanted.
--
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED
After second thought
This line:
my @y = grep { $_ if ($_ =~ /\d+/)} @list;
could be simplified with this:
my @y = grep { /\d+/ } split(/\s+/,$file);
Since grep { $_ if /\d+/ } wouldn't match on 0, but grep /\d+/ would.
I'm still wondering how can I do that with unpack :-(
--
Regards,
Edward WIJAYA
Charles,
On Sat, 7 May 2005 14:50:37 -0500, Charles K. Clarkson
[EMAIL PROTECTED] wrote:
plain scary. (Wait, I think _she_ wrote that module, too. Just stay
away from _her_. :)
_HE_ you mean! :-)
http://www.abigail.nl/
--
Regards,
Edward WIJAYA
Singapore
--
To unsubscribe, e-mail: [EMAIL
];
return %new_hoa;
}
__END__
Thanks so much for your time.
--
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
--- Alex Lisbaron [EMAIL PROTECTED] wrote:
How can I install this package on WIN2K?
Use PPM, like:
dos-prompt ppm
then
ppm install DFA-Simple
---
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http
)) {
$position_score{$pos} = 1;
};
};
my $total_score = 0;
for my $score (values %position_score) {
$total_score += $score;
};
return $total_score;
};
__END__
--
Edward WIJAYA
Singapore
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
, $frag, $offset) + 1;
[snip]
$offset = $idx;
Don't mean to nitpick.
Just wondering if it's possible to modify Krahn's snippet to accomodate
the overlapping cases?
yet another fans request ;-)
--
Edward WIJAYA
Singapore
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail
On Sun, 27 Mar 2005 20:28:42 +0800, Manish Sapariya [EMAIL PROTECTED]
wrote:
Hi list,
Hi
How do I know whether a given module is installed on
machine or not?
perl -MModule::Name -e 'print it is installed\n;'
or it's simpler variant
perl -MModule::Name -e1
Hth
--
Edward WIJAYA
Singapore
, -0.5395239384953e-5};
int j;
y = x = xx;
tmp= x+5.5;
tmp -= (x+0.5)*log(tmp);
ser=1.0190015;
for (j=0;j=5;j++) ser += cof[j]/++y;
return -tmp+log(2.5066282746310005*ser/x);
}
#-End of My Code--
--
Edward WIJAYA
Singapore
--
To unsubscribe, e-mail: [EMAIL PROTECTED
possibility?
--
Edward WIJAYA
Singapore
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
Hi Steven,
On Sat, 26 Mar 2005 22:08:44 +0800, Steven Schubiger
[EMAIL PROTECTED] wrote:
Try long double instead, which gives you 10 Bytes and
the format char %Lf.
Still wont' do. It still return 'inf' for N500
--
Edward WIJAYA
Singapore
--
To unsubscribe, e-mail: [EMAIL PROTECTED
, -0.5395239384953e-5};
int j;
y = x = xx;
tmp= x+5.5;
tmp -= (x+0.5)*log(tmp);
ser=1.0190015;
for (j=0;j=5;j++) ser += cof[j]/++y;
return -tmp+log(2.5066282746310005*ser/x);
}
--
Edward WIJAYA
Singapore
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail
Dear Steven,
Sorry, don't mean to nitpick.
On Sat, 26 Mar 2005 23:09:26 +0800, Steven Schubiger
[EMAIL PROTECTED] wrote:
On 26 Mar, Edward Wijaya wrote:
It's fine, as it is. Typedefs most often reside in header files,
although, they can be used in the main file without suffer.
As per your
On Tue, 15 Mar 2005 02:29:06 +0800, John W. Krahn [EMAIL PROTECTED] wrote:
Edward Wijaya wrote:
[snip]
Here is one way to do it:
my %files;
for ( @ARGV ) {
next unless /(.+)\.(?:fa|rs)$/;
push @{ $files{ $1 } }, $_;
}
for my $base ( keys %files ) {
if ( @{ $files{ $base
take all multiple files
iteratively? to give output sth like this:
data1
sum_of_elements from data1.fa and data1.rs
data2
sum_of_elements from data2.fa and data2.rs
--
Edward WIJAYA
Singapore
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http
Hi,
How can I modify the early part of code below
such that I don't have to manually key in the files this way:
perl mycode.pl data1P.fa data1R.fa data2P.fa data2R.fa etc
I.e. just by typing this will do:
perl mycode.pl
Thanks so much for your time beforehand.
--
Edward WIJAYA
Singapore
be a data14R.fa file and no
corresponding data14P.fa file?
No, there will always be a corresponding file.
i.e. *R.fa always have its *P.fa file
Will there be other files located in this directory?
Yes, but they won't be any other *R.fa *P.fa type.
Charles K. Clarkson
--
Regards,
Edward WIJAYA
.
BTW your code would have been clear, btw, if you'd said, for example:
rename $old, $new or warn rename: $!\n;
also, $new = lc $old is more readable than $new = \L$old
My suggestion is untested, it'll be nice if you let us know if it works ;-)
HtH
--
Edward WIJAYA
Singapore
--
To unsubscribe, e
/~mschwartz/OLE-Storage-0.386/tools/lhalw
Of course it's rather outated.
HtH
--
Regards,
Edward WIJAYA
Singapore
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
topic.
Thanks a lot beforehand.
--
Edward WIJAYA
Singapore
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
On Fri, 21 Jan 2005 10:47:33 +, Andrew Black
[EMAIL PROTECTED] wrote:
Is there a module to extract the real email address from a header. e.g.
Yes there is Email::Find
Why would you want to extract email addresses? Spamming?
--
Edward WIJAYA
Singapore
--
To unsubscribe, e-mail: [EMAIL
idea?
Thanks so much beforehand.
--
Edward WIJAYA
Singapore
__BEGIN__
#!/usr/bin/perl -w
use strict;
use Benchmark 'cmpthese';
my @array = qw(flow loop pool Wolf root sort tour);
#The script runs ok if I remove this 'cmpthese' snippet
cmpthese (-5, {rad = radix_sort([EMAIL PROTECTED
On Fri, 14 Jan 2005 09:47:50 -0800, John W. Krahn [EMAIL PROTECTED] wrote:
Perl has a FAQ on shuffling, have you read that yet?
perldoc -q shuffle
or
use CPAN module: List::Util
it has a built in *shuffle* function.
--
Edward WIJAYA
Singapore
--
To unsubscribe, e-mail: [EMAIL PROTECTED
] ) =~ /\0/g;
$ret }
__END__
--
Edward WIJAYA
Singapore
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
hamming_distance_string { ( $_[0] ^ $_[1] ) =~ tr/\0// }
sub hamming_distance_string { () = ( $_[0] ^ $_[1] ) =~ /\0/g }
PS: Thanks to Ted and Jenda for the response as well.
--
Edward WIJAYA
Singapore
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http
you all a very Happy and Prosperous New Year 2005!
--
Regards,
Edward WIJAYA
Singapore
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
/Plucene/lib/Plucene.pm
It is a search engine in itself.
HtH
--
Regards,
Edward WIJAYA
Singapore
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
install Module-Name
HtH
--
Regards,
Edward WIJAYA
Singapore
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
Show us some script, so we can see the problem in more
concrete ways.
--
Regards,
Edward WIJAYA
Singapore
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
?
--
Regards,
Edward WIJAYA
Singapore
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
://search.cpan.org/~barbie/Finance-Currency-Convert-XE-0.06/lib/Finance/Currency/Convert/XE.pm
OR
http://search.cpan.org/~janw/Finance-Currency-Convert-1.04/Convert.pm
--
Regards,
Edward WIJAYA
Singapore
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http
=node_link;node_id=252477
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
at CPAN's PAR module:
http://search.cpan.org/search?mode=modulequery=PAR
--
Regards,
Edward WIJAYA
Singapore
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
' ?
--
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
except the OO part).
However eventually it boils down to right tool
for right job.
Perl is for its ease of use (and many more!) and
C++ is chosen for for speed.
--
Regards,
Edward WIJAYA
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org
$_ unless ($_=~/perl/);
}
close FD;
--
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
)
Your one liner would look like:
perl -ne 'print unless /perl/' -ibak FILENAME
Glad I learnt yet another One-Liner.
--
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first
new() can take parameters as an array or a hash,
then it can do whatever it wants with the hash, values,
just like it would with array values
Please also refer to Damian Conway's Object Oriented Perl,
a very good introduction to what you are trying to achieve.
--
Regards,
Edward WIJAYA
SINGAPORE
A very good lesson to learn Schwartzian Transform.
Thanks Gunnar!
--
Regards,
Edward WIJAYA
SINGAPORE
On Sun, 28 Nov 2004 09:36:26 +0100, Gunnar Hjalmarsson [EMAIL PROTECTED]
wrote:
I have code the performs the task, but it's a Swartzian Transform, a
temporary array, another swartz transform
, unsigned, or floating
point
So I guess your best bet is to use: %f
though that doesn't give as much precision as %d/%u on some platforms/
HtH
--
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org
--
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
On Wed, 17 Nov 2004 16:35:58 +0530, Prasanna Kothari
[EMAIL PROTECTED] wrote:
try using grep function.
perldoc -f grep
Yes correct, didn't think of that before.
@exist_elems = grep {/$mystring/} @array_orgn;
#note this is untested
--
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail
) {
print 'Yes it exists' and last if $mystring eq $_;
}
Thanks so much guys.
Glad I learnt those...
--
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
? Seems most of my
questions
are FAQs too...
- B
--
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
}
alternatively you can assign a variable
after foreach:
foreach my $var ( @$deployList ){
print $var\n;
}
Please read- perldoc perlreftut
perldoc perlvar
for additional info on those issues.
HoH
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
=opscakjbrtq79b6q%40mailhost.i2r.a-star.edu.sgrnum=20prev=/groups%3Fq%3Dedward%2Bwijaya%26start%3D10%26hl%3Den%26lr%3D%26group%3Dperl.beginners.*%26selm%3Dopscakjbrtq79b6q%2540mailhost.i2r.a-star.edu.sg%26rnum%3D20
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED
Hi,
Would like to know, where is the best place to
put collection of subroutines in a Perl program,
is it after main or before? Any caveat?
--
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org
On Mon, 8 Nov 2004 11:59:13 +0100, Ing. Branislav Gerzo [EMAIL PROTECTED]
wrote:
Hi pals,
I have simple hash question, lets we have example code:
my %hash = ( 1 = 2, 2 = 3, 3 = 4, 4 = 5 );
while (my($key, $value) = each(%hash)) { print $key = $value\n; }
how I can print all values, if I want
use Tie::IxHash module from CPAN, to preserve order in a Hash.
Regards,
Edward WIJAYA
SINGAPORE
On Tue, 09 Nov 2004 03:06:03 +0800, Edward Wijaya [EMAIL PROTECTED]
wrote:
On Mon, 8 Nov 2004 11:59:13 +0100, Ing. Branislav Gerzo [EMAIL PROTECTED]
wrote:
Hi pals,
I have simple hash question
status, won't install without force
-
Even if I use force install I will still encounter the same message
Please advice how can I solve this.
Thanks so much for your time.
--
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
is very much welcome.
Thank you very much for all of your time and effort.
No problem.
Regards,
Edward WIJAYA
SINGAPORE
__
Do you Yahoo!?
Check out the new Yahoo! Front Page.
www.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
sub mysub {
my ($var, @array) = @_;
my @new_array = ();
#do sth to @array or $var;
return @new_array;
}
read - perldoc perlsub
Regards,
Edward WIJAYA
On Sat, 6 Nov 2004 12:48:26 +0530, Anish Kumar K.
[EMAIL PROTECTED] wrote:
Hi
I want to pass a array and and a varaible
Hi,
Mine is not as elegant as J.Krahn's or Jeff's.
But it's an alternative.
I am just glad to contribute at least something
to the forum I have owed so much...
--
Regards,
Edward WIJAYA
SINGAPORE
---
use strict;
use warnings;
use Data::Dumper;
my %hash = ();
while (DATA
On Sat, 02 Oct 2004 01:46:01 -0700, John W. Krahn [EMAIL PROTECTED] wrote:
there is an extra $ in there, it should be:
67: delete $HoH-{ $k } if keys %{ $HoH-{ $k } } $limit;
Thanks a lot John.
Now it's ok.
RegardS,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED
,
'1-3' = 3
);
my $t = Tie::IxHash-new(%hash);
$t-SortByValue; # ascending, ok!
$t-$hash{$b}=$hash{$a}SortByValue; #tried this but doesn't work
__END__
Can anybody advice how to go about this?
Thanks beforehand.
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED
() );
Thanks so much for your explanation and understanding, Clark.
I get it now.
Also thanks for your correction, Gunnar.
I know I've been rather annoying to you guys
lately...Thanks for bearing with it ... :-)
I will keep it mind your suggestions.
Gratefuly yours,
Edward WIJAYA
SINGAPORE
. Can you give us some
more background info?
What I am trying to do is to accumulate, every new HoA generated
into existing HoA, and join the values if they have the same key.
Dave
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
,
'B',
2,
'C',
2
]
};
not;
$VAR1 = { 'key1' = ['A',1],['B',2],['C',2]};
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
= reduce_hash(%hoh,3);
it should return
my %hoh = (
key2 = {A = 'foo',
B = 'bar',
C = 'qux'}, );
But my subroutine doesn't work as it should.
Is there anything wrong with it?
Yours again,
Edward WIJAYA
SINGAPORE
__BEGIN__
use strict;
use warnings;
use Data
On Fri, 1 Oct 2004 10:51:50 -0400, Dave Gray [EMAIL PROTECTED] wrote:
$HoA = ( key1 = [
['A',1], ['B',2], ['C',3]
]);
Which is clunky when you want to detect duplicates, which is why I
suggested the hash.
I think you are right Dave.
I will follow your suggestion.
Regards,
Edward WIJAYA
by reference
my ($HoH,$limit) = @_;
foreach my $k ( keys %$HoH ) { # This two
don't work
delete $HoH{ $k } if keys %${ $HoH{ $k } } $limit;# What's
wrong with my deref?
}
return %HoH;
What's wrong with my deref?
Regards
Edward WIJAYA
SINGAPORE
at testcode.pl line 67.
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
much for the time.
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
Hi,
I have the following code,
and I know it is HORRIBLE.
I wonder if I can do it in more
efficient and elegant way?
Thanks so much
and
Regards,
Edward WIJAYA
SINGAPORE
__BEGIN__
use strict;
use warnings;
use Getopt::Std;
use Data::Dumper;
my %hash = (
A = 'blabla',
B = 'dadada
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
question is how can I print output like:
firstkey
secondkey
given the construction variables as mention before.
Thanks
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
On 29 Sep 2004 15:20:39 +0100, Jose Alves de Castro
[EMAIL PROTECTED] wrote:
for (keys %HoH) {
print $_\n;
}
It seems so. Thanks a lot.
I thought 'keys' are only for simple hash.
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail
On 29 Sep 2004 14:06:33 -, Peter Scott [EMAIL PROTECTED] wrote:
Nitpick - the diamond operator is . INFILE
would be use of the readline operator.
Thanks for making it precise Peter.
Glad that I learnt that.
Forgive me for my limited Perl vocabulary.
Regards,
Edward WIJAYA
SINGAPORE
Hi,
Why my code below fail to open and
print the file contents
when I do:
perl mycode.pl -f filename
Regards,
Edward WIJAYA
SINGAPORE
__BEGIN__
use strict;
use warnings;
use Getopt::Std;
use vars qw($f);
getopts('f:');
my $f = $ARGV[0];
open ( INFILE, '', $f)
or die $0 : failed to open
advice how can I overcome this problem.
Thanks so much for your time.
Regards,
Edward WIJAYA
SINGAPORE
__BEGIN__
use strict;
use warnings;
use Getopt::Std;
our $opt_f;
getopts('f:');
open INFILE, $opt_f or die $0: Can't open file $opt_f: $!;
my $trial = 2;
#What's wrong with running a for loop over
.
__BEGIN__
for ( my $t = 1 ; $t = $trial ; $t++ )
{
print Trial , $t, \n;
while (INFILE) {
print;}
}
close INFILE;
open INFILE; #is this how you reopen?
__END__
Hope you don't mind to elaborating it.
Thanks again.
Regards
Edward WIJAYA
--
To unsubscribe, e-mail
Many many thanks Bob!
Glad to know I can do it in one-line.
for ( ...blah... ) {
seek(INFILE, 0, 0); # --- rewind file back to start
while (INFILE) {...
}
}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
the
last k-clique found.
My question is how can I modify my code below
so it can store and then returns all the k-clique found?
That is:
$ perl graph.pl 3
would give:
1 2 3
1 2 4
1 3 4
2 3 4
5 6 9
Thanks so much for your time.
Regards,
Edward WIJAYA
SINGAPORE
__BEGIN__
#! /usr/local/bin/perl
use
://vote.yahoo.com
--
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
Hi,
How can I change the value of this array:
@array = ['1','2','3']; #which contain string numeric
to
@arrayNum = [1,2,3]; #as pure numeric
Regards,
Edward WIJAY
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
to have asked
such a trivial question.
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
information
about dealing with this matter? Any specific
module that cater this problem?
Thanks for your time beforehand.
Regards,
Edward WIJAYA
SINGAPORE
This is my current (terribly inefficient
and unflexible) code:
#!/usr/bin/perl -w
use strict;
use Data::Dumper;
if(scalar @ARGV ne 1)
{
print
whitespace
for ( @data ) {
s/^\s+//;
s/\s+/ /g;
s/ $/\n/;
}
Hope to heare from you again.
Regards
Edward WIJAYA
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
' = 'GAAGcaaGGC'
};
Thanks so much for your time.
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
, Tie::Has::Regex from CPAN.
I will install that package. Thanks again.
Regards,
Edward WIJAYA
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
Hi,
I've tried all the repositories
as suggested by Active State documentation,
including Jenda's repository.
But I always encounter error message
Fail to download...
Hope to hear from you guys again.
Regards
Edward WIJAYA
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e
@array3 indicates the string was to overwrite at a
random position. I assume the entire string must be inside
the result.
Yes, you are right Charles.
And thanks so much too for Gunnar and Jeff.
Best,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands
as part of each elements in @arr1
such that it gives result:
@arr3 =('GAtcctctaAAGGAGAGGTACTTACAGG',
'CGCCCAAGAGGCCAGaggccacCA',
'CGTTAAagctgcgAAGTTCT');
#the starting position to be copied to in @arr1 can is random.
Thanks for your time.
Regards,
Edward WIJAYA
perl -c par.pl
On Mon, 30 Aug 2004 15:49:37 +0800, pagoda [EMAIL PROTECTED] wrote:
I want to compile my perl code, and I tried perlcc and par.pl.
I don't know which one is more powerful?
It seems that both they are not very good.
Give me a hand please.
Thanks.
--
To unsubscribe, e-mail: [EMAIL
I guess you should use the |more command
in the command prompt not inside the perl code itself.
perl code.pl option |more
On Thu, 26 Aug 2004 09:36:38 +0200, Etienne Ledoux [EMAIL PROTECTED]
wrote:
ok.
Here is the output I'm trying to '|more'
while (@ref = $sth-fetchrow_array()) {
1 - 100 of 120 matches
Mail list logo