12-15-2003
thanks. it really was frustrating. but, at least i learned something. i got it all working now.
scott
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I have thousands of files in a directory that have the following 2 formats:
289620178.aln
289620179.aln
289620180.aln
289620183.aln
289620184.aln
289620185.aln
289620186.aln
289620187.aln
289620188.aln
289620189.aln
289620190.aln
289620192.aln....
and:
alnCDS_1.fasta (1 Reply)
Discussion started by: greptastic
1 Replies
2. UNIX for Advanced & Expert Users
Hi,
The task i have to do is to
1- create a database contains the Names .run the query and store results in hash make the Name field is the hash key
2- in the same time i have a txt which i will loop through it word by word and check for each word if a hash key ( compare it with the Names in... (0 Replies)
Discussion started by: eng_shimaa
0 Replies
3. Shell Programming and Scripting
Hi Perl Gurus , need URGENT HELP PLEASE !!!!!
I have one recursive Perl function which takes path of any directory as argument and returns array containing all the sub folders inside it recursively.
Now the problem is that it works well if i use it with one time but the problem is that when... (0 Replies)
Discussion started by: anthriksh2000
0 Replies
4. Shell Programming and Scripting
I am facing a problem in replacing the file contents by iterating through the list.
My present code:
Code:
#!/bin/bash#
TFILE="/tmp/vinay/testb_1.txt"
while read linedo
aline="$line"
echo $aline
code=`echo $aline|cut -d ',' -f1`
country=`echo $aline|cut -d... (5 Replies)
Discussion started by: av_vinay
5 Replies
5. Programming
Hello All,
Im a Hardware engineer, I have written this script to automate my job. I got stuck in the following location.
CODE:
..
..
...
foreach $key(keys %arr_hash) {
my ($loc,$ind,$add) = split /,/, $arr_hash{$key};
&create_verilog($key, $loc, $ind ,$add);
}
sub create_verilog{... (2 Replies)
Discussion started by: riyasnr007
2 Replies
6. Shell Programming and Scripting
hi all,
i am writing a ksh script, i am logging into an oracle db via sqlplus and running a select statement but i dont know how i can store the results from the sql so i can iterate over it and do more operations over it. I dont want to write a stored procedure with a cursor since i need to... (2 Replies)
Discussion started by: cesarNZ
2 Replies
7. Shell Programming and Scripting
Hi,
I have an hashes of hash, where hash is dynamic, it can be n number of hash. i need to compare data_count values of all .
my %result (
$abc => {
'data_count' => '10',
'ID' => 'ABC122',
}
$def => {
'data_count' => '20',
'ID' => 'defASe',
... (1 Reply)
Discussion started by: asak
1 Replies
8. Shell Programming and Scripting
I am trying to speed up creating a line by line hash file from a huge file using Perl.
Here is my current (working but too slow) Bash code:
(while read line; do hash=$(echo -n $line | md5sum); echo ${hash:0:32}; done)And here is my Perl code:
perl -MDigest::MD5 -le 'foreach $line ( <STDIN> )... (3 Replies)
Discussion started by: Michael Stora
3 Replies
9. Shell Programming and Scripting
Experts - Any advice on how to get a hash value in a foreach loop?
Values print correctly on standalone print statements, but I can't access value
in foreach loop.
See sample code below and thanks in advance.
foreach my $z (sort keys %hash) {
for $y (@{$hash{$z}}) {
print "$z... (6 Replies)
Discussion started by: timj123
6 Replies
LEARN ABOUT DEBIAN
perl::critic::policy::variables::requirelexicalloopiterators
Perl::Critic::Policy::Variables::RequireLexicalLoopIteraUser(Contributed Perl DocPerl::Critic::Policy::Variables::RequireLexicalLoopIterators(3pm)
NAME
Perl::Critic::Policy::Variables::RequireLexicalLoopIterators - Write "for my $element (@list) {...}" instead of "for $element (@list)
{...}".
AFFILIATION
This Policy is part of the core Perl::Critic distribution.
DESCRIPTION
This policy asks you to use "my"-style lexical loop iterator variables:
foreach my $zed (...) {
...
}
Unless you use "my", "for"/"foreach" loops use a global variable with its value "local" to the block. In other words,
foreach $zed (...) {
...
}
is more-or-less equivalent to
{
local $zed
foreach $zed (...) {
...
}
}
This may not seem like a big deal until you see code like
my $bicycle;
for $bicycle (@things_attached_to_the_bike_rack) {
if (
$bicycle->is_red()
and $bicycle->has_baseball_card_in_spokes()
and $bicycle->has_bent_kickstand()
) {
$bicycle->remove_lock();
last;
}
}
if ( $bicycle and $bicycle->is_unlocked() ) {
ride_home($bicycle);
}
which is not going to allow you to arrive in time for dinner with your family because the $bicycle outside the loop is not changed by the
loop. You may have unlocked your bicycle, but you can't remember which one it was.
Lexical loop variables were introduced in Perl 5.004. This policy does not report violations on code which explicitly specifies an earlier
version of Perl (e.g. "require 5.002;").
CONFIGURATION
This Policy is not configurable except for the standard options.
SEE ALSO
"Foreach Loops" in perlsyn
"my() in Control Structures" in perl5004delta
AUTHOR
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com>
COPYRIGHT
Copyright (c) 2005-2011 Imaginative Software Systems. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license
can be found in the LICENSE file included with this module.
perl v5.14.2 2012-06-07 Perl::Critic::Policy::Variables::RequireLexicalLoopIterators(3pm)