[10711] in Perl-Users-Digest
Perl-Users Digest, Issue: 4310 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 27 19:07:16 1998
Date: Fri, 27 Nov 98 16:00:18 -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, 27 Nov 1998 Volume: 8 Number: 4310
Today's topics:
Re: ADODB Problems, final adjustment <lss@shaw.wave.ca>
Re: Anti-Spam Filter - Difficult Pattern Matching Quest (I R A Aggie)
Re: Deleting GDBM file records <Tim.Potter@anu.edu.au>
Re: File diff (Alastair)
File Too Big? <sharone@kcnet.com>
Re: File Too Big? (Alastair)
Re: File Too Big? (Dana Booth)
localtime () - perl's bug ? <slepetys@homeworks.com.br>
Re: newbie NEEDS HELP <due@murray.fordham.edu>
Re: Newbie question: Executing scripts under Win95 <due@murray.fordham.edu>
None (Basil Sly Mullings)
Re: Obfuscation of perl scripts <vvolkov@benton.com>
Re: Obfuscation of perl scripts <vvolkov@benton.com>
Re: Obfuscation of perl scripts <rra@stanford.edu>
Re: Obfuscation of perl scripts (I R A Aggie)
Re: Problem with Sybase::CTlib after upgrade mpeppler@mbay.net
regex works OK but ?? <nospam.perl_rocks@hotmail.com>
Taint mode... <alcazar@netcomp.net>
Re: Taint mode... (David Jacoby)
unsubscribe (Basil S Mullings)
Re: Y2K and Programmer Denial (I R A Aggie)
Y2K work - need suggestions <please@post-it.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 27 Nov 1998 23:48:24 GMT
From: "LSS" <lss@shaw.wave.ca>
Subject: Re: ADODB Problems, final adjustment
Message-Id: <cTG72.1062$9S5.516298@news.rdc1.on.wave.home.com>
GetLastError approach was invalid. Broke down and read the docs, this is
the correct way to do this.
sub dbOpen
{
my($Cn, $Cm, $Rs, $Errors, $LoadName, $retval);
$LoadName = $_[3];
$retval = 0;
$Cn = CreateObject OLE 'ADODB.Connection';
if ( $Cn )
{
$Cn->{ConnectionTimeout} = 15;
$Cn->{CommandTimeout} = 30;
$Cm = CreateObject OLE 'ADODB.Command';
if ( $Cm )
{
$Rs = CreateObject OLE 'ADODB.Recordset';
if ( $Rs )
{
$Cn->Open($LoadName, "", "");
$Errors = $Cn->Errors();
$retval = keys %$Errors;
if ( $retval )
{
$retval = 1;
foreach $error ( keys %$Errors )
{
# If number is non zero then it is an error otherwise it is a
warning.
if ( $error->{Number} != 0 )
{
#printf("ADO Error Number: %08x\n", $error->{Number});
#printf("ADO Error Message: %s\n", $error->{Description});
$retval = 0;
}
}
if ( !$retval )
{
SetErrMsg("Unable to open ADO connection.");
}
}
else
{
$retval = 1;
}
if ( $retval )
{
$Cm->{ActiveConnection} = $Cn;
$Cm->{CommandType} = 1;
$Rs->{CursorType} = 1;
$Rs->{LockType} = 3;
$_[0] = $Cn;
$_[1] = $Cm;
$_[2] = $Rs;
}
}
else
{
SetErrMsg("Unable to create ADO recordset object.");
}
}
else
{
SetErrMsg("Unable to create ADO command object.");
}
}
else
{
SetErrMsg("Unable to create ADO connection object.");
}
return $retval;
}
------------------------------
Date: Fri, 27 Nov 1998 18:13:26 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Anti-Spam Filter - Difficult Pattern Matching Question
Message-Id: <fl_aggie-2711981813270001@aggie.coaps.fsu.edu>
In article <73jj2s$82b@dfw-ixnews5.ix.netcom.com>, "Scott Brumley"
<Scott@Brumley.com> wrote:
+ I want to do a pattern match on the common spam flag "$$$" However since
+ the $ character is an special anchor character I am having difficulty. I
+ thought I could use \$\$\$ but it does not seem to work either.
Sure, that should work...where's your code (a snippet will be fine).
Here's mine:
$subject='$$$MAKE MONEY ILLEGALLY$$$';
if ($subject=~/\$\$\$/) {
print "Spamage detected? \$\$\$ trigger\n";
}else{
print "Passes the test\n";
}
Results:
Spamage detected? $$$ trigger
HTH
James
------------------------------
Date: Sat, 28 Nov 1998 09:38:15 +1100
From: Tim Potter <Tim.Potter@anu.edu.au>
Subject: Re: Deleting GDBM file records
Message-Id: <365F29D6.A85DC91B@anu.edu.au>
Jon Drukman wrote:
> In article <36585E86.4747D72B@magma.ca>, hassan wrote:
> >The code below would "delete" all the records in a GDBM file, but
> >the file size remains almost the same!! Anybody knows why? I tried
> >to vi the "myfile" and found all the records still in there! Does
> >anybody know how I can "sure delete" GDBM file records. That is, if
> >my GDBM file is 2MB big, I want to see the size of that file
> >considerably reduced after deleting all the records.
>
> can't be done unless you copy the records you want to a new file.
> gdbm files keep their unused space allocated. in fact, most dbm
> implementations that i am aware of behave the same way.
Not true (for GDBM at least). Try the following code:
use GDBM_File;
$db = tie(%hash, "GDBM_File", "test_db", GDBM_WRITER, 0640);
$db->reorganize();
untie($db);
Tim.
> --
> Jon Drukman jsd@gamespot.com
> -----------------------------------------------------------------------
> Fear the government that fears your computer.
------------------------------
Date: Fri, 27 Nov 1998 22:52:54 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: File diff
Message-Id: <slrn75ub99.5d.alastair@calliope.demon.co.uk>
Thomas Schachner <Thomas.Schachner@awd.at> wrote:
>I need to compare a Logfile against a file which is the correct master.
>If Logfile =! master than a error mail is sent.
>How can i compare to files if they are equeal?
If you're using unix, then 'diff' works'
If not, you should check CPAN for a module (www.cpan.org). I recall something
like this being around.
You could also check dejanews because i'm sure this was discussed fairly
recently.
HTH.
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: Fri, 27 Nov 1998 15:53:33 -0000
From: "Amber Hayes" <sharone@kcnet.com>
Subject: File Too Big?
Message-Id: <73n6v2$4uj$1@news3.kcnet.com>
Hello All,
I recently developed a database-type application using object-oriented
Perl and text files for a client based on code I found at
http://www.inlink.com/~perlguy/simple/ It works great on approx 5MB of text
files but my client has 2GB of text data and the script is timing out.
Should I tell him to punt and get a real relational database, try rewriting
the script in C or C++, or is my Perl code just inefficient? Thanks in
advance for assistance.
Amber Hayes
amber@ambersworld.com
------------------------------
Date: Fri, 27 Nov 1998 22:49:09 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: File Too Big?
Message-Id: <slrn75ub28.5d.alastair@calliope.demon.co.uk>
Amber Hayes <sharone@kcnet.com> wrote:
>Hello All,
> I recently developed a database-type application using object-oriented
>Perl and text files for a client based on code I found at
>http://www.inlink.com/~perlguy/simple/ It works great on approx 5MB of text
>files but my client has 2GB of text data and the script is timing out.
>Should I tell him to punt and get a real relational database, try rewriting
>the script in C or C++, or is my Perl code just inefficient? Thanks in
>advance for assistance.
I guess that if you ask 'perlguy' (Brent) about this, he might well comment that
a flat file ascii database doesn't scale to 2 Gb then. However, not seeing (or
looking) at the code means I can't tell. Before considering C/C++ though, I'd be
looking at perl's DBI module (and a DB such as MySQL etc.).
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: 27 Nov 1998 15:34:26 -0800
From: dana@dana.oz.net (Dana Booth)
Subject: Re: File Too Big?
Message-Id: <slrn75udpq.99.dana@dana.oz.net>
On Fri, 27 Nov 1998 15:53:33 -0000, Amber Hayes <sharone@kcnet.com> wrote:
> I recently developed a database-type application using object-oriented
>Perl and text files for a client based on code I found at
>http://www.inlink.com/~perlguy/simple/ It works great on approx 5MB of text
>files but my client has 2GB of text data and the script is timing out.
>Should I tell him to punt and get a real relational database, try rewriting
>the script in C or C++, or is my Perl code just inefficient? Thanks in
>advance for assistance.
Could be you're just running out of memory. If you're using large arrays,
try keeping temp or index files of some sort depending on what you're doing,
in place of the arrays.
--
---------------------------
Dana Booth <dana[at]oz.net>
---------------------------
------------------------------
Date: Fri, 27 Nov 1998 21:39:32 -0200
From: Roberto Slepetys Ferreira <slepetys@homeworks.com.br>
Subject: localtime () - perl's bug ?
Message-Id: <365F3834.34B838F6@homeworks.com.br>
Hi,
I wrote a script in Perl that make's use of the localtime() command to
get the time and day as is wroten below:
#
($sec,$min,$hour,$day,$month,$year)=localtime ();
$data = "$day/$month/$year";
$horario = "$hour:$min:$sec";
#
But for my surprise the command works properly, but the month extracted
was ever one below the current. I tried it on my machine (INTEL), in a
DEC (alpha 500) and in the webserver (O2) and all reported the same
error.
Is it a perl's bug ?
[]s
SLepetys
------------------------------
Date: 27 Nov 1998 22:21:33 GMT
From: "Allan M. Due" <due@murray.fordham.edu>
Subject: Re: newbie NEEDS HELP
Message-Id: <73n8ld$3bt$0@206.165.167.228>
J. J. Goodrich wrote in message
<14355-365F16B9-9@newsd-199.iap.bryant.webtv.net>...
Hello allim trying to make this script work for my homepage someone gave
it to me and ive attempted to edit it some at the bottom are some of my
questions heres the script
[snip a really long out of date script]
@@@@@@@@@@@@@@@@@@@Other Questions:
1.) What files do i need to create to make this script work
2.) What directories do i need to amke
3.) Do i need a cgi-lib if so what is a cgi-lib
4.) What is the log file or whatever
5.) What is a cgi-lib file and how do i make one there are many urls on
this script like at the very top spy123.cgi for that file i just need to
upload this in ascii mode and name it spy123.cgi insteadof the txt i
have it now what about the file directories like spydir
and all that do i need to create them or does the script
6.) what is the chmod number allt hese files have to be in
7.) is there anything else i ahve to do on hypermart to make this script
work if your eon hypermart and run cgi please email me i ahve lots of
questions
JJ353@webtv.net
I dont post here much so please amil any results or reply tot his post
to me at the above address
Well, hmm. Teach a man to fish and he eats for the rest of his life, give a
man a fish and he asks you to cook it for him while he is busy with other
more important things.
AmD
------------------------------
Date: 27 Nov 1998 22:11:27 GMT
From: "Allan M. Due" <due@murray.fordham.edu>
Subject: Re: Newbie question: Executing scripts under Win95
Message-Id: <73n82f$24k$0@206.165.167.228>
jlhughes@pobox.com wrote in message <73mrej$fa7$1@nnrp1.dejanews.com>...
>I'm learning Perl for use with CGI. I've installed Perl on my Win95 machine
>so I can work locally on the lessons.
>When I execute a script by double-clicking on the file in explorer or in
the
>run command, the perl DOS window opens, the script executes, the output
>displays and then immediately the perl window closes before I can read the
>results.
>Is there a PAUSE command I can add to the end of scripts to force the
window
>to stay open? Or is there a better way to run these scripts so that I can
see
>the output?
>John Hughes
>--
>http://come.to/digital_art_desktops
The cheap and simple answer to this question is to exit to a DOS window (if
you don't have it as a shortcut on your desktop you can usually find it
under programs). Note, you want a DOS window, do not exit to DOS. Once you
have the DOS window, change to the directory where the script is located
and, at the prompt, type:
perl scriptname.pl
Annoyingly, there is no way to scroll the output. To have the output
display a screen at a time type:
perl scriptname.pl | more
*Warning*
Personal opinion to follow:
The best answer I have to this problem is the UltraEdit text editor
(www.ultraedit.com). It is a great text editor for Perl and allows you to
configure a user tool which you can use to run Perl from within the editor
and capture the output to a listbox or a new file. I couldn't live without
it (If anyone needs help setting it up, let me know). The downside is that
it cost $30.00.
HTH
AmD
------------------------------
Date: Fri, 27 Nov 1998 17:09:55 -0800
From: slyy@bellsouth.net (Basil Sly Mullings)
Subject: None
Message-Id: <2.2.32.19981128010955.006bde10@mail.lig.bellsouth.net>
subscribe perl-users
------------------------------
Date: Fri, 27 Nov 1998 22:15:03 GMT
From: "Vlad Volkov" <vvolkov@benton.com>
Subject: Re: Obfuscation of perl scripts
Message-Id: <HvF72.447$lP.161016@client.news.psi.net>
I work for software consulting company whose clients are paying for
delivered produc - a set of routines that provides solution for certain
business issue.
If the program is written in C or VB, they are not getting the source code,
because they have not PAID for it. Delivered software is a complete solution
according
to tech. spec. If, after certain time, the spec changes, we expect the
client to come back
with more work, not find somebody in-house to hack our source code.
regards,
vlad
Russ Allbery wrote in message ...
>Vlad Volkov <vvolkov@benton.com> writes:
>
>> I rather meant changing variable names from, say, @user_names to
>> @c354fbg within a module. "\n"s can be easily put back with
>> corresponding Perl script. If you sell consulting in Perl for some
>> particular field, in my case data loaders, you would not want somebody
>> on the client side to learn the technics and take the business from you,
>> eh?
>
>If a consultant gave me obfuscated code for a project that I was paying
>them for, I'd fire them on the spot.
>
>I realize that you probably mean well and think this is necessary, but it
>really is not. The skill that people are paying you for as a consultant
>is your ability to solve *new* problems, not use a standard bag of
>tricks. Anyone can do that, and a lot of them are published in books or
>available on-line. Programmers don't get paid for being smart;
>programmers get paid for *applying* their knowledge to a problem, and no
>one can steal that from you.
>
>The reason why I'd fire someone who did that isn't just because I have an
>expectation of being able to use code *that I've purchased* (if you do
>contract work for someone else, you're delivering to them a product, and
>delivering a product they then can't use without hiring you again is the
>sort of trick Microsoft would pull). It's because anyone who would stoop
>to such a tactic obviously is not secure in their own programming ability,
>and that means they're not good enough at what they do to be worth my
>money.
>
>Obfuscators are fun toys. Stuff like my sig is great for amusement. It
>doesn't have any place in production code.
>
>--
>#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
>$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
> 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
>rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Fri, 27 Nov 1998 22:17:18 GMT
From: "Vlad Volkov" <vvolkov@benton.com>
Subject: Re: Obfuscation of perl scripts
Message-Id: <OxF72.448$lP.162231@client.news.psi.net>
I work for software consulting company whose clients are paying for
delivered product - a set of routines that provides solution for certain
business issue.
If the program is written in C++ or VB, they are not getting the source
code,
because they have not PAID for it. Delivered software is a complete solution
according
to tech. spec. If, after certain time, the spec changes, we expect the
client to come back
with more work, not find somebody in-house to hack our code.
I understand that it hurts the client but why give people
things they have not paid for?
regards,
vlad
Russ Allbery wrote in message ...
>Vlad Volkov <vvolkov@benton.com> writes:
>
>> I rather meant changing variable names from, say, @user_names to
>> @c354fbg within a module. "\n"s can be easily put back with
>> corresponding Perl script. If you sell consulting in Perl for some
>> particular field, in my case data loaders, you would not want somebody
>> on the client side to learn the technics and take the business from you,
>> eh?
>
>If a consultant gave me obfuscated code for a project that I was paying
>them for, I'd fire them on the spot.
>
>I realize that you probably mean well and think this is necessary, but it
>really is not. The skill that people are paying you for as a consultant
>is your ability to solve *new* problems, not use a standard bag of
>tricks. Anyone can do that, and a lot of them are published in books or
>available on-line. Programmers don't get paid for being smart;
>programmers get paid for *applying* their knowledge to a problem, and no
>one can steal that from you.
>
>The reason why I'd fire someone who did that isn't just because I have an
>expectation of being able to use code *that I've purchased* (if you do
>contract work for someone else, you're delivering to them a product, and
>delivering a product they then can't use without hiring you again is the
>sort of trick Microsoft would pull). It's because anyone who would stoop
>to such a tactic obviously is not secure in their own programming ability,
>and that means they're not good enough at what they do to be worth my
>money.
>
>Obfuscators are fun toys. Stuff like my sig is great for amusement. It
>doesn't have any place in production code.
>
>--
>#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
>$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
> 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
>rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 27 Nov 1998 14:40:28 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Obfuscation of perl scripts
Message-Id: <yl4srkwyhv.fsf@windlord.stanford.edu>
Vlad Volkov <vvolkov@benton.com> writes:
> I work for software consulting company whose clients are paying for
> delivered produc - a set of routines that provides solution for certain
> business issue. If the program is written in C or VB, they are not
> getting the source code, because they have not PAID for it. Delivered
> software is a complete solution according to tech. spec. If, after
> certain time, the spec changes, we expect the client to come back with
> more work, not find somebody in-house to hack our source code.
And if you fulfill your contract well, they will come back to you with
more work regardless of whether they're able to hack your source code or
not, because they'll know you're familiar with your work and because you
did a good job the first time.
Been there, done that. Getting repeat business in contracting is about
impressing your customer with a job well done. It's *not* about trying to
get them addicted to your services by giving them stuff that only you can
alter. Even if that works and you force them into hiring you again when
they wouldn't have otherwise (which is the only time it's of benefit to
you), all you're really doing is annoying them, and word of mouth that a
company doesn't want to do business with you because you do shoddy work
and then make people hire you to fix it *will* get around.
Note that I'm not claiming you do shoddy work, not in the slightest. I'm
saying that if you *don't* do shoddy work, whether you provide source or
not will not be relevant because they'll hire you again anyway. And being
proud enough of your work and confident enough of your own skill that
you're willing to provide them with the source does wonders for your
reputation.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Fri, 27 Nov 1998 18:09:27 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Obfuscation of perl scripts
Message-Id: <fl_aggie-2711981809280001@aggie.coaps.fsu.edu>
In article <OxF72.448$lP.162231@client.news.psi.net>, "Vlad Volkov"
<vvolkov@benton.com> wrote:
+ If the program is written in C++ or VB, they are not getting the source
+ code, because they have not PAID for it.
Well, what exactly *are* they paying for, if not the code?
James
------------------------------
Date: Fri, 27 Nov 1998 22:33:28 GMT
From: mpeppler@mbay.net
Subject: Re: Problem with Sybase::CTlib after upgrade
Message-Id: <73n9bo$q8n$1@nnrp1.dejanews.com>
In article <01be1a32$52408680$3f026a96@compaq-003.avenir.no>,
"Glenn Stxlen" <gst@avenir.no> wrote:
> Hi!
>
> We have upgraded to Perl 5.004 04 (binary distribution, source from
> ftp://ftp.cise.ufl.edu/pub/perl/CPAN/src/5.0) from 5.002 on
> Solaris 2.5.1.
>
> I had no problems installing the new version, but when trying to
> run a perl-program (that used to work with perl 5.002), I got the
> following error message:
>
> >>Can't load
> /opt/lib/perl5/site_perl/sun4-solaris/auto/Sybase/CTlib/CTlib.so' fo
> >>r module Sybase::CTlib: ld.so.1: /usr/bin/perl: fatal: relocation error:
> file /o
> >>pt/lib/perl5/site_perl/sun4-solaris/auto/Sybase/CTlib/CTlib.so: symbol
> sv_undef:
You're going to have to rebuild sybperl and install it.
Michael
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 27 Nov 1998 18:23:30 -0500
From: sara starre <nospam.perl_rocks@hotmail.com>
Subject: regex works OK but ??
Message-Id: <365F3471.1DC9B29B@hotmail.com>
I needed to do some change a date format from something like:
11/12/98 12:29:31
to
11/12 @ 12:29
so I used: (case i)
s/(^.+)(\/\d\d)(\s+)(.+)(\:\d\d\s*$)/$1 @ $4/;
and voila' when I run a test case it seems OK:
perl x.cgi
11/12/13 12:34:45
11/12 @ 12:34
However, I showed this to a friend & he said "don't use this solution
because results may vary from system to system and release to release".
In fact when he first read it he said it wouldn't work- until I showed
him the result. He thought that the initial (.+) would grab the entire
string and then not match. My thinking was that perl would discover a
match to the whole expression, if it was there. Apparently I was
correct, but maybe not entirely?
I rethought it though, and changed it slightly to (caee ii):
s/(^\S+)(\/\d\d)(\s+)(\S+)(\:\d\d\s*$)/$1 @ $4/;
which also works, and I must admit, appears safer and less subject to
interpretation than the former.
Anyhow- is he right? Could (i) be dangerous?
--
"JAPERLCHICK"
-Sara Starre
------------------------------
Date: Fri, 27 Nov 1998 16:12:04 -0600
From: "illfigah" <alcazar@netcomp.net>
Subject: Taint mode...
Message-Id: <73n81e$h2i$1@excalibur.flash.net>
Hello all,
Why is it that when I include the taint mode flag (-T) that an external file
that is "required" by the current script won't work?
Here's a snippet of my code:
#/usr/bin/perl -T
...
require "$client_dir/$username.cgi" || die "Can't open file!";
When I replace $username with a definite string, it opens it fine... however
when I try to use the variable. Nothing happens.
I has something to do with the taint mode because when I remove that tag...
it works fine with the variable... I wanna run the taint mode, does anyone
have any ideas how I could get around it?
illfigah
------------------------------
Date: 27 Nov 1998 23:00:51 GMT
From: jacoby@bouy.ecn.purdue.edu (David Jacoby)
Subject: Re: Taint mode...
Message-Id: <73nav3$ohd@mozo.cc.purdue.edu>
In article <73n81e$h2i$1@excalibur.flash.net>,
illfigah <alcazar@netcomp.net> wrote:
>Hello all,
>Why is it that when I include the taint mode flag (-T) that an external file
>that is "required" by the current script won't work?
>Here's a snippet of my code:
>#/usr/bin/perl -T
>...
>require "$client_dir/$username.cgi" || die "Can't open file!";
The first question is, did $client_dir or $username come from any outside
source, such as environment variables? Or did you at somepoint type something
like the following:
$client_dir = '/path/to/directory/in/question' ;
$username = 'wally' ;
?
Because when you taint-check, perl doesn't trust anything that wasn't typed
by the programmer. IIRC, the way to fix that is this:
$t_username =~ /(regex_to_check_for_taint)/ ; #you have to write the regex
$username = $1 ;
and something similar with the $client_dir.
>When I replace $username with a definite string, it opens it fine... however
>when I try to use the variable. Nothing happens.
>I has something to do with the taint mode because when I remove that tag...
>it works fine with the variable... I wanna run the taint mode, does anyone
>have any ideas how I could get around it?
>illfigah
--
Dave Jacoby I wish I could give brother Bill his big thrill
jacoby at ecn.purdue.edu I would set him in chains at the top of the hill
http://purdue.org/~jacoby/ Then send out for some pillars and Cecil B. Demille
Father. Guitarist. Geek. He could die happily ever after - Bob Dylan
------------------------------
Date: Fri, 27 Nov 1998 17:08:13 -0400
From: basil_s.mullings@XMAIL.HA.OSD.MIL (Basil S Mullings)
Subject: unsubscribe
Message-Id: <10698659@xmail.ha.osd.mil>
unsubscribe perl-users
------------------------------
Date: Fri, 27 Nov 1998 18:06:54 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Y2K and Programmer Denial
Message-Id: <fl_aggie-2711981806540001@aggie.coaps.fsu.edu>
In article <p6E72.1$J4.204@news.shore.net>, Scratchie
<upsetter@ziplink.net> wrote:
+ Y2k bugs can and do exist in perl scripts. The fact that the behavior of
+ locatime is (now) well-documented does not change that fact. Nonetheless,
+ I've been told by regulars on this newsgroup that checking perl scripts
+ for y2k bugs that involve localtime is no more worthwhile than checking
+ for bugs involving "print" or "abs". That sounds like denial to me.
I haven't seen any advice stating that is isn't worthwhile to double
check your code base.
What is absolutely false is the notion that Perl has a Y2K problem.
What is absolutely true is the notion that programmers have a Y2K problem.
Don't be blaming the tool for the user's miscues.
If you have ever handled the returned value for the year from localtime
and its friends as a character, you have likely committed a Y2K error.
$year=(localtime)[5];
$year = $year + 1900 ; #correct
$year = '19'.$year; # incorrect (results in a string '19100' in 2000)
Anyone who has been doing serious perl for more than 6 weeks should be
able to write code to seek out and ennumerate a list of perl scripts that
use localtime, and examine them for trash code.
James
------------------------------
Date: 27 Nov 1998 23:14:08 GMT
From: Citizen Joe <please@post-it.com>
Subject: Y2K work - need suggestions
Message-Id: <73nbo0$po7$1@ns2.foothill.net>
I usually work as a Unix system administrator. However, my current job does
not involve the usual system support. It is still on the Unix platform and
it involves Y2K. I work for a major corporation and my exact role in this
is finding out how many software components there are and which ones are
Y2K compliant and which ones are not Y2K compliant.
We have about 300 HPUX servers. There are 150 known components. There could
be a large number of undiscovered components because system managers did
not have their act together and did not record their changes to the system.
First of all, most components are not even Y2K sensitive since they do not
involve date. Examples are Perl and Emacs. Of the ones that are Y2K
sensitive, most are not important. I do not have the complete picture but
my guess is that there are less than 20 important Y2K sensetive components
that will affect the customer severely.
My job is to list all of components, including the critical ones and report
the compliance status. Such as: components x version 7.01 is non-compliant
but version 8.4 is compliant. Then the information will be passed to the
system managers who will make the necessary upgrades. Some non-compliant
components do not have a compliant version. They will be obsoleted and
replaced.
Basically, it is not a hard job. The size and the magnitude make it
difficult. I am doing it all with a Perl5 script that runs on all the boxes
and gathers info and puts it on the web page. So far we partially
identified the status of 85 different components using scripting and swlist
-l product command.
Here is where the problem is. The script takes too long to execute. It
takes about 10 seconds for each component and I just can't figure out a way
to get around that. 10 seconds x 150 components x 300 machines = 450000
seconds to check all the components on all the machines or 125 hours, when
I am done.
I decided to do this project in Perl 5. The script is based on remsh.
It is in the format:
$command=`remsh $box "/usr/local/bin/component -v"`;
or I grep a file or something. It is unique in many cases. Then I pipe to
if statements to determine compliance, through an exclusion list, save it
to a file in a specific format, etc. The results go to a web page, then to
an Excel spreadsheet and ultimately to a database.
remsh is an expensive command. I am beginning to have doubts about
selecting Perl for the project. About basing the script on remsh-type
commands. From the beginning, I was considering using ksh and instead of
running remsh, putting the script on the box, letting it run there and then
just rcp-ing the results to the depot for analysys. Ideally, I would like
to do that in Perl. But the problem is that not every machine has Perl
installed. In fact, not every machine has ksh. If do the whole thing in sh,
I will also run into problems because it does not manipulate text anywhere
near as nicely as Perl and I need all of Perl's capabilities such as
regular expressions, arrays, hashes, sorting, etc.
So far I decided to keep going with Perl, and just run the script 10
components at a time. I will re-evalute the time. Of course, I don't have
all 150 components done. The overall time is merely a projection.
Maybe the solution to cut down on time is to make sure that all the
machines have at least perl 4, and tell system managers to install perl on
the ones that do not have it. It should be an easy fix to make the script
to run on the system instead of via the network, save the results and then
copy then back.
Maybe I should just accept the time the way it is?
Please post your suggestions.
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 4310
**************************************