[22655] in Perl-Users-Digest
Perl-Users Digest, Issue: 4876 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 22 18:06:02 2003
Date: Tue, 22 Apr 2003 15:05:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 22 Apr 2003 Volume: 10 Number: 4876
Today's topics:
Re: compare two files <nobody@dev.null>
Re: compare two files (Helgi Briem)
Re: fake flocking on win32 <nobody@dev.null>
How do I rewind a file? <nobody@dev.null>
Re: How do I rewind a file? <emschwar@pobox.com>
Re: Is there a more "perlesque" way of doing this? (Eric)
Newbie Help (entropy123)
Re: Newbie Help <jkeen@concentric.net>
Re: Newbie Help (Jay Tilton)
Re: number of elements in an array that is part of a ha <nobody@dev.null>
Re: number of elements in an array that is part of a ha <mbudash@sonic.net>
Off Topic Perl Email Question: Sending mail to AOL and <Jeff@aetherweb.co.uk>
Re: Off Topic Perl Email Question: Sending mail to AOL <noreply@gunnar.cc>
OT Perl Contract (Richard)
Re: OT Perl Contract <uri@stemsystems.com>
Re: Q. Does ActivePerl for Windows require Apache to be <dorward@yahoo.com>
Re: Q. Does ActivePerl for Windows require Apache to be <nospam@raytheon.com>
Re: Q. Does ActivePerl for Windows require Apache to be <nospam@raytheon.com>
Read File, write filename? (entropy123)
Re: Read File, write filename? <nobull@mail.com>
Re: Read File, write filename? <krahnj@acm.org>
Re: regexp match problem <jaspax@u.washington.edu>
Re: search question <hillmw@ram.lmtas.lmco.com>
Re: Using Rijndael encryption on socket connection betw <rene_404@thekrofties.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 22 Apr 2003 16:06:13 GMT
From: Andras Malatinszky <nobody@dev.null>
Subject: Re: compare two files
Message-Id: <3EA5684B.7080609@dev.null>
Helgi Briem wrote:
> On Tue, 22 Apr 2003 08:47:35 -0500, Barry Kimelman
> <barryk2@SPAM-KILLER.mts.net> wrote:
>
>
>>>I am a beginner with perl and would greatly appreciate some
>>>assistance. I want to compare two log files and if they are
>>>significantly different in size, send myself an email.
>>>
> <SNIP>
>
>>Use the "stat" function to retrieve file information as follows :
>>
>>$file_status = stat($filename1);
>>$size1 = $file_status->size;
>>$file_status = stat($filename2);
>>$size2 = $file_status->size;
>>
>>$diff = $size2 - $size1;
>>if ( $diff < -300 || $diff > 300 ) {
>> # Size difference is greater than 300
>>} # IF
>>
>
> Isn't that an unnecesssarily complex way to do it?
>
> my $sizediff = abs((-s $file1) - (-s $file2));
> if ($sizediff > 300) { # do something }
>
From a didactical point of view (i.e., for a self-described beginner
who may not understand why you are using that "minus s") Barry's
approach may be preferrable.
------------------------------
Date: Tue, 22 Apr 2003 16:35:52 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: compare two files
Message-Id: <3ea56eca.1042801248@news.cis.dfn.de>
On Tue, 22 Apr 2003 16:06:13 GMT, Andras Malatinszky
<nobody@dev.null> wrote:
>Helgi Briem wrote:
>> Isn't that an unnecesssarily complex way to do it?
>>
>> my $sizediff = abs((-s $file1) - (-s $file2));
>> if ($sizediff > 300) { # do something }
>>
> From a didactical point of view (i.e., for a self-described beginner
>who may not understand why you are using that "minus s") Barry's
>approach may be preferrable.
But isn't the -s operator, or in fact the whole class
of minus X operators, one of the first things a beginner
should learn?
After all, a lot of the tasks one might tackle using
Perl involve the age of files, the size of files, the
type of file, the existence of file, the owner of
files and so on and so forth, which is what you
use the -X operators for.
perldoc -f -X for details.
--
Regards, Helgi Briem
helgi DOT briem AT decode DOT is
------------------------------
Date: Tue, 22 Apr 2003 16:01:15 GMT
From: Andras Malatinszky <nobody@dev.null>
Subject: Re: fake flocking on win32
Message-Id: <3EA56720.7090502@dev.null>
Bob Walton wrote:
> dan baker wrote:
>
> ...
>
>> win32 environment as on the eventual *nix server. The big problem is
>> that there is no flock on win32, and I am a little confused by what
>
>
>
> Where do you get the idea there is no flock on Win32 systems? It works
> fine on NT, and probably also on 2000 etc (although I can't personally
> vouch for anything other than NT). True, it doesn't work on 95 or 98,
> at least not with the AS port (don't know about other ports, but I would
> bet not).
For whatever it's worth, flock is unimplemented for the Win98/Indigo
Perl combination as well.
------------------------------
Date: Tue, 22 Apr 2003 19:33:45 GMT
From: Andras Malatinszky <nobody@dev.null>
Subject: How do I rewind a file?
Message-Id: <3EA598EB.6050407@dev.null>
Consider a program snippet like this:
open FILE, 'file.txt';
while(<FILE>){
#do something
};
#do more stuff
while(<FILE>){
#do the right thing
};
Here I never get to do the right thing because by the time I'm through
with the first while(), the file pointer is at the end of the file, so
the second while block is as though it weren't even there, correct? Is
there a way to somehow reset the file pointer to the beginning of the
file, short of closing and reopening the file?
And where is the <> operator documented? I didn't find it either in
perlop or in perlfunc.
------------------------------
Date: 22 Apr 2003 13:44:45 -0600
From: Eric Schwartz <emschwar@pobox.com>
Subject: Re: How do I rewind a file?
Message-Id: <etobryy5nbm.fsf@wormtongue.emschwar>
Andras Malatinszky <nobody@dev.null> writes:
> Is
> there a way to somehow reset the file pointer to the beginning of the
> file, short of closing and reopening the file?
perldoc -f seek
has what you're looking for.
> And where is the <> operator documented? I didn't find it either in
> perlop or in perlfunc.
You should look harder next time:
"The null filehandle <> is special: it can be used to emulate
the behavior of sed and awk. . . ."
from perlop, about 85% of the way down..
-=Eric
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
-- Blair Houghton.
------------------------------
Date: 22 Apr 2003 08:40:45 -0700
From: lavergneeric@netscape.net (Eric)
Subject: Re: Is there a more "perlesque" way of doing this?
Message-Id: <b0be6001.0304220740.3c71dd9a@posting.google.com>
Thank you for you help,
playing around with these solutions and reading more on the
subject I discovered Transliteration (tr)
in my particular case the following seems to work as well.
$_ = "some_text_patern1";
tr/patern1patern2/patern2patern1/; #something close to this...
Eric
Tina Mueller <usenet@tinita.de> wrote in message news:<b6t1ef$8k4b9$4@ID-24002.news.dfncis.de>...
> Eric <lavergneeric@netscape.net> wrote:
>
> > I'm looking for a regular expression that would
> > switch pattern1 or pattern2 for its counter part pattern2 or pattern1
>
> > here is an example
> > (($togglePattern =~s/(pattern1$)/pattern2)||
> > ($togglePattern =~s/(pattern2$)/pattern1))
>
>
> s/(pattern1|pattern2)$/{pattern1=>"pattern2",pattern2=>"pattern1"}->{$1}/ge;
>
> (if the patterns have no meta-characters)
>
> hth, tina
------------------------------
Date: 22 Apr 2003 13:42:41 -0700
From: email_entropy123@yahoo.com (entropy123)
Subject: Newbie Help
Message-Id: <90cdce37.0304221242.2052d53a@posting.google.com>
I need to make a program which:
1) Opens a file
2) Writes name of the file just opened as the first line in a new file.
I'm working through a Perl book but can't figure this one out...thanks...
entropy
------------------------------
Date: 22 Apr 2003 21:56:11 GMT
From: "James E Keenan" <jkeen@concentric.net>
Subject: Re: Newbie Help
Message-Id: <b84dpr$r3r@dispatch.concentric.net>
"entropy123" <email_entropy123@yahoo.com> wrote in message
news:90cdce37.0304221242.2052d53a@posting.google.com...
> I need to make a program which:
>
> 1) Opens a file
> 2) Writes name of the file just opened as the first line in a new file.
>
> I'm working through a Perl book but can't figure this one out...thanks...
>
1. Please put the subject matter of your posting in the subject line. Many
people simply pass over posts where 'newbie' appears in the subject line.
More generally, read the posting guidelines for this list before posting.
2. Have you consulted Perl's built-in documentation? That's something else
you should do before posting. For example:
perldoc -f open
perldoc perlopentut
... may prove helpful.
------------------------------
Date: Tue, 22 Apr 2003 21:58:31 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Newbie Help
Message-Id: <3ea5b194.446476456@news.erols.com>
email_entropy123@yahoo.com (entropy123) wrote:
: Subject: Newbie Help
The Subject line should summarize the subject of your article. The
one you chose there does the job abysmally, being connected to the
content in only a broad and vague interpretation.
: I need to make a program which:
:
: 1) Opens a file
The open() function is appropriate to that need, and appropriately
named.
: 2) Writes name of the file just opened as the first line in a new file.
print() will be part of the solution.
The other part is knowing what is involved in
inserting/removing/altering lines within an existing file.
perlfaq5 used to have a comprehensive answer to that, but with Perl
5.8 it was drastically trimmed to a one-line answer. IMHO, the value
of that FAQ answer was very much reduced by the change; it fulfills
the basic need, but a reader will gain no enlightenment.
Go to perldoc.com and look up perlfaq5 in the Perl 5.6 documentation.
The pertinent subsection is titled "How do I change one line in a
file/delete a line in a file/insert a line in the middle of a
file/append to the beginning of a file?"
: I'm working through a Perl book but can't figure this one out...thanks...
Can you share your best effort at coding the solution on your own?
It's very likely you are a hair's breadth from success, and a chance
to clarify misapprehensions would be more instructive than being
spoon-fed an answer.
------------------------------
Date: Tue, 22 Apr 2003 15:52:02 GMT
From: Andras Malatinszky <nobody@dev.null>
Subject: Re: number of elements in an array that is part of a hash
Message-Id: <3EA564F7.5020201@dev.null>
Bart Lateur wrote:
> Klaus Kleiner wrote:
>
>
>>I know that I could get the number of elements of an array with
>>$Elements = @Array;
>>
>>Now I have an array containing a hash containing an arry, loks like:
>>$Person[$i]{children}[$j]{age} = 5;
>>($i and $j are just scalar counters
>>Person No $i has children, child No $j is 5 years old)
>>
>>
>>Number of persons is no problem:
>>$Elements = @Person; # OK !
>>
>>but number of children doesn't work:
>>$Elements = @Persion[$i]{children}; # ERROR ?
>>
>
> (type $Persion -> $Person)
>
> $Person[$i]{children} is an array reference. You need to dereference it,
> and take the number of elements from that. You dereference an array
> reference by preceding it with @:
>
> $Elements = @$arrayref;
>
> but in case of possible precedence problems, you may put the reference
> in a block:
>
> $Elements = @{$arrayref};
>
> Very likely this is the case here, so it's safest to do
>
> $Elements = @{$Person[$i]{children}};
>
> which is the answer to your problem.
>
>
Suppose I wanted to know the number of *all* the children in this data structure. Is there some quick way of finding that, other than actually generating $Elements for each $i and summing up the values?
------------------------------
Date: Tue, 22 Apr 2003 16:57:33 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: number of elements in an array that is part of a hash
Message-Id: <mbudash-62A14F.09573922042003@typhoon.sonic.net>
In article <3EA564F7.5020201@dev.null>,
Andras Malatinszky <nobody@dev.null> wrote:
> Bart Lateur wrote:
>
> > Klaus Kleiner wrote:
> >
> >
> >>I know that I could get the number of elements of an array with
> >>$Elements = @Array;
> >>
> >>Now I have an array containing a hash containing an arry, loks like:
> >>$Person[$i]{children}[$j]{age} = 5;
> >>($i and $j are just scalar counters
> >>Person No $i has children, child No $j is 5 years old)
> >>
> >>
> >>Number of persons is no problem:
> >>$Elements = @Person; # OK !
> >>
> >>but number of children doesn't work:
> >>$Elements = @Persion[$i]{children}; # ERROR ?
> >>
> >
> > (type $Persion -> $Person)
> >
> > $Person[$i]{children} is an array reference. You need to dereference it,
> > and take the number of elements from that. You dereference an array
> > reference by preceding it with @:
> >
> > $Elements = @$arrayref;
> >
> > but in case of possible precedence problems, you may put the reference
> > in a block:
> >
> > $Elements = @{$arrayref};
> >
> > Very likely this is the case here, so it's safest to do
> >
> > $Elements = @{$Person[$i]{children}};
> >
> > which is the answer to your problem.
> >
> >
> Suppose I wanted to know the number of *all* the children in this data
> structure. Is there some quick way of finding that, other than actually
> generating $Elements for each $i and summing up the values?
>
$total += @{$Person[$_]{children}} foreach (0..$#Person);
hth-
--
Michael Budash
------------------------------
Date: Tue, 22 Apr 2003 17:29:27 +0100
From: "Jeff Snoxell" <Jeff@aetherweb.co.uk>
Subject: Off Topic Perl Email Question: Sending mail to AOL and Outlook Express with SENDMAIL
Message-Id: <b83qip$e20$1@newsg1.svr.pol.co.uk>
Hi,
sorry if this is too far off-topic but:
I'm sending emails containing various characters using sendmail in a
subroutine, as follows:
sub SendMail
{
my ($to, $from, $subject, $organisation, $content) = @_;
if (open(EZMAIL, "$mailprog"))
{
print EZMAIL "From: $from\nTo: $to\n";
print EZMAIL "Subject: $subject\n";
print EZMAIL "Organization: $organisation\n";
print EZMAIL "MIME-Version: 1.0\n";
print EZMAIL "Content-Type: text/plain; charset='iso-8859-1';
format=flowed\n";
print EZMAIL "\n";
print EZMAIL $content;
print EZMAIL "\n.\n\n";
close(EZMAIL);
}
}
This works fine in Eudora and Outlook Express but AOL email display in a
browser converts the following:
£5.66
to
5
If I add the header:
print EZMAIL "Content-Transfer-Encoding: quoted-printable\n";
It makes things worse. Things like the following in my emails:
http://www.mysite.com/cgi-bin/test.cgi?a=1&ec=2&id=123 etc
It messes with the details and includes some strange character... in both
AOL and Outlook Express.
I'm sure this is all to do with getting the headers right.
Please tell me what headers I can use to send bog standard plain text emails
so that my characters aren't scrabled, decoded or messed with in any way at
all.
Many thanks,
Jeff
------------------------------
Date: Tue, 22 Apr 2003 20:22:35 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Off Topic Perl Email Question: Sending mail to AOL and Outlook Express with SENDMAIL
Message-Id: <b841ab$668ak$1@ID-184292.news.dfncis.de>
Jeff Snoxell wrote:
> I'm sending emails containing various characters using sendmail in a
> subroutine, as follows:
<snip>
> print EZMAIL "Content-Type: text/plain; charset='iso-8859-1';
------------------------------------------------------^----------^
This is a long-shot, but I would remove those quote characters.
/ Gunnar
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 22 Apr 2003 08:43:13 -0700
From: rsmarkyate@lycos.co.uk (Richard)
Subject: OT Perl Contract
Message-Id: <263dab8b.0304220743.1aba6a69@posting.google.com>
Apologies for the intrusion - a Central London based SW house is
looking for an experienced Perl Software Engineer to develop in-house
build tools. If you are interested please drop me a mail at
rsmarkyate@lycos.co.uk
------------------------------
Date: Tue, 22 Apr 2003 17:22:43 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: OT Perl Contract
Message-Id: <x7vfx6wios.fsf@mail.sysarch.com>
>>>>> "R" == Richard <rsmarkyate@lycos.co.uk> writes:
R> Apologies for the intrusion - a Central London based SW house is
R> looking for an experienced Perl Software Engineer to develop in-house
R> build tools. If you are interested please drop me a mail at
R> rsmarkyate@lycos.co.uk
then tell them to post it to the perl jobs list at jobs.perl.org.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Tue, 22 Apr 2003 21:34:09 +0100
From: David Dorward <dorward@yahoo.com>
Subject: Re: Q. Does ActivePerl for Windows require Apache to be installed ?
Message-Id: <b8495g$2ci$1$8300dec7@news.demon.co.uk>
Chris Olive wrote:
> PerlScript REQUIRES running IIS...
or Apache it seems:
http://www.apache-asp.org/perlscript.html
--
David Dorward http://david.us-lot.org/
"You cannot rewrite history, not one line."
- The Doctor (Dr. Who: The Aztecs)
------------------------------
Date: Tue, 22 Apr 2003 11:46:40 -0500
From: Chris Olive <nospam@raytheon.com>
Subject: Re: Q. Does ActivePerl for Windows require Apache to be installed ?
Message-Id: <Koepa.331$35.1009@dfw-service2.ext.raytheon.com>
Jürgen Exner wrote:
> Chris Olive wrote:
>
>>PerlScript != Perl # strictly speaking
>
>
> Right!
>
>
>>Seeing that you've loaded Apache however (and I can't tell if you
>>loaded Apache because you thought you needed to do so, or because
>>that's exactly what you wanted to do), then maybe you aren't talking
>>about PerlScript since PerlScript REQUIRES running IIS...
>
>
> Wrong. Dead wrong.
No Jurgen... I'm not "dead wrong." PerlScript has a server side
scripting engine component *AND* a client-side plugin. I was talking
about the server-side scripting engine which DOES REQUIRE IIS.
> PerlScript requires a web browser that is capable of running PerlScript. The
> only way I know of is to install the PerlScript plugin from ActiveState
> which is available for IE only.
>
> And then IE will happily render any local DHTML page containing a PerlScript
> script and execute it.
> No need for Apache or IIS or any web server at all.
This is right, but it's only half of the PerlScript picture. I was
talking about the other half. Perhaps I should have been a bit more clear.
>
> Of course as you pointed out that doesn't help the OP who wants to learn
> Perl, not PerlScript.
>
Right.
Chris
-----
Chris Olive
Systems Consultant
Raytheon Technical Services Corporation
Indianapolis, IN
email: olivec(AT)indy(DOT)raytheon(DOT)com
------------------------------
Date: Tue, 22 Apr 2003 15:44:15 -0500
From: Chris Olive <nospam@raytheon.com>
Subject: Re: Q. Does ActivePerl for Windows require Apache to be installed ?
Message-Id: <vThpa.332$35.1112@dfw-service2.ext.raytheon.com>
David Dorward wrote:
> Chris Olive wrote:
>
>
>>PerlScript REQUIRES running IIS...
>
>
> or Apache it seems:
>
> http://www.apache-asp.org/perlscript.html
>
Very interesting. Funny, I was just checking this very moment to see if
the Apache Project had wedged that in yet or not, though it's hard to
say why someone would want to use it unless they needed a quick
PerlScript port from IIS to Apache. I didn't read all of the pages at
the link you provided. If I had to start from scratch on Apache (which
is my scratch server of choice), I'd go a different route. Pretty
interesting though...
If you are a staunch Perl advocate (as I feel I am), and you are forced
to use IIS and ASP (Classic), there is no better choice than PerlScript
ASP. It's IIS on steroids (if that can be conceived at all.) In my
opinion, using PerlScript and HTML::Template or Template Toolkit and a
few other choice Perl mods, Classic ASP can easily do a lot of what .NET
does.
Chris
-----
Chris Olive
Systems Consultant
Raytheon Technical Services Corporation
Indianapolis, IN
email: olivec(AT)indy(DOT)raytheon(DOT)com
------------------------------
Date: 22 Apr 2003 08:45:51 -0700
From: email_entropy123@yahoo.com (entropy123)
Subject: Read File, write filename?
Message-Id: <90cdce37.0304220745.265f80db@posting.google.com>
Hey all,
I am a major Perl newbie working through 'Learning Perl' and I can't
figure out how to do this:
Have perl read the contents of a file with a *.txt and take the * part
of the file and write it to the first line of the new file.
Any suggestions?
Thanks,
entropy
------------------------------
Date: 22 Apr 2003 17:11:33 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Read File, write filename?
Message-Id: <u98yu2bjgq.fsf@wcl-l.bham.ac.uk>
email_entropy123@yahoo.com (entropy123) writes:
> I am a major Perl newbie working through 'Learning Perl' and I can't
> figure out how to do this:
Then break it into smaller parts. Also make sure you unabiguously
understand what it is you want to do.
> Have perl read the contents of a file
You can open files with open().
You can read a line from a file using <> in a scalar context.
Did you want to read just the first line, the whole file in one go, or
the whole file a line at a time?
> with a *.txt and take the * part of the file
File, what file? Once you've read the contents of a file you are now
concerned with strings not files.
What do you mean by the phase "with a *.txt". Do you mean containing
a string the last 4 characters of which are '.txt' or do you mean
something else?
To remove the seqence .txt where it appears as the last 4 characters
of the current record:
s/\.txt$//;
> and write it to the first line of the new file.
The firsts thing you write to a newly created file will be the first
line of it so you need do nothing special.
You can create files using open().
You can write to them with print().
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Tue, 22 Apr 2003 21:45:33 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Read File, write filename?
Message-Id: <3EA5B7EE.7E27CB12@acm.org>
entropy123 wrote:
>
> I am a major Perl newbie working through 'Learning Perl' and I can't
> figure out how to do this:
>
> Have perl read the contents of a file with a *.txt and take the * part
> of the file and write it to the first line of the new file.
>
> Any suggestions?
perl -i~ -ple'1..1&&print$ARGV=~/(.*)\./g;eof&&close(ARGV)' *.txt
John
--
use Perl;
program
fulfillment
------------------------------
Date: Tue, 22 Apr 2003 14:40:54 -0700
From: JS Bangs <jaspax@u.washington.edu>
Subject: Re: regexp match problem
Message-Id: <Pine.A41.4.53.0304221437340.107870@dante18.u.washington.edu>
> Rong (m9l3@interchange.ubc.ca) wrote on MMMDXIX September MCMXCIII in
> <URL:news:1050864679.147700@texada.ugrad.cs.ubc.ca>:
> `` Maybe I have a little misunderstanding about regular expresson.
> `` I just wonder why /.[^w].?/ can match "two".
> `` It seems that I have specified the second character not to be w.
>
> No, you did not. You have specified there must be a character
> that's followed by a character that isn't w, and that may
> be followed by another character.
>
> /.[^w].?/ matches 'wo'. The o is not a w, and 'wo' is followed by
> zero or one other character.
Yep. Since you seem to want that the second character is not "w", you
should put a ^ at the beginning of your regex to force it to evaluate at
the beginning of the search space.
E.g.: /^.[^w].?/ will match any string whose second character is not "w".
Replace ^ with \b to match at the beginning of a word in a multiple word
string.
Jesse S. Bangs jaspax@u.washington.edu
http://students.washington.edu/jaspax/
http://students.washington.edu/jaspax/blog
Jesus asked them, "Who do you say that I am?"
And they answered, "You are the eschatological manifestation of the ground
of our being, the kerygma in which we find the ultimate meaning of our
interpersonal relationship."
And Jesus said, "What?"
------------------------------
Date: Tue, 22 Apr 2003 16:20:40 -0500
From: Michael Hill <hillmw@ram.lmtas.lmco.com>
Subject: Re: search question
Message-Id: <3EA5B228.ADD4956F@ram.lmtas.lmco.com>
If you are reading from a table or file ..... load them to a hash, then
you can search for them. For example:
#create a hash
%norec;
#load some values to the hash
$norec{"a"} = "a";
$norec{"b"} = "b";
$norec{"c"} = "c";
#the value I want to find
$somevar = "b";
#try to find the variable
if ( $norec{$somevar} )
{
# if in the hash
}
else
{
#not in the hash
}
Hope that helps.
Mike
Ying Hu wrote:
> Hi All,
> I have two data sets as the following:
> Data set 1:
> ID1 from1 to1
> A1 23 59
> A2 69 120
> A3 200 239
> ...
> ...
> Y2000 3900000 3900032
>
> Data set 2:
> ID2 from2 to2
> a1 126 130
> a2 201 212
> ...
> ...
> y20 240028 240032
>
> How to quick search two IDs, one in data set 1 and other in data set 2,
> when the range of the ID of data set 2 is in/overlap of the ID of data
> set 1, such as:
> A3 a2
>
> Thanks
>
> Ying
------------------------------
Date: Tue, 22 Apr 2003 22:55:38 +0200
From: "rene_404" <rene_404@thekrofties.net>
Subject: Re: Using Rijndael encryption on socket connection between Windows and Unix...
Message-Id: <3ea5ac49$0$49102$e4fe514c@news.xs4all.nl>
Thank your for our response.
I've removed the line: $cipher->set_iv($iv); in my script and now it is
working. (Thanks to mail of Rob)
"Bryan Castillo" <rook_5150@yahoo.com> wrote in message
news:1bff1830.0304211640.79bc67ad@posting.google.com...
> rook_5150@yahoo.com (Bryan Castillo) wrote in message
news:<1bff1830.0304211237.5e4ceab@posting.google.com>...
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 4876
***************************************