follows...
print( keys( %{ reverse( %hash ) } ) );
... but got no results at all.
Help!
--
Aaron J. Mackey, Ph.D.
Dept. of Biology, Goddard 212
University of Pennsylvania email: [EMAIL PROTECTED]
415 S. University Avenue office: 215-898-1205
Philadelphia, PA 19104-6017 fax:215-746-6697
want to print a file, but without the first N lines...
For N=1, one possibility would be:
print if $. - 1;
For any N, maybe this:
print if ($N+1)..0;
Any thoughts? Any other ideas? What would be the best way to do this?
Regards,
jac
--
José Alves de Castro <[EMAIL PROTECTED]>
http://natur
I haven't yet had the chance to thoroughly test and Benchmark this vs.
Ron Kimball's solution, so there's no summary yet to report (beside the
fact that you and Ron Kimball both provided apparently reasonable
solutions). I will also, as originally promised, package the "winning"
solution into
On Mar 2, 2004, at 9:37 AM, Jeff Abrahamson wrote:
Do you allow overlapping patterns? For example, if you are looking
for 1212, does the following string contain three instances or only
two?
12121212
Yes, three.
Do you allow intervening characters? Searching for 12, do you match
on this?
On the BioPerl mailing list we often get requests like the following:
Within a given biosequence with length X, find substrings of min.
length A and max. length B that contain the pattern P at least C times
but no more than D times.
A more concrete example: Find all substrings 12 characters lon
Someone have a more "perlish", elegant, or just plain faster way of doing
something like this: split a string on white space, pop off the last 4
fields (perhaps to be used elsewhere), and then "rebuild" the original
string with the correct amount of intervening whitespace. One method:
$_ = ;
@d
I can't seem to get this any shorter: I want the second through the
next-to-last elements of @F joined by " ", and then the last item of @F.
perl -ape '$,=" ";s//>@F[1..$#F-1]\n$F[$#F]/'
or (no join, but same general idea):
perl -pe 's/\s+(\S+)$/\n$1/;s/^\S+\s+/>/;'
What trick am I missing?
atching I might need to do ...
}
OK, can this be condensed to something simpler (but perhaps still
readable?)
-Aaron
On Fri, 12 Jul 2002, Aaron J Mackey wrote:
> $_ = "2aaa";
> @d = s/^(\d+)//;
> push @d, m/(a)/ for 1..$d[0];
>
> My "real" application is s
On Fri, 12 Jul 2002, Eugene van der Pijll wrote:
> The parentheses around a return only one match, regardless of the number
> within the {}.
Ahh, right. Sigh, I need to do a limited m//g type of thing, so I guess
I'm stuck with something like:
$_ = "2aaa";
@d = s/^(\d+)//;
push @d, m/(a)/ for
$_ = "2aaa";
@d = m/(\d+)(a){\1}/;
# @d = (2, a, a);
That construct doesn't seem to work; Is there a way to get it to work? Is
there an idiom that doesn't involve two passes, i.e. something other than:
($d) = m/(\d+)/;
@d = ($d, m/(a){$d}/);
Thanks,
-Aaron
--
Aar
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Mon, 3 Dec 2001 [EMAIL PROTECTED] wrote:
> Like Ian Phillipps, I am in awe of this leading bunch.
> This is a hot race. I am really enjoying looking at
> the incredible variety of solutions and learning a
> lot too.
Hopefully there will be a rec
perl, BN, Parse:RecDescent ... FWP!!
>
> Any hints? Golf?
>
> a
>
> Andy Bach, Sys. Mangler
> Internet: [EMAIL PROTECTED]VOICE: (608) 264-5178 ex 5738, FAX 264-510
>
> So, the Buddha walks into a pizza parlor and says,
> "Make me one
12 matches
Mail list logo