[7788] in Perl-Users-Digest
Perl-Users Digest, Issue: 1413 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Dec 5 05:07:34 1997
Date: Fri, 5 Dec 97 02:00:29 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 5 Dec 1997 Volume: 8 Number: 1413
Today's topics:
001 + 1 = 002; 002 - 1 = 1 ARGH (Roy S. Rapoport)
dbm denial from within a library <stk3364@stockton.edu>
Re: Driving an FTP session from Perl... <gbarr@ti.com>
Re: Forced to use brain-dead perl 4 -- how do I accompl (Brian Wheeler)
Re: Forced to use brain-dead perl 4 -- how do I accompl (I R A Aggie)
Re: Getting rid of non-Y2K Perl4 (was Re: Pattern match <rootbeer@teleport.com>
Re: grep (Mike Stok)
Re: help for a perl beginner! <rootbeer@teleport.com>
Re: help for a perl beginner! <rootbeer@teleport.com>
Re: HELP ME!!! <barnett@houston.Geco-Prakla.slb.com>
How do I print all but the first variable in an array? (James Zubin Pope)
Re: How do I print all but the first variable in an arr <tycage@infi.net>
Re: How do I print all but the first variable in an arr (Jim Allenspach)
Re: Pattern matching (or not....) <barnett@houston.Geco-Prakla.slb.com>
Perl Marketing Position with O'Reilly johnb@oreilly.com
Re: perl script <rootbeer@teleport.com>
Perl scripts to lookout for?? (zentara)
PERL under SCO 5.0.4 and chat2.pl <broomberg@ccgroupnet.com>
Perl4 is not Y2K (was Re: Forced to use brain-dead perl <merlyn@stonehenge.com>
Re: Please help again :( forget to attach the file <rootbeer@teleport.com>
Using regular expression on strings not in $_ (Narayan Moni)
Re: Using regular expression on strings not in $_ <tycage@infi.net>
Re: Using regular expression on strings not in $_ (brian d foy)
WANTED: A PERL script to verify an ASCII list of URLs f ah262@detroit.freenet.org
Re: WANTED: A PERL script to verify an ASCII list of UR (brian d foy)
Re: Windows 95 flock problem (hapless newbie question) <ryan@ramresearch.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 3 Dec 1997 11:37:53 -0800
From: rsr@best.com (Roy S. Rapoport)
Subject: 001 + 1 = 002; 002 - 1 = 1 ARGH
Message-Id: <664ceh$2n9$1@shell3.ba.best.com>
Gosh, was that clear enough? :)
I'm trying to do a log rotation program that takes as one of its args the
type of suffix you should have on the file. For example, if given 001, it
should then rotate files to
file -> file.001
file.001 -> file.002
etc.
Now, going up is great -- Perl is wonderful in doing 'the right thing' (I think
it's the right thing, at least) and, when given 001 + 1, returning 002.
The problem is that I haven't found a way to do 002 - 1 = 001. In other words,
given
$a = "001" ;
$a++ ;
$a is now equal to "002"; but if I now do
$a-- ;
$a is now equal to 1!
Any way around it?
-roy
------------------------------
Date: Wed, 03 Dec 1997 14:13:32 -0500
From: Wolf <stk3364@stockton.edu>
Subject: dbm denial from within a library
Message-Id: <3485AF5C.5EF856E7@stockton.edu>
. In my effort to learn CGI programming, I am writing an
authentication script (actually 3, "login", "change user", and
"register". I'm also using cgi-lib.pl). I was trying to do something
similar to what the new york times has on their entry page, where the
authentication process uses cookies for the convenience of the user. I
use a dbm file to store the registration information of each user, and
the cookies so that they don't have to log on every time they enter the
site. The problem occurs when they can't or won't use cookies. Then, as
they move around within the site, they're asked to login at each new
page. So I thought that I might pass a value out of the script, to
create a session variable (or something like a session variable).
Presently, I've tried to make the scripts into library files; which
works well on the "login", and "change user" scripts, but not on the
"registration" script, which writes to a dbm file. When the
"registration" script tries to write to the dbm file it chokes (Internal
Server Error); when I remove the line where it writes to the dbm file,
it works just fine. I've even tried writing to a text file as well, and
although the script doesn't choke, it doesn't write to the text file
either. The scripts are combo-forms, printing their own html forms, and
then processing them. Interestingly, if I load the form with data so
that it doesn't output it's form, but instead processes the internal
data on the first pass, and invoke it from the command line, then it
works fine -- meaning, it writes to the database and terminates normally
(Actually I invoke the script that calls it as a sub routine).
Accessing the script with that same set up through the browser chokes
like normal -- (error 500).
If my approach to the problem is flawed, I would still like to know
why writing to a file conflicts with the CGI, or is it CGI, is it
possible that it's writing from a library?
IAC all comments are welcome.
Wolf
10q
------------------------------
Date: Wed, 03 Dec 1997 13:17:07 -0600
From: Graham Barr <gbarr@ti.com>
To: mgousset@nmhs.net
Subject: Re: Driving an FTP session from Perl...
Message-Id: <3485B033.CD2CCDC5@ti.com>
Mickey Gousset wrote:
>
> Hey!
>
> I was wondering if you can drive an FTP session using perl. What I need
> to do is ftp to a site, enter my login id and password, do a directory
> listing of the site, and then check that directory listing for a file.
>
> Does anyone have any suggestions on how to do this?
There is a perl5 module called Net::FTP which will allow you
to do this. It is part of the libnet distribution. YOu can
find if on CPAN http://www.perl.com/CPAN/authors/id/GBARR/
Graham.
--
Originality is the ability to conceal your source.
------------------------------
Date: 3 Dec 1997 18:48:39 GMT
From: bdwheele@indiana.edu (Brian Wheeler)
Subject: Re: Forced to use brain-dead perl 4 -- how do I accomplish task that is simple in perl 5 ?
Message-Id: <6649i7$oip$1@dismay.ucs.indiana.edu>
In article <66441v$rb5@news-central.tiac.net>,
mike@stok.co.uk (Mike Stok) writes:
> In article <-0312970936200001@aggie.coaps.fsu.edu>,
> I R A Aggie <fl_aggie@thepentagon.com> wrote:
>
>>1. perl4 is CERTifiably insecure
>>2. perl4 is not y2k compliant
>
> Please tell me how perl 4 is not Y2K compliant where perl 5.xxx is Y2K
> compliant. I have scanned the perldelta for references to 2000 and Y2K
> and don't see any. Does this mean that perl 5.xxx is not y2k compliant
> too?
>
> While I have some sympathy for encouraging people to get with the times,
> using FUD as a justification seems dubious at best.
To my knowledge, there is *nothing* in perl4 that makes it not
y2k compliant. People mistake the year return from localtime to be a two
digit year...if they'd read the man pages, they'd find out its # years after
1900. So, year 2000=100. No problems there. Perl5 acts the same way.
Of course that's not saying that people aren't writing a non y2k
compliant app (one of mine goes goofy in 2093 :)
>
> Mike
------------------------------
Date: Wed, 03 Dec 1997 14:34:17 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Forced to use brain-dead perl 4 -- how do I accomplish task that is simple in perl 5 ?
Message-Id: <-0312971434170001@aggie.coaps.fsu.edu>
In article <66441v$rb5@news-central.tiac.net>, mike@stok.co.uk (Mike Stok)
wrote:
+ In article <-0312970936200001@aggie.coaps.fsu.edu>,
+ I R A Aggie <fl_aggie@thepentagon.com> wrote:
+
+ >1. perl4 is CERTifiably insecure
+ >2. perl4 is not y2k compliant
+
+ Please tell me how perl 4 is not Y2K compliant
Seems Randal has been fishing. Please pardon me whilst I remove this
hook...
James
--
Consulting Minister for Consultants, DNRC
Support the anti-Spam amendment <url:http://www.cauce.org/>
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>
------------------------------
Date: Wed, 3 Dec 1997 11:41:52 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: -=Falcon=- <Falcon@darkwave.org.uk>
Subject: Re: Getting rid of non-Y2K Perl4 (was Re: Pattern matching (or not....))
Message-Id: <Pine.GSO.3.96.971203114034.14918M-100000@usertest.teleport.com>
On Wed, 3 Dec 1997, -=Falcon=- wrote:
> Nope, our reason is that most of our software (CGI) runs on a virtual
> server, which from day 1 was running Perl 4.....all our CGI code was
> written by a contractor for that box, and subsequently in testing on
> Perl 5 had a few hiccups
That's no reason that perl5 can't be installed. Remember, you don't have
to remove perl4 to install perl5... even though that's often a good idea.
:-)
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: 3 Dec 1997 19:58:03 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: grep
Message-Id: <664dkb$59q@news-central.tiac.net>
In article <34859D17.833DAEB3@planetpod.com>,
Stewart Eastham <sme@planetpod.com> wrote:
>I am trying to enter an item into a list. First I check to remove it
>from the list if it was already on it. Then I add it, sort the list,
>and print it out to a file. For some reason with the code below, it
>just adds the item to the list and doesn't remove any previous entries
>with the same name. It also does not sort the list.
>
>Here is my code:
>
># prevent from having the same entry several times
>$entry = "$userName:$password\n";
>@entries = grep(!/^$userName:/, @entries);
>print PASS sort(@entries, $entry);
One way to do it might be to use a hash where the key is the user name and
the value is the password e.g.
$password{$user} = $password;
will automatically create or replace the entry for you, and then you can
write it out like this
foreach $user (sort keys %password) {
print PASS "$user:$password{$user}\n";
}
Your code looks reasonable as far as I can see, was PASS opened OK? Have
you tried it in the debugger?
DB<1> @entries = ('a:b', 'c:d', 'e:f')
DB<2> $userName = 'c'; $entry = 'c:D'
DB<3> @entries = grep(!/^$userName:/, @entries)
DB<4> X entries
@entries = (
0 'a:b'
1 'e:f'
)
DB<5> print join ' ', sort(@entries, $entry)
a:b c:D e:f
Are there any "odd" (e.g. meta) characters in the user name?
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: Wed, 3 Dec 1997 11:29:46 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Joe Ng <ngyat@isu.edu>
Subject: Re: help for a perl beginner!
Message-Id: <Pine.GSO.3.96.971203112857.14918I-100000@usertest.teleport.com>
On Tue, 2 Dec 1997, Joe Ng wrote:
> open(MYFILE, $infilename);
> open(MYOUTFILE,$outfilename);
That's not going to open a file for output.
Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.
Cheers!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Wed, 3 Dec 1997 11:30:53 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Jim Bowlin <bowlin@sirius.com>
Subject: Re: help for a perl beginner!
Message-Id: <Pine.GSO.3.96.971203113034.14918J-100000@usertest.teleport.com>
On Wed, 3 Dec 1997, Jim Bowlin wrote:
> open(OUT, ">$outfilename");
Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Wed, 03 Dec 1997 12:38:40 -0600
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Re: HELP ME!!!
Message-Id: <3485A72E.6346F3EB@houston.Geco-Prakla.slb.com>
Depending on what you flavor of OS you need Perl for, everything you
need should be available from:
http://language.perl.com/info/software.html
http://www.perl.com is also a good page to bookmark/remember. You
should be able to find all things Perl from this starting point.
:-)
Dave
--
"Security through obscurity is no security at all."
-comp.lang.perl.misc newsgroup posting
------------------------------------------------------------------------
* Dave Barnett U.S.: barnett@houston.Geco-Prakla.slb.com *
* DAPD Software Support Eng U.K.: barnett@gatwick.Geco-Prakla.slb.com *
------------------------------------------------------------------------
------------------------------
Date: Wed, 03 Dec 1997 18:41:07 GMT
From: jzp@usa.net (James Zubin Pope)
Subject: How do I print all but the first variable in an array?
Message-Id: <3487a7be.28527677@news.demon.co.uk>
Hi there,
I am fairly new to perl and this is the situation I am in. I need to
be able to print all but the first variable in a regular array. Do I
make sense? Basically I have an array of:
@stuff
and I want to print $stuff[1] and $stuff[2] and $stuff[3] etc BUT NOT
$stuff[0].
Is there a simple way of doing this? To make it more difficult is the
fact that the pieces of data in the array are changing so it will not
necessarily be the last 'x' amount in the array.
Any suggestions?
Cheers,
James.
P.S. Could you forward any replies to my email aswell? Ta.
------------------------------
Date: Wed, 03 Dec 1997 14:08:12 -0500
From: Ty Cage Warren <tycage@infi.net>
Subject: Re: How do I print all but the first variable in an array?
Message-Id: <3485AE1C.16739FE7@infi.net>
[CCed to email]
James Zubin Pope wrote:
>
> Hi there,
>
> I am fairly new to perl and this is the situation I am in. I need to
> be able to print all but the first variable in a regular array. Do I
> make sense? Basically I have an array of:
>
> @stuff
>
> and I want to print $stuff[1] and $stuff[2] and $stuff[3] etc BUT NOT
> $stuff[0].
Something along the lines of
print @stuff[1..$#stuff];
would work, but if the array was really big it would be ineffecient
since .. has
to generate an array with all the member in it first.
You could do a loop like this
for ($i =1;$i<=$#stuff;$i++) {
print $stuff[$i];
}
which might be a better general solution, becuase you could replace the
print
with anything you want to do the the array.
Anyway, $#stuff is the index of the last element of the array.
Hope this helps,
Ty
--
+---+
Ty Cage Warren tycage@infi.net
Systems Engineer InfiNet
The Web Site of Love: http://tazer.engrs.infi.net/mst3k/
PGP Public Key: http://tazer.engrs.infi.net/~tycage/pgpkey.html
PGP Fingerprint: FF C1 28 CA 80 B5 31 78 B1 24 2E 8C AB DA FB D2
------------->Never invoke anything bigger than your head.<-------------
------------------------------
Date: 3 Dec 1997 13:22:57 -0600
From: jima@REMOVE.ME.mcs.com (Jim Allenspach)
Subject: Re: How do I print all but the first variable in an array?
Message-Id: <664bih$jut$1@Mars.mcs.net>
>I am fairly new to perl and this is the situation I am in. I need to
>be able to print all but the first variable in a regular array.
@arr = (7, 24, -13, 99, 101, 54);
# method 1
foreach (1 .. $#arr) { print "$arr[$_] "; } print "\n";
# method 2
$x = 1; while ($x <= $#arr) { print $arr[$x], " "; ++$x; } print "\n";
# method 3
print join(' ',@arr[1 .. $#arr]), "\n";
Hope this helps...
jma
--
#!/usr/bin/perl -- jim allenspach (jima at mcs dot com)
print join(' ',map{$_ if!s/(.+)-(.*)ay(.*)/$2$1$3/||s/^([a-z])([A-Z])
/\u$1\l$2/x||1}split(/ /,"Ust-jay another-ay Erl-pay acker-hay,\n"));
------------------------------
Date: Wed, 03 Dec 1997 13:21:23 -0600
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
To: Falcon@darkwave.org.uk
Subject: Re: Pattern matching (or not....)
Message-Id: <3485B131.FA794B35@houston.Geco-Prakla.slb.com>
--------------B6145885B20878CA60E24C63
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
-=Falcon=- wrote:
> With Perl4 (yes I know it's not 5, but what can you do when the
> management
> won't upgrade?) why won't a simple m// style pattern match NOT find ++
> chars?
>
> With a substring
>
> $word = "C++";
>
> And a larger string
>
> $Description = "This is a test to find and match C++ in a large string";
>
> Why doesnt
>
> if ($Description =~ /$word/i) {
I ran the above on perl 4.0.1.7 (really old, but the only perl 4.x I have access
to), with perl -w switch.
It gave me the error:
/c++/: nested *?+ in regexp at junk2 line 5.
Do you get that? I got the same error under perl 5.004_01.
I had to double back-quote the + signs. + is a meta-characters to regex, so it
must be escaped in order to match it.
By making $word = "C\\+\\+", $word gets set as "C\+\+", and then passes through
the regex, and gets the results you want.
Under perl 5.x, you can instead say:
if ($Description =~ /\Q$word/i) {
This causes the "++" characters in $word to not be interpreted or acted on
(except as normal characters).
HTH.
Dave
--
"Security through obscurity is no security at all."
-comp.lang.perl.misc newsgroup posting
------------------------------------------------------------------------
* Dave Barnett U.S.: barnett@houston.Geco-Prakla.slb.com *
* DAPD Software Support Eng U.K.: barnett@gatwick.Geco-Prakla.slb.com *
------------------------------------------------------------------------
--------------B6145885B20878CA60E24C63
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<HTML>
-=Falcon=- wrote:
<BLOCKQUOTE TYPE=CITE>With Perl4 (yes I know it's not 5, but what can you
do when the
<BR>management
<BR>won't upgrade?) why won't a simple m// style pattern match NOT find
++
<BR>chars?
<P>With a substring
<P>$word = "C++";
<P>And a larger string
<P>$Description = "This is a test to find and match C++ in a large string";
<P>Why doesnt
<P>if ($Description =~ /$word/i) {</BLOCKQUOTE>
I ran the above on perl 4.0.1.7 (really old, but the only perl 4.x I have
access to), with perl -w switch.
<P>It gave me the error:
<BR>/c++/: nested *?+ in regexp at junk2 line 5.
<P>Do you get that? I got the same error under perl 5.004_01.
<P>I had to double back-quote the + signs. + is a meta-characters
to regex, so it must be escaped in order to match it.
<P>By making $word = "C\\+\\+", $word gets set as "C\+\+", and then passes
through the regex, and gets the results you want.
<P>Under perl 5.x, you can instead say:
<BR>if ($Description =~ /\Q$word/i) {
<P>This causes the "++" characters in $word to not be interpreted or acted
on (except as normal characters).
<P>HTH.
<P>Dave
<BR>
<PRE>--
"Security through obscurity is no security at all."
-comp.lang.perl.misc newsgroup posting
------------------------------------------------------------------------
* Dave Barnett U.S.: barnett@houston.Geco-Prakla.slb.com *
* DAPD Software Support Eng U.K.: barnett@gatwick.Geco-Prakla.slb.com *
------------------------------------------------------------------------</PRE>
</HTML>
--------------B6145885B20878CA60E24C63--
------------------------------
Date: Wed, 03 Dec 1997 13:03:55 -0600
From: johnb@oreilly.com
Subject: Perl Marketing Position with O'Reilly
Message-Id: <881175361.11744@dejanews.com>
We currently have an opening in our Sebastopol, California office for a
full-time Perl Marketing Specialist, located in our Software Sales and
Marketing Department.
The overall goal of this position is to bring more visibility to the Perl
language through the promotion of Perl events -- such as O'Reilly's Perl
Conference -- and development of businesses relationships with other key
players in the Perl community.
A detailed position description and information on how to apply can be
found at http://www.oreilly.com/oreilly/jobs/perl.html.
John Blaber
O'Reilly & Associates
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Wed, 3 Dec 1997 11:47:06 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Paul Peters <paul.peters@ica.unimaas.nl>
Subject: Re: perl script
Message-Id: <Pine.GSO.3.96.971203114223.14918N-100000@usertest.teleport.com>
On Wed, 3 Dec 1997, Paul Peters wrote:
> Subject: perl script
Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
> Can anyone tel me why the next script works on a UNIX system but not on
> Windoes NT
>
> $dirname="\.";
What's that backslash doing there?
> opendir( dir , $dirname) || die "directory <$dirname> bestaat niet.";
It's generally preferred to use all caps for filehandles and directory
handles. Also, including the magical $! variable in your die() message is
often helpful.
> while ($filename=readdir(dir))
Recent versions of Perl can warn you that readdir could return "0",
causing that loop to prematurely terminate. This is better.
while (defined($filename=readdir(DIR))) {
> {
> if (-d $filename )
Note that this is looking for $filename in the current directory, which
may or may not be the same one as $dirname. (Of course, if $dirname is
'.', then that's probably fine... :-)
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Thu, 04 Dec 1997 06:15:30 GMT
From: zentara@mindspring.com (zentara)
Subject: Perl scripts to lookout for??
Message-Id: <34864924.3475633@news.mindspring.com>
Hi,
I'm looking at PERL as the best language to spend time learning.
As I'm inclined to do, I will probably download a bunch of scripts
to see how they run.
What should I look for in the scripts as a general indicator of
"virus-like shenanigans"? Since I don't know the language yet,
it would be nice to know a few "code snippets" to be on the
look out for.
Does the perl program have built protection against
malicious code? I would guess if I'm running it as
a user under Linux I'm pretty safe. BUT what happens if I try to run
them under the win95 or dos version of PERL?
Am I worrying about nothing?
------------------------------
Date: Wed, 03 Dec 1997 19:05:21 GMT
From: "Barry Roomberg" <broomberg@ccgroupnet.com>
Subject: PERL under SCO 5.0.4 and chat2.pl
Message-Id: <01bd0026$96b2cf20$5e5667cf@red_dwarf_ii.ccgroupnet.com>
Has anyone got CHAT2.PL working under SCO 5.0.4?
I'd MUCH rather code my task in PERL than EXPECT.
I've hacked the ptty search logic to actually find
the ttys, it allocates, and SEEMS to run, but always
gets an immediate EOF when attempting to read from ANY application.
Any ideas?
Thanks.
------------------------------
Date: 03 Dec 1997 12:09:04 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: mike@stok.co.uk (Mike Stok)
Subject: Perl4 is not Y2K (was Re: Forced to use brain-dead perl 4 -- how do I accomplish task that is simple in perl 5 ?)
Message-Id: <8cg1oatfan.fsf_-_@gadget.cscaper.com>
>>>>> "Mike" == Mike Stok <mike@stok.co.uk> writes:
Mike> In article <-0312970936200001@aggie.coaps.fsu.edu>,
Mike> I R A Aggie <fl_aggie@thepentagon.com> wrote:
>> 1. perl4 is CERTifiably insecure
>> 2. perl4 is not y2k compliant
Mike> Please tell me how perl 4 is not Y2K compliant where perl 5.xxx is Y2K
Mike> compliant. I have scanned the perldelta for references to 2000 and Y2K
Mike> and don't see any. Does this mean that perl 5.xxx is not y2k compliant
Mike> too?
Mike> While I have some sympathy for encouraging people to get with the times,
Mike> using FUD as a justification seems dubious at best.
But it works!
As I've already reported, my first *joking* reference to "Perl4 is not
Y2K" was echoed back to me a mere three weeks later when one of my
students said "we're cutting everything over to Perl5 because
Perl4 is not Y2K". I nearly died laughing, but I tried to calmly ask
him "just what part isn't" and they said "I dunno, it's just an order
from my boss".
So, for all the pointy-hair managers out there, just keep repeating
"I've heard that Perl4 is Not Y2K". Who cares if it's an unprovable
rumor? It seems to be having Exactly the Right Effect!
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 271 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Wed, 3 Dec 1997 11:40:01 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Ahmet Ayvaz <ayvaz@weborigins.com>
Subject: Re: Please help again :( forget to attach the file
Message-Id: <Pine.GSO.3.96.971203113823.14918L-100000@usertest.teleport.com>
On 3 Dec 1997, Ahmet Ayvaz wrote:
> Subject: Please help again :( forget to attach the file
Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
> Can somebody tell me what the problem is with this script.
> begin 600 example1.pl
> M(R$O=7-R+VQO8V%L+V)I;B]P97)L( T*(V5X86UP;&4Q+G!L#0H-"FEF("@D
Yes: It's not written in Perl; it seems to be in some sort of code. :-)
Try decoding it and post it again; that'll save the time of the people who
want to help you. Thanks!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Wed, 03 Dec 97 18:33:44 GMT
From: moni@****platinum.com (Narayan Moni)
Subject: Using regular expression on strings not in $_
Message-Id: <6648q7$ips$1@news.platinum.com>
Hi Perl gurus,
I have a question for you. How can I use regular expressions to parse a string
which is not in $_. I have a string in $A (lets suppose) and I want to find
the second field when the field separator is ";". Now how would I go about
doing this.
You could either mail me at nmoni@hotmail.com or post to this newsgroup.
Thanks a bunch.
Sincerely
Anish.
Sincerely,
Anish Moni Tel: 281/579-5535
PLATINUM Technology, Inc. Fax: 281/492-0725
Houston TX 77077 Email: moni@platinum.com
Thought for the day:
A "cast" helps something that is broken, to limp along.
-- Bjarne Stroustrup
------------------------------
Date: Wed, 03 Dec 1997 13:55:36 -0500
From: Ty Cage Warren <tycage@infi.net>
Subject: Re: Using regular expression on strings not in $_
Message-Id: <3485AB28.6CA39809@infi.net>
[CCed to e-mail also]
Narayan Moni wrote:
>
> Hi Perl gurus,
>
> I have a question for you. How can I use regular expressions to parse a string
> which is not in $_. I have a string in $A (lets suppose) and I want to find
> the second field when the field separator is ";". Now how would I go about
> doing this.
For the regex question, you need to use the =~ operator. i.e.
$A =~ /regex/;
see the perlop and perlre man pages.
However, if you have a string with a field separator I'd recommend using
split and taking an array slice to get the fields you need. i.e.
($secondfield) = (split(/;/,$A))[1]; # 1 is the second field, 0 is the
first.
See the perlfunc man page for more info on split.
Hope this helps,
Ty
--
+---+
Ty Cage Warren tycage@infi.net
Systems Engineer InfiNet
The Web Site of Love: http://tazer.engrs.infi.net/mst3k/
PGP Public Key: http://tazer.engrs.infi.net/~tycage/pgpkey.html
PGP Fingerprint: FF C1 28 CA 80 B5 31 78 B1 24 2E 8C AB DA FB D2
------------->Never invoke anything bigger than your head.<-------------
------------------------------
Date: Wed, 03 Dec 1997 14:15:12 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Using regular expression on strings not in $_
Message-Id: <comdog-ya02408000R0312971415120001@news.panix.com>
In article <6648q7$ips$1@news.platinum.com>, moni@****platinum.com (Narayan Moni) wrote:
>I have a question for you. How can I use regular expressions to parse a string
>which is not in $_. I have a string in $A (lets suppose) and I want to find
>the second field when the field separator is ";". Now how would I go about
>doing this.
use the binding operator, =~
$A =~ s/foo/bar/;
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Wed, 03 Dec 1997 13:34:09 -0600
From: ah262@detroit.freenet.org
Subject: WANTED: A PERL script to verify an ASCII list of URLs for 404 errors
Message-Id: <881177151.14531@dejanews.com>
My fellow Perl-ites:
Being a newbie to the wonderful world of Perl/Unix, and having already
examined Matt Wright's script archive, I pose to you the experts the
following question:
Does anyone have a simple PERL script that has the ability to read in a
flat file of URLs, one by one, and output a simple status report of what
the return code (specifically 404 NOT FOUND) was for each URL checked?
I have a lengthy list of URLs that I have on the web, and I'd like to
keep them updated/verified from time to time using the report of URLs
that generated a 404 error.
Thanks a million in advance!
Todd
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Wed, 03 Dec 1997 15:08:16 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: WANTED: A PERL script to verify an ASCII list of URLs for 404 errors
Message-Id: <comdog-ya02408000R0312971508160001@news.panix.com>
In article <881177151.14531@dejanews.com>, ah262@detroit.freenet.org wrote:
>Does anyone have a simple PERL script that has the ability to read in a
>flat file of URLs, one by one, and output a simple status report of what
>the return code (specifically 404 NOT FOUND) was for each URL checked?
here's a snippet from a link checker that i use - it interacts with
a database, but the network portions of the task should be the same.
using the LWP::* and HTTP::* modules make things quite easy. this
and the examples in documentation for each of these modules should
give you everything you need to know.
good luck :)
______
use LWP::UserAgent;
use HTTP::Request;
$agent = new LWP::UserAgent;
$agent->{'agent'} = 'Mozilla 5.0 Nintendo 64';
$agent->{'from'} = $admin_address;
$agent->timeout(600);
# there is a lot of database stuff here
while ( ($key, $address) = $handle->fetchrow )
{
$address =~ m|(.*)|;
my $request = new HTTP::Request 'HEAD', $1;
my $response = $agent->request($request);
my $code = $response->code;
#perhaps the server doesn't support HEAD
if ($code >= 500 )
{
$request = new HTTP::Request 'GET', $1;
$code = $response->code;
}
my $status = $code ? $code : 'NULL';
my $last_mod = $response->last_modified ?
$response->last_modified : undef;
#update() does whatever we need to do to with this
#information
my $result = update($key, $address, $status, $last_mod);
sleep(1);
}
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Wed, 3 Dec 1997 13:38:30 -0500
From: "Ryan McGuigan" <ryan@ramresearch.com>
Subject: Re: Windows 95 flock problem (hapless newbie question)
Message-Id: <6648r2$b90$1@news.fred.net>
etta wrote in message <662o5n$sqh@mtinsc02.worldnet.att.net>...
>As far as I know there is no work real work around except comment out the
>flock and hope that system sorts it out is self. I have done this and have
>had no problem when I made a counter script.
>
>etta
I once thought that wouldn't be a problem, but, it is. You're probably
losing a few counts here and there, unless you don't get much traffic. It
is really a good idea to setup some file locking mechanism, or, download a
better build of perl for win32 (which supports flock).
Go here http://www.perl.com/CPAN-local/ports/winNT/Standard/
This is, in my opinion, much better than activeware's port.
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.misc (and this Digest), send your
article to perl-users@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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 1413
**************************************