[16365] in Perl-Users-Digest
Perl-Users Digest, Issue: 3777 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jul 22 21:05:41 2000
Date: Sat, 22 Jul 2000 18:05:09 -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: <964314309-v9-i3777@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sat, 22 Jul 2000 Volume: 9 Number: 3777
Today's topics:
Re: Anyone working on any XS books? (Charles DeRykus)
Re: Anyone working on any XS books? <jbc@west.net>
Re: Anyone working on any XS books? (brian d foy)
Re: Anyone working on any XS books? <care227@attglobal.net>
Re: CGI.pm Cookies and images together (David Efflandt)
DB_FILE --> recovery? HELP <jcorso@charm.net>
Determining File Size with FTP <lorenzo@wwa.com>
Re: directory structure listing (Tad McClellan)
dos command in perl script <suj_h@yahoo.com>
generic browser front-end displays (in perl) to a datab <spicano@ptdcs2.intel.com>
help w/ regular expression <w00dy@my-deja.com>
Re: help w/ regular expression <tony_curtis32@yahoo.com>
Re: How to detect when an output file is removed <care227@attglobal.net>
Re: How to enable Server Side Include on Apache ? (David Efflandt)
Re: How to enable Server Side Include on Apache ? <tfm@sei.cmu.edu>
Re: IO:Socket and Timeout => "5" ? <coy@coystoys.com>
looking to learn perl sopmac@my-deja.com
Re: looking to learn perl <ggh@gf.fg>
Re: looking to learn perl <galton@dreamscape.com>
Re: MySQL and Perl problems <hading@worldnet.att.net>
Re: MySQL sample code? <makarand_kulkarni@my-deja.com>
Re: MySQL sample code? (brian d foy)
Re: OK, how do I put a variable in a regexp? (Abigail)
Re: Recursive subroutine output to recursive subroutine (Tad McClellan)
Some security questions? <pdmos23@geocities.com>
Re: Use of eval to redirect output? (Abigail)
Re: What is the differance? (Tad McClellan)
Re: Where can I download PERL 5.005_02 from? <bart.lateur@skynet.be>
Writing to a file error : Pt 2 <colin_larcombe@hotmail.com>
Re: Writing to a file error <colin_larcombe@hotmail.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 22 Jul 2000 20:12:43 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Anyone working on any XS books?
Message-Id: <Fy4857.D6C@news.boeing.com>
[posted & mailed]
>In article <3970EE81.AFF26CC5@attglobal.net>,
> Drew Simonis <care227@attglobal.net> writes:
>> I've been reading over perlxstut and perlguts, but I must say that
>> I think they are a bit sparse. (and hard to understand, for me,
>> anyway) I wonder:
>>
>> 1. Is anyone working on a Perl XS book?
'Advanced Perl Programming' by S.Srinivasan has a full chapter
on XS and a "meatier" follow-on in the 'Perl Internals' chapter.
IMO, very readable with some refreshing humor. Got a good Camel
rating too.
--
Charles DeRykus
------------------------------
Date: Sat, 22 Jul 2000 14:36:17 -0700
From: John Callender <jbc@west.net>
Subject: Re: Anyone working on any XS books?
Message-Id: <397A13D1.6580C052@west.net>
Charles DeRykus wrote:
>
> >> 1. Is anyone working on a Perl XS book?
>
> 'Advanced Perl Programming' by S.Srinivasan has a full chapter
> on XS and a "meatier" follow-on in the 'Perl Internals' chapter.
> IMO, very readable with some refreshing humor. Got a good Camel
> rating too.
At TPC last week I think I overheard one of the O'Reilly editors
chatting with one of the Perl gurus about his (guru's) working on
an XS book for O'Reilly, but I can't remember now which guru it
was, unfortunately.
John
------------------------------
Date: Sat, 22 Jul 2000 19:02:51 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: Anyone working on any XS books?
Message-Id: <brian-ya02408000R2207001902510001@news.panix.com>
In article <397A13D1.6580C052@west.net>, John Callender <jbc@west.net> posted:
> Charles DeRykus wrote:
> >
> > >> 1. Is anyone working on a Perl XS book?
> At TPC last week I think I overheard one of the O'Reilly editors
> chatting with one of the Perl gurus about his (guru's) working on
> an XS book for O'Reilly, but I can't remember now which guru it
> was, unfortunately.
it's not something that i saw on the seasonal list from ORA, although
it is one of the books that i suggested to Manning.
writing an XS book might be a foolhardy thing now that Perl 6 might
not even have XS.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>
------------------------------
Date: Sat, 22 Jul 2000 21:00:59 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Anyone working on any XS books?
Message-Id: <397A43CB.5A57BC46@attglobal.net>
brian d foy wrote:
>
> > At TPC last week I think I overheard one of the O'Reilly editors
> > chatting with one of the Perl gurus about his (guru's) working on
> > an XS book for O'Reilly, but I can't remember now which guru it
> > was, unfortunately.
>
> it's not something that i saw on the seasonal list from ORA, although
> it is one of the books that i suggested to Manning.
>
> writing an XS book might be a foolhardy thing now that Perl 6 might
> not even have XS.
>
brian,
Have you heard about any replacment for the functionality XS provides?
Or is XS thought to be too cumbersome to wield effectively?
------------------------------
Date: Sat, 22 Jul 2000 18:19:27 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: CGI.pm Cookies and images together
Message-Id: <slrn8njpca.2pa.efflandt@efflandt.xnet.com>
On Sat, 22 Jul 2000 15:08:30 +0100, Jerry Pank <Connected@btinternet.com> wrote:
>I am trying to use CGI.pm to return an image *and* drop a cookie at the
>same time and am nearly there, but not quite!
>
>eg:
>
>Calling document:
>
>..<body><img src='cookie.pl height='10' width='20'>..
>
>CGI part of script
>
>sub return_img {
> my $image = &get_image;
> my $cookie = &test_data;
> print header('-type' => 'image/gif',
> '-cookie' => $cookie),
> $image;
>}
>
>The above returns the image, but only drops the cookie once the image
>source is viewed from the browser. Not quite what I want!
What are you attempting to read the cookie with. You certainly could not
read it from the same page that has the <img src> tag, because the cookie
does not exist until after that <img src> is loaded. But if you set the
path correctly in the cookie, any subsequent page should have it.
--
David Efflandt efflandt@xnet.com http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/ http://cgi-help.virtualave.net/
------------------------------
Date: Sat, 22 Jul 2000 14:26:51 -0400
From: "Jason J Corso" <jcorso@charm.net>
Subject: DB_FILE --> recovery? HELP
Message-Id: <snjqnmnjjjt152@corp.supernews.com>
I have a DB_File interfaced database that has become corrupted!!!!
How do I recover it?
It has been written and used entirely through the perl DB_File interface...
In the future, how do I set up loggin and checkpoint statistics from the
Perl Interface so that I can use the deafult 'db_recover' utilities
package???
Thanks so much for this help!
Jason
--
jcorso@acm.org
------------------------------
Date: Sun, 23 Jul 2000 00:23:55 GMT
From: "Larry Kite" <lorenzo@wwa.com>
Subject: Determining File Size with FTP
Message-Id: <vWqe5.50068$3E6.488959@news1.alsv1.occa.home.com>
Does anyone know a quick-and-dirty way to retrieve the size of a file,
accessible through FTP, without necessarily parsing the directory
information?
For example, to get the size of a file using http is simple:
use LWP::UserAgent;
$file = http://www.perl.org;
my @templist = head($file);
print $templist[1];
But if $file was, for example, ftp://domain.com/directory/paper.ps.gz, this
would not work. It seems that one must:
1) parse the URL for the ftp server name, the directory name and the
file name
2) use Net::FTP to login, change directory, get a dir listing, and parse
the listing to get the file size.
If there is not already a module that performs this function, is there one
that reliably parses URLs for directory and file name information (it
doesn't seem that URI::URL does this)? I have already written some code to
parse the directory listing if I have to.
Thanks very much, in advance, for your help.
Larry Kite
lorenzo@wwa.com
------------------------------
Date: Fri, 21 Jul 2000 20:01:00 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: directory structure listing
Message-Id: <slrn8nhsic.p5.tadmc@maxim.metronet.com>
On Thu, 20 Jul 2000 12:26:19 -0500, Dale Bohl <dbohl@sgi.com> wrote:
>no spam wrote:
>>
>> I'm trying to generate a tree listing
>> that would look something like
>>
>> top
>> dir1
>> dir2
>> dir2.1
>> dir3
>>
>Here's a shell version in case you're interested.
If we're going to allow shell, then there's this that I saw
here in 1997:
find . -print | sed -e 's,[^/]*/\([^/]*\)$,`--\1,' -e 's,[^/]*/,| ,g'
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 23 Jul 2000 00:52:24 GMT
From: "suj_h" <suj_h@yahoo.com>
Subject: dos command in perl script
Message-Id: <clre5.3855$Uo6.198664@bgtnsc07-news.ops.worldnet.att.net>
Could someone show me how I can run a command like "dir /on /a-d /b
*.txt > list" from within a perl script? This is nt4 perl.
Thanks
------------------------------
Date: Sat, 22 Jul 2000 13:53:09 -0700
From: Silvio Picano <spicano@ptdcs2.intel.com>
Subject: generic browser front-end displays (in perl) to a database
Message-Id: <397A09B5.60758EB0@ptdcs2.intel.com>
Hi,
I found an article today that closely matches an
application that I need to implement.
>> http://wdvl.internet.com/Authoring/Languages/Perl/PerlfortheWeb/index8.html
Author: "using Perl to build a
visual front end to the live databases we have been dabbling with
these past two months. It's simple, it's attractive, and it's GUFE -
"goofy" - the Generic but Usable Front End. Why "generic"? Because
you can basically apply this front end to any SQL compliant database
with very little modification. Dabblers should be familiar with
using DBI to query live databases from Perl, as we've seen in the
past two installments, as well as with using CGI with Perl and web
templates."
My question:
There are some limitations to this software capabilities
(author explains: to keep it simple), but I'd like to find
if there are other similar, more capable & general interfaces
also written & available in perl?
notes: specific platform interest is solaris 2.5 & mySql.
Thanks in advance.
Silvio
------------------------------
Date: Sun, 23 Jul 2000 00:14:07 GMT
From: Sam Carleton <w00dy@my-deja.com>
Subject: help w/ regular expression
Message-Id: <8lddc8$umk$1@nnrp1.deja.com>
hay folks, I am new to perl, been a C/C++ programmer for 5 year now. I
am trying to take a basic C CGI script I wrote a while back and turn it
into a perl CGI program. The main thing it did was parse a string for
me. Well, I thought I would use regular expression engine to that for
me, but my task is a bit complex. I was wondering if someone could show
me the best way to do it. Here is the task:
I have a string that is suppost to contain a phone number. I need the
phone number in pure number's. The string could contain anything,
though. If the string is indead a phone number I need it return in a
string of pure numbers. If it is anything else I need the orginial
string returned. Examples:
213-555-4321 -> 2135554321
213) 555-54321 -> 2135554321
213 555 4321 -> 2135554321
2135554321 -> 2135554321
213 555 4321 -> 2135554321
fn=213-555-4321 -> 2135554321
fn=(213) 555-4321 -> 2135554321
fn=213 555 4321 -> 2135554321
fn=2135554321 -> 2135554321
fn=213 555 4321 -> 2135554321
This is a string -> This is a string
432 cars are going -> 432 cars are going
213-555-4321 phones are ringing -> 213-555-4321 phones are ringing
Can someone enlighen me as to how I would write a sub that either
returned back the compact phone number or the original string?
Sam
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 22 Jul 2000 19:25:19 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: help w/ regular expression
Message-Id: <87ittxelqo.fsf@limey.hpcc.uh.edu>
>> On Sun, 23 Jul 2000 00:14:07 GMT,
>> Sam Carleton <w00dy@my-deja.com> said:
> hay folks, I am new to perl, been a C/C++ programmer for
Hay? Well, that's the last straw... :-)
> I have a string that is suppost to contain a phone
> number. I need the phone number in pure number's. The
> string could contain anything, though. If the string is
> indead a phone number I need it return in a string of
> pure numbers.
So, what you want to do is take strings and remove all
characters from them which are *not* digits (decimal)?
In that case:
tr/0-9//cd;
is presumably what you want. "perloc perlop" for an explanation
hth
t
--
"With $10,000, we'd be millionaires!"
Homer Simpson
------------------------------
Date: Sat, 22 Jul 2000 14:59:02 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: How to detect when an output file is removed
Message-Id: <3979EEF6.FDF73904@attglobal.net>
Colin Keith wrote:
>
> Still, onto the perl. The way to prevent this from happening is to open your
> file and immediately lock it. If you can't lock it, you fail to continue.
> Once locked the file is not removable by anyone else, problem solved.
>
> perldoc -q lock
>
I thought locks were only advisory?
------------------------------
Date: Sat, 22 Jul 2000 18:32:50 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: How to enable Server Side Include on Apache ?
Message-Id: <slrn8njq5d.2pa.efflandt@efflandt.xnet.com>
On Sat, 22 Jul 2000, Werner Hofer <whofer@access.ch> wrote:
>
>i have a Linux ( S.u.S.e 6.0 ) with Apache Server 1.3
>
>From a workstation i would like to execute a Perl Script on the Apache
>Server with
>Server Side Include ( <!--#exec CGI='./cgi-bin/loadguestbook.pl'--> ). But
>it doesn't work...
This is a webserver question. What is your Perl question?
You need to uncomment something like the following in one of the conf
files and also see docs for 'Options' and 'mod_include':
# To use server-parsed HTML files
AddType text/html .shtml
AddHandler server-parsed .shtml
--
David Efflandt efflandt@xnet.com http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/ http://cgi-help.virtualave.net/
------------------------------
Date: Sat, 22 Jul 2000 16:19:05 -0400
From: Ted Marz <tfm@sei.cmu.edu>
Subject: Re: How to enable Server Side Include on Apache ?
Message-Id: <397A01B9.727DED4E@sei.cmu.edu>
Werner,
RTFM.. It is there in the conf/httpd.conf file, commented out.
You could also check the documentation on
http://www.apache.org/docs/misc/FAQ-F.html#ssi-part-i
------------------------------
Date: Sat, 22 Jul 2000 22:10:41 GMT
From: "Coy" <coy@coystoys.com>
Subject: Re: IO:Socket and Timeout => "5" ?
Message-Id: <BZoe5.7666$Mt.83481@nnrp1.ptd.net>
Since noone replied to this post...
after tearing through post after post in every imaginable
forum dealing w/ Perl,
I found this:
Timeout has a problem in the Socket Module version <= 1.1603
`perl -e 'use IO::Socket; print "$IO::Socket::VERSION\n"'`
It will hang if quering a non-routable, non-reachable, spoofed, or
firewalled IP/Ports (that drops packets, not denies them).
I do not know the full specs on this problem, but it seems to be
the case either way...
So, the way around it was the following:
$timeout = 5;
$SIG{"ALRM"} = sub {
close($socket);
print "$target: Timed out connecting to service: $srv_name on port: $port";
}
alarm $timeout;
Not sure why noone knew this or replied..
works fine know.
thanks anyway.
- Coy
: (yes this is a repost, since noone replied to the last )
: ( one and I need to get this code done in one week )
:
: IO:Socket is used to see that a machine is running
: its services like it should.
:
: Now, I noticed at times, the program would hang
: in wait (for something)...
: So, i checked the service by hand (the one it hung on)
: by telnet 192.168.123.1 <port>
: Trying 192.168.123.1....
:
: (it just hangs here)
:
: Now, in my code I have :
:
: : foreach $port (@ports) {
: : $socket = IO::Socket::INET->new(
: : PeerAddr => $host,
: : PeerPort => $port,
: : Proto => "tcp",
: : Timeout => "5",
: : Type => SOCK_STREAM)
: : or print "$host: No service on port: $port\n";
: :
: : if ($socket) {
: : close($socket);
: : print "Service on port: $port\n"
: : }
: : }
:
: Isn't Timeout suppose to kill the socket if it doesn't connect?
: The program just hangs in place forever like the telnet session did.
: What am I doing wrong ?
:
: TIA
: -Coy
:
:
:
------------------------------
Date: Sat, 22 Jul 2000 21:44:55 GMT
From: sopmac@my-deja.com
Subject: looking to learn perl
Message-Id: <8ld4kk$p1u$1@nnrp1.deja.com>
Any one know where to learn perl, free
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 22 Jul 2000 23:21:38 GMT
From: "fg" <ggh@gf.fg>
Subject: Re: looking to learn perl
Message-Id: <60qe5.3389$MJ5.38656@twister.sunsite.auc.dk>
try:
www.perl.com
<sopmac@my-deja.com> wrote in message news:8ld4kk$p1u$1@nnrp1.deja.com...
> Any one know where to learn perl, free
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Sat, 22 Jul 2000 19:27:19 -0400
From: "Greg Alton" <galton@dreamscape.com>
Subject: Re: looking to learn perl
Message-Id: <snkbr8t1jjt98@corp.supernews.com>
sopmac@my-deja.com wrote in message <8ld4kk$p1u$1@nnrp1.deja.com>...
>Any one know where to learn perl, free
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.
Start with http://www.perl.com and http://www.perl.org .
I recommend Learning Perl by Randal L. Schwartz and Tom Christiansen.
(Almost free!) http://www.oreilly.com .You'll find that both authors are
actively involved in this and other perl newsgroups as well as the above
sites.
Greg Alton
galton@dreamscape.com
------------------------------
Date: Sat, 22 Jul 2000 20:56:30 GMT
From: Howard Ding <hading@worldnet.att.net>
Subject: Re: MySQL and Perl problems
Message-Id: <397A0A0F.E04383B@worldnet.att.net>
"Dragonia Radar Freedom, C.S." wrote:
>
> I've managed to get my MySQL server up and running and have successfully created my table "Smeg". I've used the following lines
> to grant full access to the database using the MySQL command interface:
> ------------
> grant all on smeg.* to user@localhost identified by "password";
> grant all on smeg.* to user@steve identified by "password";
> #note: steve isn't my name, just my computer name...
> ------------
>my ($dsn) = "DBI:mysql:smeg:139.142.174.159"; #connecting to localhost gives more >errors.
I'm not sure, but you might try the syntax:
"DBI:mysql:database=smeg;host=localhost" or such. Take a look at the
DBD::mysql
documentation - the syntax for the connect string in in the Synopsis. I
think this may be the problem.
If not, you might also look in the mysql.user table to see if the
permissions have
been correctly set up. I seem to recall having some problems getting
them set
up the way I wanted, but I don't recall exactly why. (I think my
problem involved using wildcards, though.)
Howard
------------------------------
Date: Sat, 22 Jul 2000 16:17:58 -0700
From: Makarand Kulkarni <makarand_kulkarni@my-deja.com>
Subject: Re: MySQL sample code?
Message-Id: <397A2BA6.4E64031A@my-deja.com>
> Ok, finally my host allows mySQL connection with Perl using DBI module.
> Could someone please provide some sample code which connects to a Database
> and performs a simple search, selects that row and stores the results. Or
> are there documentation/tutorials available on the net?
get this book
MySQL and mSQL (Nutshell Series)
by Randy Jay Yarger, George Reese, Tim King
------------------------------
Date: Sat, 22 Jul 2000 19:54:32 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: MySQL sample code?
Message-Id: <brian-ya02408000R2207001954320001@news.panix.com>
In article <397A2BA6.4E64031A@my-deja.com>, Makarand Kulkarni <makarand_kulkarni@my-deja.com> posted:
> get this book
> MySQL and mSQL (Nutshell Series)
> by Randy Jay Yarger, George Reese, Tim King
that book has too many errors and omissions to be useful to a newbie.
i hear that the New Riders book is much better though.
however, the mysql documentation along with _Programming the Perl DBI_
is probably the optimal solution. :)
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>
------------------------------
Date: 22 Jul 2000 14:13:05 EDT
From: abigail@foad.org (Abigail)
Subject: Re: OK, how do I put a variable in a regexp?
Message-Id: <slrn8njq2l.vcg.abigail@alexandra.foad.org>
Eric Selin (eric.selin@pp.inet.fi) wrote on MMDXVII September MCMXCIII in
<URL:news:zije5.887$Av5.21009@news.kpnqwest.fi>:
~~ This works:
~~ $a =~ /14:(.*)\t(.*)/;
~~ print "$1<br>";
~~
~~ But not this:
~~ $i = 14;
~~ $a =~ /^$i:(.*)\t(.*)/;
~~ print "$i<br>";
~~ }
Define "doesn't work". If you think they should print the same, you are
wrong of course. The first one will print what's between the : and the
last \t (or nothing if there's no match) followed by a "<br>". The second
one will print "14<br>", regardless whether the match succeeded or not.
Abigail
--
New email address: abigail@foad.org
------------------------------
Date: Sat, 22 Jul 2000 15:39:56 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Recursive subroutine output to recursive subroutine problem
Message-Id: <slrn8nju4c.164.tadmc@magna.metronet.com>
On Fri, 21 Jul 2000 11:37:13 -0500, firstname.lastname@nokia.com <firstname.lastname@nokia.com> wrote:
>On Fri, 21 Jul 2000 15:18:31 GMT, neil@brevity.org (Neil
>Kandalgaonkar) wrote:
>
>>You have perl4. (Type perl -v at the command line.)
>First I'd like to thank you for your help with this and yes you are
>right we are using version 4. Now the fun part of getting them to
>change it.
Do they like to be cracked?
If not, show them the CERT security advisories about Perl 4 (and
some Perl 5s too!).
If so, change providers or quit your job, or whatever it takes to
disassociate yourself from them. They are simply too silly to survive.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 22 Jul 2000 20:39:30 GMT
From: Pasquale <pdmos23@geocities.com>
Subject: Some security questions?
Message-Id: <397A083E.27B223F2@geocities.com>
I've just finished some of my first scripts and added the -T switch to
the #! line. I would like to make them as secure as I can. I've
untainted what taint was having a problem with, through reg.
expression. Some of my questions I have are:
1. Is taint mode being happy with the script enough?
2. I understand that the big concern is when the data is from user input
& that input is used along with a shell operation, i.e.: system(),
open(), etc.?
3. Is "open(MAIL, "|/usr/sbin/sendmail -t")" enough, if all
variables(To: & From:) are preset or checked against a list?
4. Is not having "<" when opening a file a security issue or is that
when the filename & the path is a variable?
5. I was trying to set things up so my scripts were only accessible/used
from my domain/site using HTTP_REFERER, doesn't work. Is there another
way to do this?
6. Are glob() & unlink() security issues? If so, any suggestions?
7. I have a script used to upload files. It is setup to only upload if
the extension is ".jpg". Is that enough to prevent any other
problematic uploads?
8. I've perlsec, but I'm still not understanding $ENV{'PATH'}. Anywhere
else I can read up on this variable & using it?
Thanks,
Pasquale
------------------------------
Date: 22 Jul 2000 14:15:26 EDT
From: abigail@foad.org (Abigail)
Subject: Re: Use of eval to redirect output?
Message-Id: <slrn8njq72.vcg.abigail@alexandra.foad.org>
Nathan Wiger (nate@west.sun.com) wrote on MMDXV September MCMXCIII in
<URL:news:397766B2.C05BB2FC@west.sun.com>:
\\ Hi all-
\\
\\ I'm trying to make a little "eval compartment", similar to the way
\\ Apache::Registry works, but with different constraints and for a
\\ different purpose. What I'm trying to do is the *conceptual* equivalent
\\ of this:
\\
\\ my $code = join '', (<CODE>);
\\ @output = eval $code;
\\ die if $@;
\\ print &filter_output(@output);
\\
\\ So, what I'd like to do is be able to eval a block of code and have its
\\ STDOUT output be stuck into @output. That way, I could do stuff with it.
\\ In this way, it's a little like an interprocess pipe.
\\
\\ Maybe eval isn't the way to do this? Maybe a "|-" IPC pipe is the way to
\\ go? Any advice?
Yes, that's what I would do.
Abigail
--
New email address: abigail@foad.org
------------------------------
Date: Fri, 21 Jul 2000 20:40:25 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: What is the differance?
Message-Id: <slrn8nhus9.p5.tadmc@maxim.metronet.com>
On Thu, 20 Jul 2000 11:12:09 -0400, Mark E. Drummond <drummond-m@rmc.ca> wrote:
>The following 2 pieces of code give me differant results for what I am
>trying to accomplish (q.v.).
>
>snippet 1
>---------
>@mac=split(/:/,$mac); undef $mac;
>foreach $octet (@mac) {
> (length($octet) == 1) ? $mac.="0$octet" : $mac.=$octet;
>}
I haven't seen anyone comment about _this_ yet, so I will :-)
You do not need an if-else at all!
$mac .= '0' if length($octet) == 1;
$mac .= $octet;
But you should be using sprintf() for padding numbers instead anyway...
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 22 Jul 2000 20:22:12 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Where can I download PERL 5.005_02 from?
Message-Id: <eh0kns43r4ufupbas3nksu0ukm2r1l9q8g@4ax.com>
Rusty Williamson wrote:
>I need to find the UNIX source distribution for PERL 5.005_02. Does anyone
>know where I can find this? Is there an on-line archive of older PERL
>versions?
CPAN has 5.005_03 and 5.005. Maybe you can use one of those?
http://www.cpan.org/src/5.0/
--
Bart.
------------------------------
Date: Sat, 22 Jul 2000 20:48:09 GMT
From: "Colin Larcombe" <colin_larcombe@hotmail.com>
Subject: Writing to a file error : Pt 2
Message-Id: <dMne5.30242$aS.233901@telenews.teleline.es>
Thanks for all your hints and tips. Have now got it working except for
when I try to include the path
e.g.
#!/usr/local/bin/perl
# Put all the bonds into an array, except the first two lines
$filepath="/usr/users/larcombe/";
$isinname="moody_bnd_upd.txt\n";
$accept="acceptable.txt";
$notaccept="notaccept.txt";
open(ACCEPT,">$filepath"."$accept") || die "Cannot open $filepath$accept to
write to";
or
open(ACCEPT,">$filepath"+"$accept") || die "Cannot open $filepath$accept to
write to";
fail with the die
but
open(ACCEPT,">$accept") || die "Cannot open $filepath$accept to write to";
works
and writes a file in the /usr/users/larcombe directory.
Any suggestions
TIA.
Colin L
------------------------------
Date: Sat, 22 Jul 2000 20:17:14 GMT
From: "Colin Larcombe" <colin_larcombe@hotmail.com>
Subject: Re: Writing to a file error
Message-Id: <ejne5.30177$aS.233676@telenews.teleline.es>
Interestingly, I checked and there were no hidden files created
<schnurmann@my-deja.com> wrote in message
news:8la8h4$s0n$1@nnrp1.deja.com...
> The original code had the variables for path and file names quoted.
> This created a "dot" file....that is, hidden...
>
> In article <39789C96.4CC8621@attglobal.net>,
> Drew Simonis <care227@attglobal.net> wrote:
> > Neil Lathwood wrote:
> > >
> > > It may be because of the . between $filepath and $notaccept it
> should just
> > > be $filepath$notaccept
> > >
> >
> > #!/usr/bin/perl -w
> >
> > my $filepath = '/usr/bin/';
> > my $notaccept = 'hi_there';
> >
> > print $filepath$notaccept; # line 6
> > print $filepath . $notaccept, "\n";
> >
> > Output:
> >
> > Scalar found where operator expected at ip.pl line 6, at end of line
> > (Missing operator before ?)
> > Filehandle main::/usr/bin/ never opened at ip.pl line 6.
> > /usr/bin/hi_there
> >
> > the dot operator is used to concatenate.
> >
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 3777
**************************************