[7688] in Perl-Users-Digest
Perl-Users Digest, Issue: 1314 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 13 18:16:03 1997
Date: Thu, 13 Nov 97 15:00:25 -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 Thu, 13 Nov 1997 Volume: 8 Number: 1314
Today's topics:
Re: !Best HW/SW config for Perl <usenet-tag@qz.little-neck.ny.us>
Re: Block comments in Perl? (Frank Hoehne)
Re: Block comments in Perl? (brian d foy)
Re: Bulkin' up (brian d foy)
Re: carriage returns (brian d foy)
Deleting Cookies (need some help ASAP) <JesseR@HeadHunter.NET>
Re: Deleting Cookies (need some help ASAP) (brian d foy)
Re: Extracting ASCII records from BINARY files??? (Mike Stok)
Re: glob not working <rootbeer@teleport.com>
How are LVALUES Created? <msuarez@cybernet.com>
Re: How are LVALUES Created? (brian d foy)
Re: how to learn perl <raven@lp-llc.com>
Re: how to learn perl (brian d foy)
Re: How to send mail w/in Perl program? <usenet-tag@qz.little-neck.ny.us>
Re: Killing a child process <seay@hol.fr>
Re: Make the browser to never stop loading (brian d foy)
Re: Multi-dimensional hash for DB? <seay@hol.fr>
Re: perl and setuid in unix <rootbeer@teleport.com>
Re: perl and setuid in unix (brian d foy)
Re: precedence question (brian d foy)
Re: QUESTION: How to do a string comparison? <seay@hol.fr>
vertical bars in the substitute operator - how? jimndi@sgi.net
Re: vertical bars in the substitute operator - how? (Mike Stok)
Re: vertical bars in the substitute operator - how? (brian d foy)
Re: What data is being returned from a form? (brian d foy)
which Perl is for me?! <dtbaker@flash.net>
Re: Y2000 Issues in PERL CGI scripts? (Mike Stok)
Re: Y2000 Issues in PERL CGI scripts? (brian d foy)
Re: Y2000 Issues in PERL CGI scripts? (Mike Stok)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 13 Nov 1997 21:33:36 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: !Best HW/SW config for Perl
Message-Id: <eli$9711131616@qz.little-neck.ny.us>
Terry Michaels <74331.3261@CompuServe.COM> wrote:
> Greetings!
> ^A
You have <control-A>s between paragraphs. Why?
> I am interested in hearing people's thoughts on what is the
> best hardware/software configuration for using perl and
> internet. Tell me what works for you.
What works for me? Well I have a several sparcs on my desk. They
work pretty good. And at home I've a generic off the shelf peecee
set up to use Linux. That works pretty well. I think you would be
safe with anything that has at least a 16 bit processor, 4 meg of
RAM, 100megs of disk space, some sort of Unix OS installed, a
keyboard and monitor. Those requirements include overhead for the
operating system. You would probably have trouble compiling perl
on that, but any decent Linux or FreeBSD (up requirements to 32 bit
processor) will come with it compiled.
As for using the Internet, well that is best asked in a different
group. Which group will depend on what you want to do with the
Internet. RFC 1149 offers a very low tech method of accessing the
Internet which does not have any significant hardware requirements.
Admittedly, it is quite slow....
Elijah
------
<URL:ftp://ftp.uu.net/doc/standards/internet/rfc1149.Z>
> Thanks
> ^A
> Terry Michaels
> TMichaels@compuserve.com
------------------------------
Date: Thu, 13 Nov 1997 22:14:29 GMT
From: frank.hoehne@hamburg.netsurf.de (Frank Hoehne)
Subject: Re: Block comments in Perl?
Message-Id: <346b6a5a.3910227@news.hamburg.netsurf.de>
On 10 Nov 1997 18:15:44 GMT, "Luu Tran" <luutran@geocities.com> wrote:
>Hi,
>
>This is dumb but how do I do block comments in Perl (5.003)? perlsyn says C
>style /* */ block comment is out, so how?
>
>tia
>
>-- luu
The use of the "here-doc" syntax
will let you do /* */-block-comments.
The 'here-doc' syntax is described in perldata.
In respect to comments you could use it for
dummy assignments like:
$here = <<'DOC';
here doc could not only
used for holding long strings
DOC
Which would populate the variable $here.
But you could also build /* */-block like comments
by doing this whithout $here - variable:
<<'*';
Here goes the
/* */- block like comments
*
Cheers,
Frank Hoehne
------------------------------
Date: Thu, 13 Nov 1997 17:48:32 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Block comments in Perl?
Message-Id: <comdog-ya02408000R1311971748320001@news.panix.com>
In article <346b6a5a.3910227@news.hamburg.netsurf.de>, frank.hoehne@hamburg.netsurf.de (Frank Hoehne) wrote:
>On 10 Nov 1997 18:15:44 GMT, "Luu Tran" <luutran@geocities.com> wrote:
>>This is dumb but how do I do block comments in Perl (5.003)? perlsyn says C
>>style /* */ block comment is out, so how?
>The use of the "here-doc" syntax
>will let you do /* */-block-comments.
sorry, but your answer has been added to the WRONG pile.
in your "solution", perl will create a new variable name and will grab
a chunk of memory for it.
this is hardly the behaviour of comments.
since perl has built in block commenting features, ugly pseudo-solutions
can be left at home.
--
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>
fortunately some programmers have to go through code review
------------------------------
Date: Thu, 13 Nov 1997 17:09:54 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Bulkin' up
Message-Id: <comdog-ya02408000R1311971709540001@news.panix.com>
In article <346B665F.C7521FDF@lp-llc.com>, raven@lp-llc.com wrote:
>Ive got a little subroutine I wrote to send to my email list, which now
>numbers around 1000 recipients.
>
>It works great, though it is extremely slow. I tried to move the open
>MAIL command to before the foreach loop begins but that just sends one
>very long email to the first name on the list.
>
>Isnt there a way to send the mail in BULK form?
>- I would prefer that only the recipients address appear in the To: area
have you looked at something like majordomo to see what it does?
or reading about the various things you can do with sendmail, such
as using Bcc?
good luck
--
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>
$RTFM_post{'brian d foy'}++;
------------------------------
Date: Thu, 13 Nov 1997 17:33:22 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: carriage returns
Message-Id: <comdog-ya02408000R1311971733220001@news.panix.com>
In article <64fa4o$1ni$1@info.uah.edu>, gbacon@adtran.com (Greg Bacon) wrote:
>In article <comdog-ya02408000R1211971754410001@news.panix.com>,
> comdog@computerdog.com (brian d foy) writes:
>: In article <64cqt0$3de$5@info.uah.edu>, gbacon@adtran.com (Greg Bacon) wrote:
>:
>: >In article <3469E823.67CA@cpdmfg.cig.mot.com>,
>: >: $var = "This is^Ma text string^Mwith unwanted^Mcarriage returns."
>: >
>: > $var =~ s/\s+/ /g;
>:
>: but that leaves the carriage returns since they don't
>: necessarily match that pattern.
>
>If your locale/libc is so broken that they doesn't consider a carriage
>return to be whitespace, there's not much perl (or Perl) can do to
>help you. :-)
i was a bit unclear - i meant to mean that the pattern matches things
other than carriage returns, which might have undesired side effects. why
i typed that i have no idea :(
--
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>
sometimes it feels like really early in the morning.
------------------------------
Date: Thu, 13 Nov 1997 14:58:12 -0500
From: "Jesse Retchko" <JesseR@HeadHunter.NET>
Subject: Deleting Cookies (need some help ASAP)
Message-Id: <64fm4p$mfv@snews3.zippo.com>
Hey Everyone,
I'm running a site that a user has to log onto. Lately my users have started
wanting a log off button. Does anyone out there know the code on how to
delete a cookie using Perl? If you could e-mail any response you have one
this article to JesseR@HeadHunter.NET that would be great!
Thanks,
Jesse Retchko
JesseR@HeadHunter.NET
Webmaster
HeadHunter.NET
http://www.HeadHunter.NET/
------------------------------
Date: Thu, 13 Nov 1997 16:21:43 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Deleting Cookies (need some help ASAP)
Message-Id: <comdog-ya02408000R1311971621430001@news.panix.com>
In article <64fm4p$mfv@snews3.zippo.com>, "Jesse Retchko" <JesseR@HeadHunter.NET> wrote:
>I'm running a site that a user has to log onto. Lately my users have started
>wanting a log off button. Does anyone out there know the code on how to
>delete a cookie using Perl? If you could e-mail any response you have one
>this article to JesseR@HeadHunter.NET that would be great!
see the references in the CGI Meta FAQ. make sure to read Nick Kew's
"Login on the Web" tutorial while you are there :)
--
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>
$RTFM_post{'brian d foy'}++;
------------------------------
Date: 13 Nov 1997 21:28:05 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Extracting ASCII records from BINARY files???
Message-Id: <64frd5$h82@news-central.tiac.net>
In article <346b63c7.90408733@news.calstate.edu>,
Dan LeGate <dlegate@rsa.csuhayward.edu> wrote:
>Question from a new Perl programmer. I know how to extract records
>from a file where each record is on a different line (terminated by
>\n) and all characters are standard ASCII. But now I'm facing a
>situation where I need to extract ASCII records out of the middle of
>binary (non-standard) characters, in LONG lines of text.
>
>For example:
>
>^@^A^EWelcome^@\241\241^@^@7^@7^@^@^^@^B^EPayments due^@\241\241^@
>^@^A^DThursday, Feb 15. at 6:00
>pm.^@\241\241^@^@7^@7^@^@^^@^B^EGoodbye^@\241\241^@
>
>All those ^@ types of characters are actually just one character, but
>display this way in emacs. I would need to extract "Welcome",
>"Payments Due", "Thursday, Feb 15. at 6:00 pm.", and "Goodbye" from
>this garbled mess. Keep in mind all of this is on one line. There
>are only a few \n line breaks in the file and then the data continues
>in a messy order like this.
>
>I've noticed that each "record" is preceded by either a ^E or a ^D and
>ends with ^@\241\241 each time. But I'm lost as to how to tell perl
>"get the text between those delimeters only".
You can set the input record separator to the sequence you notice ends the
records (perl's special variables are documented in the perlvar man
page) e.g.
$/ = "\c@\241\241";
and then the <> operator will use that to determine where the ends of
record are so you can say
while (<>) {
chomp;
tr/ -~//cd; # maybe, kills tabs
}
which loads up $_, gets rid of the end of record sequence and deletes any
characters outside the range ' ' to '~' which works reasonably for ASCII
and leaves a result in $_. How you end up processing $_ depends on the
nature of your data (are there spurious printable characters which the tr
translation above lets through)
When I'm faced with a binary file I usually try and find out the structure
of the file and use sysread to read records in and then unpack to unpack
them into perl scalars as binary data can sometimes look like reasonable
ASCII text.
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: Thu, 13 Nov 1997 13:08:52 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Umm <l41484@alfa.ist.utl.pt>
Subject: Re: glob not working
Message-Id: <Pine.GSO.3.96.971113130709.23862G-100000@usertest.teleport.com>
On 10 Nov 1997, Umm wrote:
> :-( How can re-configure it? (presuming it can be done without recompiling)
You can't reconfigure Perl without recompiling. Fortunately, recompiling
is easy to do. Get the latest Perl from CPAN; it comes with full
instructions. Good luck!
--
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, 13 Nov 1997 16:20:09 -0500
From: "Michael A. Suarez" <msuarez@cybernet.com>
Subject: How are LVALUES Created?
Message-Id: <346B6F09.F9C094EF@cybernet.com>
We have code that, when we execute the following,
print "Ref = ",\$x,"\n";
It tells us that $x is an LVALUE. How is this created... As
far as we know, $x is a scalar. What are we doing that makes $x an
LVALUE? We know that we can do the following, $x.="", to return $x to a
scalar, but how can we keep this from happening in the first place?
Thanks,
Michael
msuarez@cybernet.com
------------------------------
Date: Thu, 13 Nov 1997 17:56:18 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: How are LVALUES Created?
Message-Id: <comdog-ya02408000R1311971756180001@news.panix.com>
In article <346B6F09.F9C094EF@cybernet.com>, msuarez@cybernet.com wrote:
>We have code that, when we execute the following,
>
>print "Ref = ",\$x,"\n";
>
>It tells us that $x is an LVALUE. How is this created... As
>far as we know, $x is a scalar. What are we doing that makes $x an
>LVALUE?
$x is a scalar.
\$x is a reference to a scalar.
when i run
#!perl -w
$x = 'janyph';
print "Ref = ", \$x, "\n";
__END__
i get
Ref = SCALAR(0x12d0fc0)
perhaps you can post the other relevant parts of the code or the
exact warning...
--
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: Thu, 13 Nov 1997 12:59:53 -0800
From: Matt McLaughlin <raven@lp-llc.com>
To: Mosl Roland <founder@pege.org>
Subject: Re: how to learn perl
Message-Id: <346B6A48.2A264B0C@lp-llc.com>
Programming Perl
by Larry Wall, Tom Christiansen, and Randall Schwartz
from O'Reilly & Assoc
it's affectionately known as the "Blue Camel" - you'll know why when you
see it.
Mosl Roland wrote:
> I am with computers since 1976 and worked as
> a professional programmer 1980 to 1991.
>
> Now I want to learn Perl.
> I need no beginers book,
> I need a book to convert my knowledge
> in Assembler, Basci, Pascal, C into Perl.
>
> What books would You recommend me?
>
> Chevalier Mvsl Roland founder@pege.org
> http://pege.org - clear targets for a confused civilization
> get 2mb free homepage -> http://yi.com/yimmi.php?yimmi=Pege
> Callback ohne Anmeldegeb|hren und 5%
> f|r die Sonnenenergie -> http://pege.org/utelco/
------------------------------
Date: Thu, 13 Nov 1997 17:17:58 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: how to learn perl
Message-Id: <comdog-ya02408000R1311971717580001@news.panix.com>
In article <64fhpi$cd9$2@orudios.magnet.at>, "Mosl Roland" <founder@pege.org> wrote:
>Now I want to learn Perl.
>I need no beginers book,
>I need a book to convert my knowledge
>in Assembler, Basci, Pascal, C into Perl.
>
>What books would You recommend me?
not to beat a dead horse, but you can check the perlbook man page.
i like the animal books:
Programming Perl
Larry Wall, Tom Christensen & Randal L. Schwartz
ISBN 1-56592-149-6
Advanced Perl Programming
Sriram Srinivasan
ISBN 1-56592-220-4
Mastering Regular Expressions
Jeffrey Freidl
ISBN 1-56592-257-3
Learning Perl
Randal L. Schwartz & Tom Christiansen
ISBN 1-56592-284-0
all these and more at <URL:http://www.oreilly.com>
good luck and welcome to Perl :)
--
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>
$RTFM_post{'brian d foy'}++;
------------------------------
Date: 13 Nov 1997 20:56:04 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: How to send mail w/in Perl program?
Message-Id: <eli$9711131537@qz.little-neck.ny.us>
Petri Backstrom <petri.backstrom@icl.fi> wrote:
> Joseph O'Rourke wrote:
> > I am using Perl 5.0 on a Unix system, and would like my program
> > to send me mail whose body is written from information in
> > variables inside the Perl program. I tried
...
> my $mailprog = '/usr/lib/sendmail';
:r! whence sendmail
/usr/bin/sendmail
We don't have a real sendmail here (ours is a smail front end), so it is
not in the normal place. Beware of these things.
> my $subject = 'My subject';
> my $to = 'username@host.domain';
> my $from = 'other@otherhost.domain';
> my $content = 'My message.';
>
> open( MAIL, "|$mailprog \"$to\"" ) or die "Cannot send to $to: $!";
Use different quotes rather than backslashes, and you probably want
to use -oi or else some documents will mysteriously get cut off.
open( MAIL, qq:|$mailprog -oi "$to": ) or die "Cannot send to $to: $!";
> print MAIL <<MESSAGE;
> Subject: $subject
> Reply-To: $from
To: $to
Always put a "To:" or "Cc:" header with the $to address. (It will work
without it, but things get ugly for the recipient.)
> ----------------------------------------------------------------------
Bad idea. The end of the headers is defined to be a blank line. This is
not blank nor is it a legal header, what happens can vary from program
to program, but probably this line will be considered part of the last
header that got folded over, and this interpretation would continue on
for successive lines until a blank line is reached.
> $content
>
> MESSAGE
> close( MAIL );
So with your variables the mail would have probably arrived looking like:
{Received: and other system added headers}
From: other@otherhost.domain
Subject: My subject
Apparently-To: username@host.domain
Reply-To: other@otherhost.domain
----------------------------------------------------------------------
My message.
{end of headers}
{end of body}
Elijah
------
some consider the blank line part of the body, some part of the headers
------------------------------
Date: Thu, 13 Nov 1997 23:18:20 +0100
From: Douglas Seay <seay@hol.fr>
To: SiberTanrI <sibertanri@aol.com>
Subject: Re: Killing a child process
Message-Id: <346B7AB4.4228579B@hol.fr>
[posted and mailed]
SiberTanrI wrote:
>
> A Perl script makes a system call to invoke another
> tool. While this child is running, the user tries to stop
> the execution of the Perl script using ^c. How do we kill
> the child process, too, since ^c is only detected by the
> parent?
>
> An example will be appreciated.
This isn't really a Perl question as the functionality would be the same
in C or any other lesser language. You may wish to check out some of
the FAQs for your OS. Since you don't mention which OS you are using,
it is hard to give more details.
If you are running some flavor of Unix, it sounds like the child
processes are ignoring the HUP signal. Find where this is done and
change it.
- doug
------------------------------
Date: Thu, 13 Nov 1997 17:22:16 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Make the browser to never stop loading
Message-Id: <comdog-ya02408000R1311971722160001@news.panix.com>
In article <346B4434.2A88@globes.co.il>, ron@globes.co.il wrote:
>I'm trying to make a perl script that outputs an html page that never
>stops to load.
what do you mean "stop to load"?
>Is this possible in Perl? If it is, how can i do it?
whatever it is i'm sure i can do it with Perl - probably already have. :)
--
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: Thu, 13 Nov 1997 23:45:54 +0100
From: Douglas Seay <seay@hol.fr>
To: HMahaffey <hmahaffey@aol.com>
Subject: Re: Multi-dimensional hash for DB?
Message-Id: <346B8322.308EA91D@hol.fr>
[posted and mailed]
HMahaffey wrote:
>
> I'm using the DBM package that is built in to Perl 5.004. A script like this
> works beautifully:
> dbmopen(%db, "db", 0622);
> $db{$tag} += 1;
> $caller_data = $db{$tag};
> dbmclose(%db);
> Everytime you run the script, you get a higher number. Cool.
No it isn't. dbmopen() is ancient history. "perldoc perltie" for
details on how to join the perl5.004 era.
> Ok, now let's try to add a "column" by doing this:
> dbmopen(%db, "db", 0622);
> $db{$tag}{"VERSION"} += 1;
> $db{$tag}{"TYPE"} = "foo";
> $caller_data.....
> $dbmclose(%db);
>
> If this is in a function that is called over and over, everthing works. But
> once the script exits, and is called again, $db{$tag}{"VERSION"} is undefined!
> When I type out the database file, I see what looks like an address
> ("HASH(0x401975ac)) where you see the value if the array is
> single-dimensional.
Well, what did you expect? You stored a hash reference in $db{$tag}.
You made no effort to store the actual data to disk.
> Sorry if this is an old issue, but I couldn't find anyone using the DBM with
> multi-dimensional array in any of my books (I seem to have them ALL). One
> implemented one by using column delimiters to parse through. Yuck!
>
> I'm in a bit of a panic to get this implemented soon, so any help would be
> appreciated!
Don't be sorry about "old issues", go to DejaNews and look around
there. I know I've answered this question at least 3 or 4 times this
year. As it is November, I guess it isn't all that bad, but it is still
old material.
Go to CPAN and get MLDBM.pm (Multi-Level DBM) and see if it works for
you. I've never used it, but others have said that it works with this
sort of problem.
- doug
------------------------------
Date: Thu, 13 Nov 1997 13:11:40 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "Susan L. Canaday" <canadasl@bp.com>
Subject: Re: perl and setuid in unix
Message-Id: <Pine.GSO.3.96.971113130918.23862H-100000@usertest.teleport.com>
On 13 Nov 1997, Susan L. Canaday wrote:
> When I try to call the perl scripts I get an error, "insecure dependency
> in mkdir while running setuid".
That's Perl, trying to save you from yourself. :-) Check the perldiag and
perlsec manpages to see what to do about that message.
> If I call a different shell script (instead of the perl script) I do not
> see the error.
That's because the shell doesn't give you a life preserver. It lets you
sink without a trace. :-)
--
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, 13 Nov 1997 17:13:43 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: perl and setuid in unix
Message-Id: <comdog-ya02408000R1311971713430001@news.panix.com>
In article <01bcf072$c7a74f20$00540180@amclvw27311.clv.am.bp.com>, "Susan L. Canaday" <canadasl@bp.com> wrote:
>I am working on a user interface for a 3-d party tool. The tool is written
>in perl & csh.
>When I try to call the perl scripts I get an error, "insecure dependency in
>mkdir
>while running setuid".
smells like taint checking.
you need to cleanse the data that you give to mkdir. see the perlsec
and perldiag man pages for more details.
good luck :)
--
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>
$RTFM_post{'brian d foy'}++;
------------------------------
Date: Thu, 13 Nov 1997 17:42:35 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: precedence question
Message-Id: <comdog-ya02408000R1311971742350001@news.panix.com>
In article <01bcf068$8aa40000$3e03b480@mm>, "Phil R Lawrence" <prl2@lehigh.edu> wrote:
>The following causes the help routine to execute no matter what:
>
>&help if ( $arg{uname} =~ /^?|-?$/ );
>
>Why?
because the expression always evaluates to true.
try reading the regular expression aloud to see what is going on...
"match a question mark OR one or zero hyphens, each anchored
at the beginning and end of string".
as always, the null pattern matches everything you compare it to.
perhaps you meant
m/ ^ [?-] $ /x;
or
m/ ^ \? -? $ /x;
or
m/ ^ \? \| -? $ /x;
?
--
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: Thu, 13 Nov 1997 23:37:32 +0100
From: Douglas Seay <seay@hol.fr>
To: Yu Xie <xieyum@nortel.ca>
Subject: Re: QUESTION: How to do a string comparison?
Message-Id: <346B812C.11FA64F5@hol.fr>
[posted and mailed]
Yu Xie wrote:
>
> hi, all:
>
> I am right now workin on a little perl script. And i have a
> question to you. Here it is: and I would like to know how do
> a string comparison.
Simple. Go to your nearest book store, buy a copy of _Learning Perl_.
Go back to work, climb up on your chair and shout "Would somebody come
here and read this book to me". [*]
> Does nil represents empty string, or it is something else?
What do you mean by empty string? '' or undefined? And what is `nil'
supposed to mean?
> Wnat is the comparison operator? Is it == or = or eq?
It is in that book that one of your office mates will read to you. It
is also in the man pages, but I don't see why you'd read that either.
> Is $nothing eq "nil"; correct? Or what is the correct way?
You just said (more or less)
is strcmp(nothing, "nil") correct?
Give it up. You haven't a clue. BNR offers lots of classes, so sign up
for one and just sit around twiddling your thumbs until then.
- doug
[*] Hail Dogbert
------------------------------
Date: Thu, 13 Nov 1997 15:01:54 -0600
From: jimndi@sgi.net
Subject: vertical bars in the substitute operator - how?
Message-Id: <879454276.8611@dejanews.com>
I am trying to replace the vertical bars in an input file with brackets
using the substitute operator (s/|/]/), but instead I am getting the
substituted string (]) inserted after every single character in the input
file. I tried using a backslash before the vertical bar, but this didn't
help. Can someone please tell me how to do this?
Thanks!
Diane
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 13 Nov 1997 21:18:37 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: vertical bars in the substitute operator - how?
Message-Id: <64fqrd$gov@news-central.tiac.net>
In article <879454276.8611@dejanews.com>, <jimndi@sgi.net> wrote:
>I am trying to replace the vertical bars in an input file with brackets
>using the substitute operator (s/|/]/), but instead I am getting the
>substituted string (]) inserted after every single character in the input
>file. I tried using a backslash before the vertical bar, but this didn't
>help. Can someone please tell me how to do this?
Escaping the | with a \ should work. If you have
$string = 'foo|bar|baz';
then $string =~ s/\|/]/g; will leave it containing foo]bar]baz
If it doesn't then can you post the code (or a section of the code) which
doesn't work?
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: Thu, 13 Nov 1997 17:37:02 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: vertical bars in the substitute operator - how?
Message-Id: <comdog-ya02408000R1311971737020001@news.panix.com>
In article <879454276.8611@dejanews.com>, jimndi@sgi.net wrote:
>I am trying to replace the vertical bars in an input file with brackets
>using the substitute operator (s/|/]/), but instead I am getting the
>substituted string (]) inserted after every single character in the input
>file. I tried using a backslash before the vertical bar, but this didn't
>help. Can someone please tell me how to do this?
lots o' ways:
1. escape the meta thingys for maximum unreadability
s/\|/]/;
2. use the \Q thingy to quote metacharacters
s/\Q|\E/]/;
3. use a character class
s/[|]/]/;
and many more ...
good luck :)
--
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: Thu, 13 Nov 1997 17:30:07 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: What data is being returned from a form?
Message-Id: <comdog-ya02408000R1311971730070001@news.panix.com>
In article <346B3857.2075A30@networkapparel.com>, Bill Guindon <billg@networkapparel.com> wrote:
> How do I see the exact stream of data which is coming into the Perl
> script. I have managed to print out the buffer which includes all the
> fields, however, I would like to see all the header information as
> well. Does anyone have any brilliant ideas?
depending on what side of the transaction you want to see, i have
a utility to do it. there is HTTPeek [1] which is a verbose web
client, and a nameless Perl server which simply spits back the
request header and message body [2]. i also have a simple CGI script
that captures the HTTP message body of a request (because that is
where the post data live) [3]. if you want to see something else,
i probably have a script for that too :)
[1] HTTPeek <URL:http://computerdog.com/httpeek/>
[2] <URL:http://computerdog.com:8088>, if it is running. sometimes
the ISP likes to kill it.
[3] just point your form at
<URL:http://computerdog.com/Cgi/demo/capture_post.cgi>
--
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: Thu, 13 Nov 1997 15:36:46 -0700
From: Dan Baker <dtbaker@flash.net>
Subject: which Perl is for me?!
Message-Id: <346B80FE.120D@flash.net>
Yow! I've spent all afternoon chasing thru various sites trying to
figure out what version of Perl to download?! I am just getting started,
have read a couple books and decided Perl is the right tool for some
jobs I need to do, and am having trouble finding the right version/build
to download and install.
HELP!
I would like to create and test scripts on my home PC under win95. Small
utility scripts will just be intended to run in the win95 environment...
But I also want to do a little scripting that will work in www sites
with UNIX servers. Assuming I don't get too fancy, should scripts I
create and test at home on win95 run on the unix servers? Just simple
stuff like grocery cart scripts for online ordering...
Please let me know more about what version of Perl (i.e. 5.004_04, or
???) I should be getting. Should I stick to older versions like 4.0 to
be sure my ISP can support the Perl calls? Is all I need the binaries?
What the heck do I need to do to download and unzip the *.tar.gz files?
Thanx....
Dan Baker
please cc me on followup postings, this newsgroup is so active, I'm
afraid I miss replies.
------------------------------
Date: 13 Nov 1997 21:14:58 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Y2000 Issues in PERL CGI scripts?
Message-Id: <64fqki$gg6@news-central.tiac.net>
In article <346B6577.75CE@bani.com>, Kurt Stype <kurt.stype@bani.com> wrote:
>Does anyone have any suggestions on what things to look out for in PERL
>CGI scripts that might cause Y2000 problems?
Code which says things like:
$year = '19' . sprintf '%02d', (localtime)[5];
as opposed to showing evidence of having read the description of localtime
in perl's documentation.
Code which accepts or stores 2 digit years...
For starters.
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: Thu, 13 Nov 1997 17:08:04 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Y2000 Issues in PERL CGI scripts?
Message-Id: <comdog-ya02408000R1311971708040001@news.panix.com>
In article <346B6577.75CE@bani.com>, kurt.stype@bani.com wrote:
>Does anyone have any suggestions on what things to look out for in PERL
>CGI scripts that might cause Y2000 problems?
i've heard rumors about Perl4 having problems...
but watch out for logic mistakes - such as only using the last two
digits of the year to represent something. the only Y2K problems are
the programmers :)
--
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>
just things you hear in a spinning bar
------------------------------
Date: 13 Nov 1997 22:53:41 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Y2000 Issues in PERL CGI scripts?
Message-Id: <64g0dl$msk@news-central.tiac.net>
In article <comdog-ya02408000R1311971708040001@news.panix.com>,
brian d foy <comdog@computerdog.com> wrote:
>In article <346B6577.75CE@bani.com>, kurt.stype@bani.com wrote:
>
>>Does anyone have any suggestions on what things to look out for in PERL
>>CGI scripts that might cause Y2000 problems?
>
>i've heard rumors about Perl4 having problems...
What rumours and where did you hear them?
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: 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 1314
**************************************