[19228] in Perl-Users-Digest
Perl-Users Digest, Issue: 1423 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 1 18:05:40 2001
Date: Wed, 1 Aug 2001 15:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <996703511-v10-i1423@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 1 Aug 2001 Volume: 10 Number: 1423
Today's topics:
Re: $ENV{'HTTP_REFERER'} <iltzu@sci.invalid>
Re: amount of array elements <ilya@martynov.org>
challenging question <citykid@nospam.edu>
Re: challenging question <ilya@martynov.org>
copy files <fpourki@gmx.de>
Re: copy files <me@my_no_spam.org>
DBD::Oracle Error Message Makes no Sense ... to me <tom.hoffmann@worldnet.att.net>
FAQ: How do I compute the difference of two arrays? Ho <faq@denver.pm.org>
Re: FAQ: What is the difference between $array[1] and @ <iltzu@sci.invalid>
Re: FAQ: What is the difference between $array[1] and @ <mischief@velma.motion.net>
Re: Help with an array and foreach <tsee@gmx.net>
Re: how to find free disk space (Win32) (John Stumbles)
Re: is there a windows installer for perl ? (valkos)
Re: join lines ? (Yves Orton)
Re: join lines ? <me@my_no_spam.org>
Matching Strings in an array <ryan@bong.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 1 Aug 2001 18:05:01 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: $ENV{'HTTP_REFERER'}
Message-Id: <996688576.25603@itz.pp.sci.fi>
In article <20010731162748.06436.00002313@ng-fy1.aol.com>, Tell wrote:
>I am using a perl cgi script that uses the $ENV{'HTTP_REFERER'} variable to
>make sure that it is being run from only 1 web site as a security feature.
>Someone has told me that these variables can be easily faked.
>
>I do not want to know how to fake them :-) but would like to know if this is
>actually possible because if it is I am not as secure as I thought I was.
Sure. The browser gets to choose what it sends in the "Referer" header.
Most choose either the address of the referring page or nothing, but
there's no reason why they'd have to.
Some proxies can also be configured to remove the "Referer" header or to
set it to a bogus value. In fact, even in normal operation proxies are
likely to mess with anything you might want to achieve with the referer
header, since no referer check will be done for cached pages.
[comp.lang.perl.misc is not really appropriate for this, as there is no
Perl-specific issue involved. Crossposted to comp.infosystems.www.misc
and followups set there.]
--
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real! This is a discussion group, not a helpdesk. You post something,
we discuss its implications. If the discussion happens to answer a question
you've asked, that's incidental." -- nobull in comp.lang.perl.misc
------------------------------
Date: 01 Aug 2001 22:21:35 +0400
From: Ilya Martynov <ilya@martynov.org>
Subject: Re: amount of array elements
Message-Id: <87d76ftzdc.fsf@abra.ru>
MK> hi,
MK> how can i get the amount of elements in a referenced
MK> array???
MK> In a normal array with $#array.
scalar(@$array_ref)
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/) |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80 E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/) |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
------------------------------
Date: Wed, 1 Aug 2001 13:12:49 -0700
From: Les Ander <citykid@nospam.edu>
Subject: challenging question
Message-Id: <Pine.LNX.4.33.0108011300450.10190-100000@schewanella.stanford.edu>
Hi,
i am having hard time solving this problem and would
appreciate any help...
I want to generate N (uniform)random numbers in the range
0 to 1 and the sum of these numbers must equal 1.
the first solution i thought of (which is not correct) is..
#i am not using 'my' for clarity
sub generate_random_nums()
{
$num_rand=$_[0];
$range=1.0;
for $i (0..$num_rand)
{
$temp_rand=rand($range);
push(@arr,$temp_rand);
$range-=$temp_rand;
}
return @arr;
}
CLEARLY this is wrong since the range is no long 0 to 1
(i wrote the wrong solution to show that i did make some effort).
I don't know how to correct it so that the range is valid..
thanks
------------------------------
Date: 02 Aug 2001 00:19:24 +0400
From: Ilya Martynov <ilya@martynov.org>
Subject: Re: challenging question
Message-Id: <87ae1jv8hf.fsf@abra.ru>
LA> Hi,
LA> i am having hard time solving this problem and would
LA> appreciate any help...
LA> I want to generate N (uniform)random numbers in the range
LA> 0 to 1 and the sum of these numbers must equal 1.
LA> the first solution i thought of (which is not correct) is..
LA> [..skip..]
LA> CLEARLY this is wrong since the range is no long 0 to 1
LA> (i wrote the wrong solution to show that i did make some effort).
LA> I don't know how to correct it so that the range is valid..
sub generate_random_nums {
my $num_rand = shift;
my @rands = map rand, (1 .. $num_rand);
my $sum = 0;
for my $rand (@rands) {
$sum += $rand;
}
my @arr = map $_/$sum, @rands;
return @arr;
}
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/) |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80 E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/) |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
------------------------------
Date: Wed, 01 Aug 2001 20:04:39 +0200
From: pourki <fpourki@gmx.de>
Subject: copy files
Message-Id: <3B6844B7.6C0EBF7B@gmx.de>
Hello there!
I've got 3 questions about copying and deleting files:
use File::Copy
1. copy("dirPath1/x*"; "dirPath2"); ?
2. copy("dirPath/*x"; "dirPath2"); ?
3. chdir("dirPath"); unlink(<*>);
The statements 1&2 are wrong.What is the correct form for them?
Can i write the 2 stataments under 3 in just one
statement?
Thanks for any help.
------------------------------
Date: Wed, 01 Aug 2001 15:21:39 -0400
From: Dave VP <me@my_no_spam.org>
Subject: Re: copy files
Message-Id: <3B6856C3.D5F406CD@my_no_spam.org>
pourki wrote:
>
> Hello there!
> I've got 3 questions about copying and deleting files:
>
> use File::Copy
>
> 1. copy("dirPath1/x*"; "dirPath2"); ?
^
Eh? Use a comma to separate parameters
> 2. copy("dirPath/*x"; "dirPath2"); ?
^^^^^
See above
From the File::Copy docs:
The copy function takes two parameters: a file to copy from and a file
to copy to. Either argument may be a string, a FileHandle reference or a
FileHandle
It does not specify wild cards. I would loop over a glob array like:
#!/perl -w
use strict;
use File::Copy;
foreach (<*.pl>) { copy("$_","/temp/") or die "Copy failed for $_:
$!\n"; }
> 3. chdir("dirPath"); unlink(<*>);
>
> The statements 1&2 are wrong.What is the correct form for them?
> Can i write the 2 stataments under 3 in just one
> statement?
>
(On Win32, e.g.)
unlink (<C:/TEMP/*.TXT>) or die "Failed: $!\n";
> Thanks for any help.
HTH
--
Dave
------------------------------
Date: Wed, 01 Aug 2001 21:13:39 GMT
From: Tom Hoffmann <tom.hoffmann@worldnet.att.net>
Subject: DBD::Oracle Error Message Makes no Sense ... to me
Message-Id: <7i_97.29193$gj1.2765219@bgtnsc05-news.ops.worldnet.att.net>
I am just starting to work with the DBI and DBD::Oracle. I have
installed them both successfully. However, when I try to connect to the
Oracle database I get the following error:
install_driver(Oracle) failed:
Can't load
'/usr/opt/perl5/lib/site_perl/5.005/aix/auto/DBD/Oracle/Oracle.so'
for module DBD::Oracle:
dlopen:
/usr/opt/perl5/lib/site_perl/5.005/aix/auto/DBD/Oracle/Oracle.so: A
file or directory in the path name does not exist. at
/usr/opt/perl5/lib/5.00503/aix/DynaLoader.pm line 169.
at (eval 1) line 3
Perhaps a required shared library or dll isn't installed where expected
at ./DBItest.pl line 10
However, the Oracle.so shared library module is installed at exactly
the location the error message claims it can not find it. All
directories on the path to Oracle.so have at least read and execute
permissions for user/group/other. As evidence I offer
# pwd
/usr/opt/perl5/lib/site_perl/5.005/aix/auto/DBD/Oracle
# ls -l
total 256
-rw-r--r-- 1 root system 310 Nov 27 2000 .packlist
-r--r--r-- 1 root system 0 Nov 27 2000 Oracle.bs
-r-xr-xr-x 1 root system 126048 Nov 27 2000 Oracle.so
Quite frankly I'm stumped. Can anyone shed any loight on what this
error message *really* means? Oh, and in case you are interested, here
is my script:
++++++++++++++++++++++++++++++++++++++++++++++++
#!/usr/bin/perl -w
use strict;
use DBI;
# --------------------------------------------
# Set the database handle
# --------------------------------------------
my $dbh = DBI->connect('dbi:Oracle:TRNG', 'tom', 'pwd')
or die "Could not connect to database:";
$dbh->disconnect();
exit 0;
++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------
Date: Wed, 01 Aug 2001 18:20:07 GMT
From: PerlFAQ Server <faq@denver.pm.org>
Subject: FAQ: How do I compute the difference of two arrays? How do I compute the intersection of two arrays?
Message-Id: <rLX97.48$l_m.191768064@news.frii.net>
This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with every Standard Distribution of
Perl.
+
How do I compute the difference of two arrays? How do I compute the intersection of two arrays?
Use a hash. Here's code to do both and more. It assumes that each
element is unique in a given array:
@union = @intersection = @difference = ();
%count = ();
foreach $element (@array1, @array2) { $count{$element}++ }
foreach $element (keys %count) {
push @union, $element;
push @{ $count{$element} > 1 ? \@intersection : \@difference }, $element;
}
Note that this is the *symmetric difference*, that is, all elements in
either A or in B but not in both. Think of it as an xor operation.
-
Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short. They represent an important
part of the Usenet tradition. They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.
If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile. If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.
Answers to questions about LOTS of stuff, mostly not related to
Perl, can be found by pointing your news client to
news:news.answers
or to the many thousands of other useful Usenet news groups.
Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release. It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.
The perlfaq manual page contains the following copyright notice.
AUTHOR AND COPYRIGHT
Copyright (c) 1997-1999 Tom Christiansen and Nathan
Torkington. All rights reserved.
This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.
04.41
--
This space intentionally left blank
------------------------------
Date: 1 Aug 2001 19:02:15 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: FAQ: What is the difference between $array[1] and @array[1]?
Message-Id: <996692516.29692@itz.pp.sci.fi>
In article <tmf4r4gdj9o6b1@corp.supernews.com>, Chris Stith wrote:
>PerlFAQ Server <faq@denver.pm.org> wrote:
>> +
>> What is the difference between $array[1] and @array[1]?
>
>Could this FAQ snippet ________PLEASE________ be removed from
>the autopost rotation? If not now, at least when Perl 6 is
>closer to release? Otherwise, I fear a whole bunch of confusion
>due to the information listed.
Well, it could be amended to say that this will change in Perl 6.
--
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real! This is a discussion group, not a helpdesk. You post something,
we discuss its implications. If the discussion happens to answer a question
you've asked, that's incidental." -- nobull in comp.lang.perl.misc
------------------------------
Date: Wed, 01 Aug 2001 22:04:17 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: FAQ: What is the difference between $array[1] and @array[1]?
Message-Id: <tmgv71p1ekah17@corp.supernews.com>
Ilmari Karonen <iltzu@sci.invalid> wrote:
> In article <tmf4r4gdj9o6b1@corp.supernews.com>, Chris Stith wrote:
>>PerlFAQ Server <faq@denver.pm.org> wrote:
>>> +
>>> What is the difference between $array[1] and @array[1]?
>>
>>Could this FAQ snippet ________PLEASE________ be removed from
>>the autopost rotation? If not now, at least when Perl 6 is
>>closer to release? Otherwise, I fear a whole bunch of confusion
>>due to the information listed.
> Well, it could be amended to say that this will change in Perl 6.
This is probably the best fix. We don't want to mess people up who
will still be using 5.6.0 three years from now. We do want to make
sure people who move to 6 have a smooth transition, though.
Chris
--
People understand instinctively that the best way for computer programs to
communicate with each other is for each of the them to be strict in what they
emit, and liberal in what they accept. The odd thing is that people themselves
are not willing to be strict in how they speak, and liberal in how they listen.
-- Larry Wall, 2nd State of the Onion Address, August 1998
------------------------------
Date: Wed, 1 Aug 2001 23:08:02 +0200
From: "Steffen Müller" <tsee@gmx.net>
Subject: Re: Help with an array and foreach
Message-Id: <9k9r2j$o82$05$1@news.t-online.com>
"Godzilla!" <godzilla@stomp.stomp.tokyo> schrieb im Newsbeitrag
news:3B65EB45.11FE9BAB@stomp.stomp.tokyo...
> I don't cotton much to your email address; it sends a poor message.
> Shouldn't your address be, ganjaman@bong.net ?
Not that people care to send you mail, but do you think
godzilla@stomp.stomp.tokyo is a valid address? Shouldn't one provide a valid
mail address?
What is your problem with... *everyone*?
Steffen Müller
------------------------------
Date: 1 Aug 2001 14:47:22 -0700
From: john.stumbles@ntlworld.com (John Stumbles)
Subject: Re: how to find free disk space (Win32)
Message-Id: <7f40850b.0108011347.170d1d3f@posting.google.com>
Paul Johnston <paul.johnston@dsvr.co.uk> wrote in message news:<3B67E26A.9958A6BC@dsvr.co.uk>...
> Hi,
>
> > In general this seems to be a rather glaring omission from perl's
> > generally overflowing toolkit of system admin resources :-( Any ideas?
>
> Then how about adding your Windows code to CPAN's Filesys::DiskFree
> which works for several versions of Unix?
>
> There is in fact a portable way to determine the amount of free disk
> space - keep writing to a file until the disk fills up! Not recommended
> though, and will not work if quotas are enabled.
>
> Some operating systems (e.g. FreeBSD) deliberately lie about the amount
> of free space, to save 8% or so of the disk for emergencies.
>
> Paul
Thanks, I hadn't come across Filesys::DiskFree - in fact I hadn't come
across the Filesys root. I'd browsed rather than searched CPAN - I
couldn't think of an appropriate term to search for (duh :-)
I'll drop an email to the gorilla about incorporating my miserable
hack into his glorious module :-)
regards
--
John Stumbles
www.stumbles.org/John
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
------------------------------
Date: Wed, 01 Aug 2001 20:52:05 GMT
From: valkos67@netzero.com (valkos)
Subject: Re: is there a windows installer for perl ?
Message-Id: <3b686bac.51741530@news.dsuper.net>
There are two versions of it for windows, one is visual perl that I
used for a bit and the active perl. One is like using visual C++ and
the other you just use note pad. One has a GUI and the other doesn't
On Wed, 13 Jun 2001 15:21:43 +0800, "ivan markose"
<ivanmarkose@hotmail.com> wrote:
>I'd like to know if there is a package to install perl
>on windows, not binaries that I don't know the head
>or tail of. I found this very good book - Mastering
>algorithms with Perl that I would like to learn from.
>Again what I have in mind is along the lines of
>the python installer for windows.
>
>Thanks
>Ivan Markose
>
>
>
>
------------------------------
Date: 1 Aug 2001 13:00:07 -0700
From: demerphq@hotmail.com (Yves Orton)
Subject: Re: join lines ?
Message-Id: <74f348f7.0108011200.3ec20805@posting.google.com>
"Godzilla!" <godzilla@stomp.stomp.tokyo> wrote in message news:<3B681193.37E104F5@stomp.stomp.tokyo>...
> Tim wrote:
>
> > Godzilla! wrote:
> > > Tim wrote:
>
> (snipped)
>
> > > Post your code you have developed so far,
> > > working or not, to show sincere effort on
> > > your part. My preference is to help those
> > > who help themselves.
Sorry Lizard Lady, dont you mean berate those who do or dont help
themselves?
> > Below is my code, Could you please give me some suggestions to make it "better" ?
Nice quotes Tim. :-)
>
> This second article of yours contradicts your original parameters
> stated in your first article. You will do both yourself and the
> reader a benefit by not changing your parameters with each posted
> article. I find this to be exceptionally annoying and hints at
> a deliberate troll effort.
Or a particularly obtuse lizard. It was pretty clear to me what he
was up to. Although he didnt express rules for handling various chars
in his input he probably left them out as he felt he could handle them
without help.
> For my test script below my signature, my chain2.txt is a precise
> duplicate of your data as you posted; exact copy / paste method.
But you didnt stick it in a DATA block to make it easier to run did
you?
> As you know, your code compiles, runs and fails to generate
> the output you desire. It prints "scan length is" only.
Sorry lizard but the code he submitted worked fine on my box.
Holy moly are you sanctimonious or what.
<SNIP CONDESCENDSION>
>..... To exemplify this notion, my script was
> developed in more than a dozen stages before being finalized.
WHAT!?!? A dozen stages? Sheesh. Originally I thought that maybe you
were a decent programmer with a bad attitude. Now I realize you are a
lame programmer with a bad attitude.
> Here are some comments which may assist your thinking and your logic.
> These comments closely reflect each stage of my script development.
<SNIP MORE LIZARD SHAVING CREAM>
> My personal opinion is doing this smacks of a troll,
> whom I would dearly enjoy smacking around.
Please. Get a life.
------------------------------
For Tim:
On to helping with no insults or condescension. (Or at least none that
are intentional :-)
While Lizard Ladys code does work, here's a different tactic with a
few comments sprinkled in. I left out removing various chars and
other admin type details as you didn't really spec em out and they
distract from the essential points.
Analysis:
Basically what you are loking at doing is joining up split long lines
as marked by a "\" and then processing them. (Have a trawl through the
Faqs and I think you'll find this one as an exercise, what I've done
is derived from there)
Oh and a few points (I cant relate them direct to your mail as I
decided on roast lizard for dinner :-)
1. Use the "my" keyword whenever you can.
2. Always use strict and warnings
3. Perl like C and others has a great way to say $var=$var+1; its
$var++;
4. Use a DATA block for test work. Saves hassle.
5. $_ is the local register variable, a good chunk of the perl
keywords will default to it when no parameter is provided, such as the
s/// m// tr/// operators.
So enough lecturing (sorry if you knew this stuff already)
Yves
#!perl
use strict;
use warnings;
my $line="";
while (<DATA>) {
#Begin standard tactic for putting split lines back together
chomp; # lose the newlines
s/^\s*//g; # lose leading spaces (notice implicit $_=~)
my $r=s/\\\s*$//; # lose trailing \ and spaces (notice implicit
$_=~)
$line.=$_; # cat to our $line
next if $r; # there was a trailing \ so we aren't done our 'line'
#End tactic...
#so by now we have a "line" that should be in the format
# bareword "quotedword" = "value";
# so we can use a nice easy rex to pull it apart...
#use named vars instead of $1 $2 $3 etc...
if (my ($bare,$quoted,$value)=(
$line=~/^ #begining of string
(\w+) #a bareword
\s+ #one or more spaces
"(\w+)" #quoted word
\s*=\s* #= w/ opt. spaces
"(\w+)"; #quoted word followed by a semicolon
$ #end of string
/x)) { #extended rex syntax for readability
print "$bare $quoted = \""
.join(",",split(//,$value))."\";\n";
} else {
die "The following line (last line of input was $.) failed to match
pattern:\n$line\n";
}
$line=""; # reset the $line for the next pass!
}
__DATA__
chain "chain1" = "00110011001100110011001100110011001100110011001100\
11001100110011001100110011001100110011001100110011\
00110011001100110011001100110011001100110011001100\
11001100110011001100110011001100110011001100110011\
00110011001100110011001100110011001100110011001100\
11001100110011001100110011001100110011001100110011\
00110011001100110011001100110011001100110011001100\
11001100110011001100110011001100110011001100110011\
00110011001100110011001100110011001100110011001100\
1100110011001100110011001100110011001100110";
chain "chain2" = "X0011001100110011001100110011001100110011001100110\
01100110011001100110011001100110011001100110011001\
10011001100110011001100110011001100110011001100110\
01100110011001100110011001100110011001100110011001\
10011001100110011001100110011001100110011001100110\
01100110011001100110011001100110011001100110011001\
10011001100110011001100110011001100110011001100110\
01100110011001100110011001100110011001100110011001\
10011001100110011001100110011001100110011001100110\
0110011001100110011001100110011001100110011";
chain "chain3" = "X0011001100110011001100110011001100110011001100110\
01100110011001100110011001100110011001100110011001\
10011001100110011001100110011001100110011001100110\
01100110011001100110011001100110011001100110011001\
10011001100110011001100110011001100110011001100110\
01100110011001100110011001100110011001100110011001\
10011001100110011001100110011001100110011001100110\
01100110011001100110011001100110011001100110011001\
10011001100110011001100110011001100110011001100110\
01100110011001100110011001100110011001100AH";
------------------------------
Date: Wed, 01 Aug 2001 16:44:20 -0400
From: Dave VP <me@my_no_spam.org>
Subject: Re: join lines ?
Message-Id: <3B686A24.1EA180A3@my_no_spam.org>
"Godzilla!" wrote:
>
> Godzilla! wrote:
>
> > Tim wrote:
> > > Godzilla! wrote:
> > > > Tim wrote:
>
> (snipped)
>
> > local ($");
>
> > Localize and null the array list separator to avoid
> > a need to foreach loop print elements; no spaces.
>
>
> > sub Clean_Up
> > {
> > local ($/) = ";";
> > local ($");
>
> > print "$line_title", @Array, "\";\n\n";
>
> I need to amend my code although it works fine. There
> is a bit of inefficiency incorporated.
>
> My use of local ($") can be removed based upon the
> syntax I use for my print statement.
>
> An alternative is to leave my local ($") and change
> my print statement to,
>
> print "$line_title@Array\";\n\n";
>
> This was my original intent for my print statement.
> However, I neglected to change my print statement
> during stage development and script finalization.
>
> Either or, your choice; both work fine.
>
> Godzilla!
Works great!
D:\source\Perl\test>perl D:\source\Perl\test\g.pl
Use of uninitialized value at D:\source\Perl\test\g.pl line 25, <INFILE>
chunk 1.
Use of uninitialized value at D:\source\Perl\test\g.pl line 25, <INFILE>
chunk 2.
Use of uninitialized value at D:\source\Perl\test\g.pl line 25, <INFILE>
chunk 3.
Modification of non-creatable array value attempted, subscript -1 at
D:\source\Perl\test\g.pl line 23, <INFILE> chunk 4.
Content-type: text/plain
chain "chain1" =
"0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0";
<remainder of program output snipped>
------------------------------
Date: Wed, 01 Aug 2001 21:08:06 GMT
From: "Ryan Gralinski" <ryan@bong.net>
Subject: Matching Strings in an array
Message-Id: <Wc_97.61683$d26.508896@news1.wwck1.ri.home.com>
Hey I have another question, its probably pretty simple
i have some code like this:
foreach $cname (@covers)
{
if($cname =~ @words){do this..}
}
i need to match if every element of @words is in $cname
please help,
RYan
------------------------------
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 1423
***************************************