[7954] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1579 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jan 4 17:07:37 1998

Date: Sun, 4 Jan 98 14:00:23 -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           Sun, 4 Jan 1998     Volume: 8 Number: 1579

Today's topics:
     Calling 'require' on an arbitrary module (Tom Hukins)
     Re: Calling 'require' on an arbitrary module (Joshua J. Kugler)
     Re: CGI Bin Locked????? HAY-ELP!! (Joshua J. Kugler)
     Re: Find two strings in a file <rootbeer@teleport.com>
     Re: Hashes - Heres my try, can you help me to tidy it u <dvk@lonewolf.com>
     Re: Help im stuck (Joshua J. Kugler)
     Re: Help im stuck <ebohlman@netcom.com>
     Re: Help im stuck <rootbeer@teleport.com>
     Re: How to get keyword <rootbeer@teleport.com>
     Re: How to install new modules in private dir <rootbeer@teleport.com>
     Re: HTML Templates...Whats the best method (Joshua J. Kugler)
     Re: HTML Templates...Whats the best method <ebohlman@netcom.com>
     Re: HTML Templates...Whats the best method <rootbeer@teleport.com>
     Re: I tired to modify.... (Joshua J. Kugler)
     Re: I tired to modify.... <rootbeer@teleport.com>
     Re: modifying file lines exceptions (Tad McClellan)
     Re: MultiDimensional array. Simple one (Huu Da Tran)
     Re: Perl, SQL, and Parsing <rootbeer@teleport.com>
     Re: PERLIPC - FIFO: parent, child, stalled! <rootbeer@teleport.com>
     Re: PERLIPC - FIFO: parent, child, stalled! <rootbeer@teleport.com>
     Re: Trouble with Print Location (Joshua J. Kugler)
     Re: Trouble with Print Location <rootbeer@teleport.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 04 Jan 1998 19:10:05 GMT
From: tom@NOSPAMeborcom.com (Tom Hukins)
Subject: Calling 'require' on an arbitrary module
Message-Id: <34afcf05.1180012@nntp.netcom.net.uk>

I am writing a program where data can be passed to one of many
subroutines, depending on the type of data.

The best way I could think of to do this is to place each
subroutine in its own module. The type of data is ascertained,
the relevant module is included in the code and its function
called.

This means subroutines can be added without modifying existing
code, and compilation time and file size are both reduced.

In order to do this I tried various things along the lines of:
	$module = 'This::Module';
	require $module;
but I couldn't get anything along these lines to work.

Any suggestions on how to 'require' arbitrary modules into the
code or how to solve this problem any other way would be greatly
appreciated!

Tom


To reply to this message remove the phrase 'NOSPAM' from my address

-- 
       Learn how to create amazing web sites

     Visit eBORcOM's Web Development Resources
          http://www.eborcom.com/webmaker/


------------------------------

Date: Sun, 04 Jan 1998 19:40:22 GMT
From: jkugler@inreach.com (Joshua J. Kugler)
Subject: Re: Calling 'require' on an arbitrary module
Message-Id: <34afe588.1276841@news.inreach.com>

On Sun, 04 Jan 1998 19:10:05 GMT, tom@NOSPAMeborcom.com (Tom Hukins)
wrote:

You could try having your subroutines after your __END__ statement in
your Perl code. Then the routines would only be compiled if they are
called.  I think.  You might have to double check that.

j----- k-----

()I am writing a program where data can be passed to one of many
()subroutines, depending on the type of data.
()
()The best way I could think of to do this is to place each
()subroutine in its own module. The type of data is ascertained,
()the relevant module is included in the code and its function
()called.
()
()This means subroutines can be added without modifying existing
()code, and compilation time and file size are both reduced.
()
()In order to do this I tried various things along the lines of:
()	$module = 'This::Module';
()	require $module;
()but I couldn't get anything along these lines to work.
()
()Any suggestions on how to 'require' arbitrary modules into the
()code or how to solve this problem any other way would be greatly
()appreciated!


I read this group. Sometimes my ISP doesn't. Please e-mail too.

Joshua J. Kugler
Computer Consultant--Web Developer
jkugler@inreach.com
http://www.cwebpages.com/jkugler
Every knee shall bow, and every tongue confess, in heaven, on earth, and under the earth, that Jesus Christ is LORD -- Count on it!



------------------------------

Date: Sun, 04 Jan 1998 19:38:27 GMT
From: jkugler@inreach.com (Joshua J. Kugler)
Subject: Re: CGI Bin Locked????? HAY-ELP!!
Message-Id: <34afe522.1174186@news.inreach.com>

On Sun, 04 Jan 1998 13:33:06 -0500, sean@dcdX.net (Sean O'Dwyer)
wrote:

()Hi,
()
()I'm a Perl newbie. I've written some scripts which I want to run
from my
()CGI bin so that's where I put them. There are several other scripts
in
()there already which run fine.
()
()When I try to access these scripts (calling them from a web page) I
get an
()error message saying "403 Forbidden. Your client does not have
permission
()to get URL /cgi-bin/demo/rndmzr.cgi from this server."
()
()Is there some security option I'm missing? Or does anyone have a
clue
()what's going on?

This is a FAQ.

Make sure the web server has execute permission for the scripts.  They
usually need to be set to 705 via chmod:

chmod 705 myscript.cgi

j----- k-----


I read this group. Sometimes my ISP doesn't. Please e-mail too.

Joshua J. Kugler
Computer Consultant--Web Developer
jkugler@inreach.com
http://www.cwebpages.com/jkugler
Every knee shall bow, and every tongue confess, in heaven, on earth, and under the earth, that Jesus Christ is LORD -- Count on it!



------------------------------

Date: Sun, 4 Jan 1998 13:17:04 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: boggiano@venus.it
Subject: Re: Find two strings in a file
Message-Id: <Pine.GSO.3.96.980104131406.24944U-100000@user2.teleport.com>

On Sat, 3 Jan 1998 boggiano@venus.it wrote:

> i must write a program for matching 2 strings (AND)
> in a file.
> 
> The file might have  the strings on different rows,
> so i can't use the statment:
> 
> if ((/$string1)&&(/$string2))

How about this method?

    my($found1, $found2);
    while (<FILE>) {
	$found1 ||= /$string1/o;
	$found2 ||= /$string2/o;
	last if $found1 and $found2;
    }
    if ($found1 and $found2) { ... }

Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



------------------------------

Date: Sun, 04 Jan 1998 15:50:21 -0500
From: "Daniel V. Klein" <dvk@lonewolf.com>
Subject: Re: Hashes - Heres my try, can you help me to tidy it up !
Message-Id: <34AFF579.171E@lonewolf.com>

I love Perl - 99.9% of my coding is in Perl nowadays.  And sometimes,
Perl just isn't the right answer.  Here's a shellish answer - the
advantage to which is that it will handle *gigantic* files without
huge amounts of memory:

tr -cd '[a-zA-Z]' '\012' < file | sort | uniq -c | sort -nr

-DanJerry Pank wrote:
> 
> I am trying to do a basic search through a document counting duplicated
> words and display the results in (repeat count) order.
> 
> There must be a way to sort the hash on values displaying :
> keys,values in value order (in a better way than I have).
> 
> Could this be achieved using regex ?
> 
> Heres my try:
> 
> #!/bin/perl5
> 
> use strict;
> 
> my (%hash,@array,@keys,@values,$i,$value,$key);
> 
> $_ = "egg egg bacon bread egg fried chips"; # its early morning !
> 
> # split words into @array using space delimiter
> @array = sort split(/ /);
> 
> # build hash of words,word_count (key,value)
> foreach $_ (@array) {
>         $hash{$_}++
> }
> 
> # perly black magic to sort hash by values
> @keys = sort { $hash{$b} <=> $hash{$a} || length($b) <=> length($a) ||
> $a cmp $b} keys %hash ;
> 
> # array of values in order
> @values = reverse sort values(%hash);
> 
> # put the two together
> foreach $key (@keys) {
>         print "$key $values[$i] \n";
>         $i++;
> }
> 
> # produces
> #       egg 3
> #       bacon 1
> #       bread 1
> #       chips 1
> #       fried 1
> 
> # your turn !
> 
> --
> __Jerry Pank_________________________jerryp.usenet@connected.demon.co.uk_
> 
> __www.netconnected.com__________________________Just_another_Perl_Hacker_


------------------------------

Date: Sun, 04 Jan 1998 19:45:44 GMT
From: jkugler@inreach.com (Joshua J. Kugler)
Subject: Re: Help im stuck
Message-Id: <34afe5ec.1377079@news.inreach.com>

On Sun, 4 Jan 1998 14:16:08 -0000, "agtbjw" <agtbjw@btinternet.com>
wrote:

Read the section on regexps and opening and reading files in the Perl
documentation. www.perl.com/CPAN/ will get you started.

If you are just starting out in Perl.  The the O'Reilly book: Learning
Perl. Then when you are done with that get Programming Perl; same
publisher.  And while you are at it, get the Perl Desktop Reference.
All of those have proved invaluable to me.

/^\w+/ will match any letter at the beginning of a line, as well as
any letter or _ in the rest of the line.

j----- k-----
()Hello I am a first year student and studying perl.
()
()Can anyone help with my problem
()
()I have to write a program which searches for and outputs each word
in an
()input file.  Each word must start with a letter and may include
letters
()numbers and underline'_'
()
()the space will act as the separator between the words.
()
()It sounds easy but I have no syntax to search for a letter,
()I dont know how to get to the input file


I read this group. Sometimes my ISP doesn't. Please e-mail too.

Joshua J. Kugler
Computer Consultant--Web Developer
jkugler@inreach.com
http://www.cwebpages.com/jkugler
Every knee shall bow, and every tongue confess, in heaven, on earth, and under the earth, that Jesus Christ is LORD -- Count on it!



------------------------------

Date: Sun, 4 Jan 1998 20:03:47 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Help im stuck
Message-Id: <ebohlmanEM9zqB.BDI@netcom.com>

agtbjw <agtbjw@btinternet.com> wrote:
: Hello I am a first year student and studying perl.

: Can anyone help with my problem

: I have to write a program which searches for and outputs each word in an
: input file.  Each word must start with a letter and may include letters
: numbers and underline'_'

: the space will act as the separator between the words.

: It sounds easy but I have no syntax to search for a letter,

You will after you read through perlre, which came with your Perl 
distribution (if for some reason it didn't, go to the reference section 
at www.perl.com).

 : I dont know how to get to the input file

You will after you read the section about input operators in perlop, and 
the section about open() in perlfunc.

Just out of curiosity, what textbook is your class using?



------------------------------

Date: Sun, 4 Jan 1998 13:07:02 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: agtbjw <agtbjw@btinternet.com>
Subject: Re: Help im stuck
Message-Id: <Pine.GSO.3.96.980104130431.24944S-100000@user2.teleport.com>

On Sun, 4 Jan 1998, agtbjw wrote:

> Subject: Help im stuck

Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.

    http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post

> Hello I am a first year student and studying perl.
> 
> Can anyone help with my problem

Gee, I hope you're not asking us to do your homework. :-) 

> I have to write a program which searches for and outputs each word in an
> input file.  Each word must start with a letter and may include letters
> numbers and underline'_'
> 
> the space will act as the separator between the words.
> 
> It sounds easy but I have no syntax to search for a letter,
> I dont know how to get to the input file

It sounds as if you want to use some of the functions from the perlfunc
manpage, especially open and split. You'll probably need to use hashes and
regular expressions as well. Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



------------------------------

Date: Sun, 4 Jan 1998 12:47:33 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Bosch Patrick <bosch@goweb.lu>
Subject: Re: How to get keyword
Message-Id: <Pine.GSO.3.96.980104123127.24944M-100000@user2.teleport.com>

On Sat, 3 Jan 1998, Bosch Patrick wrote:

> On a web server - using allready https 128 bit - clients of a banking
> institutin can leave rather confidential information. Several perl-cgi's
> handle the input and should save the information in encrypted manner
> using 3DES on AIX4.2. But ... the keyword used to encrypt should not be
> provided by the web user and should not be saved on the file system even
> not in a root only readable file. Because we want that the information
> remains secure even if the system has been cracked and the root account
> in particular. 

If the root account has been cracked, someone could capture all incoming
data before it's encrypted, of course. But already-encrypted data should
be safe if the encryption key isn't revealed. 

(Of course, none of this has anything specifically to do with Perl.)

> 1. There should be a daemon, which on startup should ask the user
> starting the daemon the different keyword, then raiming in the programs
> memory. 

The root user can read the program's memory, or could install a diddled
daemon which would reveal the keyword. (I take it that you're using
"keyword" to mean the encryption key.) 

> 2. When needed the cgi scripts of the web server should call the daemon
> in order to get the keyword. 

The root user (and possibly others) could easily make the cgi scripts give
up the keyword.

> 3. The daemon should authentify the http user by ppid, pid and uid.

I'm not sure that that could even be possible. But in any case, that won't
help any if the system is cracked at the root level. :-(

You could simplify this plan by having a persistant process to serve the
requests, using Apache's mod_perl, for example. That process could keep
the keyword in memory, although it would still be vulnerable to a
root-level attack. 

> The main problem for me is to know how the daemon can get ppid, pid and
> uid from the web-script. 

If it is even possible, it sounds like an interprocess-communication
issue, rather than a Perl issue. (That is, the answer would be the same if
you were writing these programs in C or in any other language.) 

But I think that you're setting unreasonable goals: There's not much you
can do if the root account is cracked. Instead, you should probably
consider using a good strong firewall to keep the machine with the data
(and the key) well insulated from most potential attackers, and you should
restrict local logins and such as well. The folks in a newsgroup about
security issues should be able to help you more on those points. 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: Sun, 4 Jan 1998 13:21:14 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Li Xu <lxu@rice.edu>
Subject: Re: How to install new modules in private dir
Message-Id: <Pine.GSO.3.96.980104132028.24944V-100000@user2.teleport.com>

On Sun, 4 Jan 1998, Li Xu wrote:

> I am just a plain user without the root privilege. Is it possible to
> install those modules in my private directory? If yes, then how to do it
> systematically? 

    http://www.perl.com/CPAN/doc/manual/html/pod/perlfaq8/
          How_do_I_kep_my_own_module_libr.html

Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



------------------------------

Date: Sun, 04 Jan 1998 19:36:23 GMT
From: jkugler@inreach.com (Joshua J. Kugler)
Subject: Re: HTML Templates...Whats the best method
Message-Id: <34afe28c.512395@news.inreach.com>

On Sun, 04 Jan 1998 10:22:03 GMT, martyr@bluecrow.com (Martyr) wrote:

()I am writing some scripts for a website and I want to 
()use HTML templates.  What is the best way to go about
()this?  Are there any modules out there to help with this?
()The way I was thinking of doing it is one of these:
()
()a) Read the template file in line by line and doing multiple
()    substitutions on each line, then printing it out.
()    Seems very inefficient.
()
()b) Read the entire template file into a variable and do 
()    multiple substitutions on that.  However, I would
()    like to add things like table rows - the number and
()    contents of which are only known at run time.
()
()I am relatively new to Perl.  Any help would be much
()appreciated.
()
()Thanks in advance,

There is a Perl module that you can use for variable substitution.
Look for the Text::Vpp module on CPAN.   

There are also a couple of pretty advanced HTML preprocessors out
there that might be able to do the job.  I just completed one that is
a little simpler, but does the jobs I need it to do, which is what
counts I guess.  What kind of variable are needed at run time, and how
are the tables generated?  That can be easily done but simply,
counting, dividing, whatever.  If you would be interested in taking a
look at my script, I could send it too you, as well as a BRIEF doc,
and a few sample files, as I have not yet had the chance to write
documentation, or an install script.

Those advanced HTML preprocessors can be found at:

http://www.imatix.com/html/htmlpp/index.htm

and

http://www.eleves.ens.fr:8080/home/nthiery/htmlpp/index.html.en

If there are some custom capabilities you would like added, I can work
on my script.  It is a learning project, so I would be glad to at
least try to incorporate whatever features might be wanted.  I works
for my needs right now, but my needs are very broad right now either.

Let me know how it goes.

j----- k-----

I read this group. Sometimes my ISP doesn't. Please e-mail too.

Joshua J. Kugler
Computer Consultant--Web Developer
jkugler@inreach.com
http://www.cwebpages.com/jkugler
Every knee shall bow, and every tongue confess, in heaven, on earth, and under the earth, that Jesus Christ is LORD -- Count on it!



------------------------------

Date: Sun, 4 Jan 1998 20:00:26 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: HTML Templates...Whats the best method
Message-Id: <ebohlmanEM9zKq.B6F@netcom.com>

Martyr <martyr@bluecrow.com> wrote:
: I am writing some scripts for a website and I want to 
: use HTML templates.  What is the best way to go about
: this?  Are there any modules out there to help with this?
: The way I was thinking of doing it is one of these:

: a) Read the template file in line by line and doing multiple
:     substitutions on each line, then printing it out.
:     Seems very inefficient.

: b) Read the entire template file into a variable and do 
:     multiple substitutions on that.  However, I would
:     like to add things like table rows - the number and
:     contents of which are only known at run time.

Option a) is not likely to be much more inefficient that b), given that 
you're presumably going to be using buffered I/O to read in the template 
(the ordinary <FILE> construct uses buffered I/O).

Whichever method seems the most natural to you is probably the best one.  
I don't quite see why reading in the whole template file as a single 
string would preclude inserting multiple table rows.

Before diving further into implementation, I'd go over to CPAN and see if 
there are any modules that could help you.



------------------------------

Date: Sun, 4 Jan 1998 13:03:09 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Martyr <martyr@bluecrow.com>
Subject: Re: HTML Templates...Whats the best method
Message-Id: <Pine.GSO.3.96.980104130206.24944R-100000@user2.teleport.com>

On Sun, 4 Jan 1998, Martyr wrote:

> I am writing some scripts for a website and I want to 
> use HTML templates.  What is the best way to go about
> this?  Are there any modules out there to help with this?

There are several modules on CPAN which are useful in manipulating
text, and (of course) HTML is just text to Perl. I'm sure that at least
one of them will be good for you. 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: Sun, 04 Jan 1998 19:55:56 GMT
From: jkugler@inreach.com (Joshua J. Kugler)
Subject: Re: I tired to modify....
Message-Id: <34afe933.2215674@news.inreach.com>

On 4 Jan 98 14:12:02 GMT, "Kriebel" <kriebels@nauticom.net> wrote:

()is there anything wrong with that..or could it been possibly be the
script
()whats screwing up also..
()please help me..nobody else is.
()SK
()

What IS messing up?  What is it doing or not doing? What error
messages are you getting.  We can't diagnose without symptoms.

I read this group. Sometimes my ISP doesn't. Please e-mail too.

Joshua J. Kugler
Computer Consultant--Web Developer
jkugler@inreach.com
http://www.cwebpages.com/jkugler
Every knee shall bow, and every tongue confess, in heaven, on earth, and under the earth, that Jesus Christ is LORD -- Count on it!



------------------------------

Date: Sun, 4 Jan 1998 13:12:52 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Kriebel <kriebels@nauticom.net>
Subject: Re: I tired to modify....
Message-Id: <Pine.GSO.3.96.980104130755.24944T-100000@user2.teleport.com>

On 4 Jan 1998, Kriebel wrote:

> Subject: I tired to modify....

Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.

    http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post


> I tried to modify a scrip...but It didnt work..

Could you be more specific? Did the script work before you started
modifying it? Did it give any helpful diagnostic messages when you tried
running it? Did it refuse to run altogether? Did it run, but gave no
output? Did it give the wrong output? Did it make smoke come out of your
computer? There are a lot of ways that something may not work, and it
would help to know which it is.

>          print FILE "<a href=\"$DATA{ 'URLofRAM' }\"><img
> src=\gif\playbutton.gif>\n";

Are you sure that that's what you want?

>          print FILE "<\!-- singleAd -->\n\n";

And that? 

You could use a here-document in place of that series of print statements; 
that might make your code easier to read and maintain. (And you'd need
fewer backslashes, so they'd be easier to keep in the right places.) Hope
this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



------------------------------

Date: Sun, 4 Jan 1998 11:43:45 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: modifying file lines exceptions
Message-Id: <hoho86.4h.ln@localhost>

Kristin VanDragt (kvandra@uswest.com) wrote:
: I'm trying to read and modify a file.  After searching many different
: sources, I've found that the general solution is to create a temp copy,
: write any changes to it, and then copy over the original.  However, I've
: read that there are exceptions for manipulating files with all lines the
: same length or replacing one a sequence of bytes with another sequences
: of the same length.  I can't find any details.  Anyone know what these
: would be?


It is more trouble than it is worth. Just use the temp file method.


If you really want to do it, then lookup seek() and tell() in
the perlfunc man page.

Basically, you need to know the byte offsets in the file of the 
part you want to replace.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: Thu, 01 Jan 1998 20:19:56 GMT
From: tranhu@jsp.umontreal.ca (Huu Da Tran)
To: rarun@geocities.com
Subject: Re: MultiDimensional array. Simple one
Message-Id: <slrn6avpop.r0l.tranhu@derby.jsp.umontreal.ca>

Un jour, Arun (rarun@geocities.com)
     affirmait publiquement que:

| When I print out the elements,all it seems to be giving back is a
| address of some sort. I think I need to de-reference it. But how?

Here's a simple example...

push (@a, [1, 2, 3]);
$a = shift @a;
print "@{$a}\n";

HTH...
(Cc'ed)

-- 
__________________________________________________________________________
   TRAN, Huu Da                                  Universiti de Montrial
   tranhu@jsp.umontreal.ca         http://www.jsp.umontreal.ca/~tranhu/
//////////////////////////////////////////////////////////////////////////
Quand on veut plaire dans le monde, il faut se risoudre ` apprendre
beaucoup de choses qu'on sait par des gens qui les ignorent.
                                                         -- N. de Chamfort


------------------------------

Date: Sun, 4 Jan 1998 13:01:13 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Matan Amir <matan@kinetica.com>
Subject: Re: Perl, SQL, and Parsing
Message-Id: <Pine.GSO.3.96.980104130025.24944Q-100000@user2.teleport.com>

On 4 Jan 1998, Matan Amir wrote:

> I was wondering if anyone has created a module that would help me do
> this,

There are several modules on CPAN which would probably help you. Good luck
with your project!

-- 
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: Sun, 4 Jan 1998 12:30:03 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Jihad Battikha <jbattikha@highsynth.com>
Subject: Re: PERLIPC - FIFO: parent, child, stalled!
Message-Id: <Pine.GSO.3.96.980104122656.24944L-100000@user2.teleport.com>

On Sat, 3 Jan 1998, Jihad Battikha wrote:

> Tom Phoenix wrote:
> 
> > > The only symbolics refs left when I'm done will probably only be path
> > > variables.
> > 
> > I don't know what that means. Do you mean your $ENV{PATH}? That shouldn't
> > be accessed via a symbolic reference, for security reasons if nothing
> > else.
> 
> Other than hard-coding my account's home path (which I don't want to
> do), how could my script determine my home directory without using
> $ENV{DOCUMENT_ROOT}?  

You're right that you have to use that environment variable, but that's
not a symbolic reference! 'use strict' doesn't have any problem with you
using environment variables. 

> If I open the FIFO for read before the fork, the entire script will
> block at that point -- unless there's something I'm missinge here. 

No, you seem to have it right. My mistake. I don't think you'll be able to
use a FIFO for securely passing plaintext between processes. :-(

-- 
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: Sun, 4 Jan 1998 13:24:33 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Jihad Battikha <jbattikha@highsynth.com>
Subject: Re: PERLIPC - FIFO: parent, child, stalled!
Message-Id: <Pine.GSO.3.96.980104132145.24944W-100000@user2.teleport.com>

On Sun, 4 Jan 1998, Jihad Battikha wrote:

> Justin Vallon wrote:
> 
> > According to perl5, "undef == 0", so your test is not correct.

> what perlfunc states about fork:

> "Does a fork(2) system call. Returns the child pid to the parent process
> and 0 to the child process, or undef if the fork is unsuccessful."
> 
> Doesn't that mean that 'undef' does not mean "undef == 0", 

The == test (like all math operators in Perl) will turn undef into 0
before testing. The only way to check for undef is to use the defined() 
function. So the usual code checks defined() first, then if it was
defined, it checks true/false (which, in this case, is the same as
checking non-zero/zero). Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



------------------------------

Date: Sun, 04 Jan 1998 19:52:52 GMT
From: jkugler@inreach.com (Joshua J. Kugler)
Subject: Re: Trouble with Print Location
Message-Id: <34afe7c5.1849324@news.inreach.com>

On Sun, 4 Jan 1998 15:39:03 +0600, "Maxim Pavlov"
<maxim@online.sinor.ru> wrote:

FAQ ALERT!!

1. A script can only send one graphic.
2. A browser will only honor the first Location header, after that,
it's gone.  It will discard anything after that.
3. Why use a Perl script just to print a location header?  That's a
lot of overhead in startup and all.  Just use a shell script.
4. If you are going to use Perl to get graphics, use something like:

open(GFX, file.gif) or die "Crud";
print "ContentType: image/gif\n\n";
while (<GFX>)
	{
	print $_;
	}
close GFX;


()Hello,
()
()I would like to display more than one .gif file when my
()perl script is invoked, i.e.:
()
()print "Location: 1.gif\n\n";
()
()works fine - it sends 1.gif and I can insert it into a html-file
like
()this:
()
()<img src = "c.pl">
()
()BUT: I need several files to be displayed one after another:
()like 1 2 3 (assuming 1,2,3 be the .gif's)
()
()When I try print "Location: 1.gif\n\n Location: 2.gif\n\n";
()it doesn't work ;(
()
()What is wrong?
()
()Please email directly at maxim@online.sinor.ru
()
()Thanks!
()
()Maxim
()
()
()


I read this group. Sometimes my ISP doesn't. Please e-mail too.

Joshua J. Kugler
Computer Consultant--Web Developer
jkugler@inreach.com
http://www.cwebpages.com/jkugler
Every knee shall bow, and every tongue confess, in heaven, on earth, and under the earth, that Jesus Christ is LORD -- Count on it!



------------------------------

Date: Sun, 4 Jan 1998 12:58:23 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Maxim Pavlov <maxim@online.sinor.ru>
Subject: Re: Trouble with Print Location
Message-Id: <Pine.GSO.3.96.980104125649.24944O-100000@user2.teleport.com>

On Sun, 4 Jan 1998, Maxim Pavlov wrote:

> When I try print "Location: 1.gif\n\n Location: 2.gif\n\n";
> it doesn't work ;(

Perl can print that text just fine, so it's not a Perl problem. But if
you're trying to use a certain protocol, such as HTTP, you should follow
its specification. If you still have questions after you've read the
specification, you could ask your question in a newsgroup about HTTP or
something similar. Thanks!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



------------------------------

Date: 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 1579
**************************************

home help back first fref pref prev next nref lref last post