[19518] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1713 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 8 00:05:36 2001

Date: Fri, 7 Sep 2001 21:05:07 -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: <999921907-v10-i1713@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 7 Sep 2001     Volume: 10 Number: 1713

Today's topics:
        @INC on VMS <Patrick_member@newsguy.com>
    Re: @INC on VMS <dan@tuatha.sidhe.org>
    Re: Compiling Scripts to DOS EXEs <samneric@tigerriverOMIT-THIS.com>
    Re: data structure to solve this puzzle..as it's Friday (E.Chang)
    Re: data structure to solve this puzzle..as it's Friday <Jon.Ericson@jpl.nasa.gov>
    Re: dec2hex conversion ,uninitialized value <goldbb2@earthlink.net>
    Re: help with wierd sort problem <goldbb2@earthlink.net>
    Re: How do I use a / in a regular expression? <mmynsted@prodigy.net>
        Make a little extra income from home lnerwn@yahoo.com
        Need help passing visitor's cookies to target site to o (Alex)
    Re: Net::Telnet module (David Efflandt)
    Re: OT: Re: Recommendations for a PERL editor (Tim Hammerquist)
    Re: PERL modules and GPL license (Mark Jason Dominus)
        Perl/CGI problem <ctsay81@stanford.edu>
    Re: Perl/CGI problem (Tad McClellan)
    Re: pictures saving problem... <Laocoon@eudoramail.com>
    Re: pictures saving problem... (Joe Smith)
    Re: Shared Libraries <william-seeley@home.com>
    Re: Shared Libraries (Smiley)
        system() can't start serever app - HELP (Steve Klebar)
    Re: system() can't start serever app - HELP (David Efflandt)
    Re: system() error message (Tad McClellan)
    Re: uploading files using CGI (David Efflandt)
        Where can I find a Perl SSH Telnet Client? <whataman@home.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 7 Sep 2001 17:03:49 -0700
From: Patrick Flaherty <Patrick_member@newsguy.com>
Subject: @INC on VMS
Message-Id: <9nbn950htu@drn.newsguy.com>


How do I define @INC on VMS?  (Presumably with a logical name).  Looked through
the documentation and it's not yet apparent to me.

  thanx.

  pat



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

Date: Sat, 08 Sep 2001 01:41:22 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: @INC on VMS
Message-Id: <6Hem7.316511$v5.31719849@news1.rdc1.ct.home.com>

Patrick Flaherty <Patrick_member@newsguy.com> wrote:

> How do I define @INC on VMS?  (Presumably with a logical name).  Looked through
> the documentation and it's not yet apparent to me.

Just like you do everywhere else. :)

The -I flag works fine (quote it so it doesn't get downcased), as does the
use lib pragma.

					Dan


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

Date: Fri, 7 Sep 2001 22:29:20 -0400
From: Samneric <samneric@tigerriverOMIT-THIS.com>
Subject: Re: Compiling Scripts to DOS EXEs
Message-Id: <MPG.16034c8b3d24e6749896ac@news.onemain.com>

Graham W. Boyes wrote:
> > A boot disk loads an operating system. So what operating system gets loaded 
> > from a Windows98 boot disk?
> 
> Um, Windows 98?
> 
> Also known as DOS Version 7 I believe.

You can tell that I haven't used a boot disk in a while :)

Still, you might try compiling a program with Perl2exe and see if it runs off 
the disk before jettisoning that idea completely. With Microsoft it's hard to 
tell what is or isn't the OS...


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

Date: Fri, 07 Sep 2001 22:34:26 GMT
From: echang@netstorm.net (E.Chang)
Subject: Re: data structure to solve this puzzle..as it's Friday afternoon !
Message-Id: <Xns9115BDBD545CEechangnetstormnet@207.106.93.86>

mbower@ibuk.bankgesellschaft.de (mbower) wrote in 
<3b98dbfe.12501031@news>:

> Isaw this puzzle on a beer mat, and wondered how best to code + solve
> this in Perl ?
> 
> I did it in VBA in no time,  but trying to represent the pyramid is
> confusing me...any ideas ?
> 
> The sum of each two adjacent squares gives the number above.  Fill in
> the blanks ....
> 
> i.e  the numbers below 400, could be 200 +200  or 0 + 200 etc.......
> 
>                                                            
>                      400                                      
>                   xx    xx                                     
>                80    xx    120                                    
>             xx    xx    xx    xx                                   
>          20    xx    xx    xx    40      


#!usr/bin/perl -w
use Math::Matrix;
$eqn = new Math::Matrix ([2, 1, 0,  60],
                         [0, 1, 2,  80],
                         [1, 2, 1, 100]);
$eqn->print("Equations\n");
$ans = $eqn->solve;
$ans->print("Solution\n");
__END__

Explanation:
                                                           
                     400                                      
                  xx    xx                                     
               80    xx    120                                    
            xx    xx    xx    xx                                   
         20    xx    xx    xx    40 


Naming the bottom three blanks, and using those to determine 
the others, the pyramid becomes:

                     400
             80+x+2y+z  120+x+2y+z 

             80        x+2y+z     120 

      20+x         x+y        y+z       z+40
 
20            x          y          z          40  

So

(1) 20  + 2x +  y       =  80
(2) 40  +       y + 2z  = 120 
(3) 200 + 2x + 4y + 2z  = 400

-- 
EBC


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

Date: 07 Sep 2001 15:06:37 +0000
From: Jon Ericson <Jon.Ericson@jpl.nasa.gov>
Subject: Re: data structure to solve this puzzle..as it's Friday afternoon !
Message-Id: <868zfrujk2.fsf@jon_ericson.jpl.nasa.gov>

mbower@ibuk.bankgesellschaft.de (mbower) writes:

> Isaw this puzzle on a beer mat, and wondered how best to code + solve
> this in Perl ?
> 
> I did it in VBA in no time,  but trying to represent the pyramid is
> confusing me...any ideas ?

How did you do it in VBA?  I hate to be suspicious of you, but you
have to admit that it's strange that you don't ask more specific
questions.  Why not use the VBA version?

> The sum of each two adjacent squares gives the number above.  Fill in
> the blanks ....
> 
> i.e  the numbers below 400, could be 200 +200  or 0 + 200 etc.......
> 
> 
> 
> 
> 
>                                                            
>                      400                                      
>                   xx    xx                                     
>                80    xx    120                                    
>             xx    xx    xx    xx                                   
>          20    xx    xx    xx    40      

                                                            
                       400                                      
                     A     B                                     
                 80     C    120                                    
              D      E     F     G                                   
           20     H     I     J    40      


A + B = 400
80 + C = A
C + 120 = B
D + E = 80
E + F = C
F + G = 120
20 + H = D
H + I = E
I + J = F
J + 40 = G

80 + 2C + 120 = 400
C = 100
A = 180
B = 220
And so on.

If you really want to solve the beer mat, I think the proper tool is
algebra.

Jon




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

Date: Fri, 07 Sep 2001 23:38:40 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: dec2hex conversion ,uninitialized value
Message-Id: <3B9992C0.C7820EA0@earthlink.net>

Peter J. Acklam wrote:
> 
> Bart Lateur <bart.lateur@skynet.be> wrote:
> 
> >       sub int2dec {
> >            return "$_[0]";
> >       }
> 
> Hmm.  Then I guess dec2int would be
> 
>     sub dec2int {
>         return +$_[0];
>     }

Sorry, no.  Try
	perl -e' sub x{return +$_[0]} print x("foo"), "\n" '
and you will see that it prints:
	foo

I think what you really want in place of this is:
	sub str2num {
		no warnings qw(numeric);
		return $_[0]+0;
	}
or
	sub str2int {
		no warnings qw(numeric);
		return int $_[0];
	}
-- 
"I think not," said Descartes, and promptly disappeared.


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

Date: Fri, 07 Sep 2001 23:59:39 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: help with wierd sort problem
Message-Id: <3B9997AB.30135D4C@earthlink.net>

Phil R Lawrence wrote:
> 
> I've worked on this all day, but I could use some help, at least
> conceptually.  How would you try to sort a list of hashrefs such as
> following example (layed out in table form for easy reading):
> 
> ID FROM TO    (These are the Keys)
> 1 B X
> 2 C B
> 3 D B
> 4 X Y
> 5 B D
> 
> They need to be ordered such that the progression of TO and FROMs link
> correctly.

Sounds like what you need is a kind of topological sort.

Here's an ascii art of the graph.

    (C) -[2]-> (B) -[5]-> (D)
                |  <-[3]-
               [1]
                |
                V
               (X) -[4]-> (Y)


> In this case the answer is 2,5,3,1,4.

Well, actually, it could be 2,1,4, or 2,5,3,5,3,5,3,5,3,1,4, etc.

> 
> But how to do this sorting programmatically on any given list of
> hashrefs (not to exceed 6 or so)?  Ideas?

Most topological sorting routines assume that there are no cycles.
If there are cycles, they often don't work.

If you could change your requirements [only require that the program
have to work with acyclic graphs], then you could probably find a
numerical/graph algorithm on cpan which can do the job for you.

-- 
"I think not," said Descartes, and promptly disappeared.


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

Date: Fri, 07 Sep 2001 22:31:04 GMT
From: Mark Mynsted <mmynsted@prodigy.net>
Subject: Re: How do I use a / in a regular expression?
Message-Id: <m2ae06prcq.fsf@mmynsted.corp.vha.com>

Bart Lateur <bart.lateur@skynet.be> writes:

> Mark Mynsted wrote:
> 
> >I want to remove all of the <font> and </font> type tags from many
> >files.  Something like the following would work if possible...
> >
> >perl -pi -e 's/\</?font.*?\>//ig' file
> >
> >                 ^
> >It will not because of the / char.  The following also does not work.
> 
> Put a backslash in front of it.
> 
> 	perl -pi -e 's/\<\/?font.*?\>//ig' file
> 
> Or, as the other poster wrote, you can replace the '/' delimiters with
> something else, 
> 
> single delimiters:
> 
> 	s!PAT!SUBST!
> 	s@PAT@SUBST@
> 	s:PAT:SUBST:
> 	s;PAT;SUBST;
> 
> or with mathing pairs:
> 
> 	s(PAT)(SUBST)
> 	s[PAT][SUBST]
> 	s{PAT}{SUBST}
> 	s<PAT><SUBST>
> 
> -- 
> 	Bart.

Thank you.

-- 
-MM
                                               /"\
(No un-solicited email please.)                \ /     ASCII Ribbon Campaign
See following url,                              X      Against HTML Mail
http://pages.prodigy.net/mmynsted/spamoff.htm  / \


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

Date: Sat, 08 Sep 2001 00:40:04 GMT
From: lnerwn@yahoo.com
Subject: Make a little extra income from home
Message-Id: <ENdm7.11888$iy4.863813@paloalto-snr1.gtei.net>

Dear Respondent:

Thank you for your response to the ad. As you may already know, e-mail/order processing is an "in high demand" job for work at home related jobs. This is an opportunity for Home Typists that have access to a computer and e-mail account. This is not an MLM or get rich quick method. This may involve 2 to 3 hours a day of processing orders depending on the amount of work that you are willing to do. You are expected to process all orders that customers request promptly. Once you are set up with our step-by-step instructions and software, the only other thing you will need to do is go to your electronic mailbox. 

JOB REQUIRMENTS: No Experience is needed. You must
be self-motivated, have a PC and an e-mail account.

YOUR PAY: Payment for this position is based number of orders completed. You are paid PER ORDER COMPLETED $12.00- $18.00 PER ORDER. You will be paid
by money order to your Home Office. It will take you less than one hour to complete one order. 

TO APPLY, please mail your: 
1.) E-MAIL ADDRESS (very important)
2.) FULL NAME
3.) FULL ADDRESS 
4.) One-time Processing/Duplication Rights fee of $17.95 U.S. Funds to cover  the costs to send the software and information packet. There will be ABSOLUTELY no other charges to you. 

NOTICE: Due to large amounts of check fraud I have been receiving,  I can only accept money orders. PLEASE- Do NOT send cash. 

(Money orders payable to: George Alesna, Jr.) mail to:
George Alesna, Jr.
480 Chatsworth Dr. # 2
San Fernando, Ca 91340
U.S.A.

Once payment and info is received, I will E-mail the software and information packet as this will be faster and more convenient. Please allow 4-6 days from day you send payment and information to receive packet.

IF YOU HAVE ANY OTHER QUESTIONS OR CONCERNS 
MY E-MAIL ADDRESS IS: emailprocess2001@yahoo.com




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

Date: 7 Sep 2001 18:51:09 -0700
From: okizeme@hotmail.com (Alex)
Subject: Need help passing visitor's cookies to target site to obtain html content
Message-Id: <27391167.0109071751.af45b24@posting.google.com>

I'm attempting to write a cgi-perl script which will retrieve an html
page from another site. The only problem is that the target site needs
the session id of the web surfer located in a cookie so that it can
spit out the contents of the html file.

For example, the target site i'm trying to retrieve the html content
from contains the web surfer's shopping cart information. But in order
to generate the contents of their shopping bin, it needs to check for
a cookie created by the site to identify the unique visitor. My
question then...is there a way for me the create a script that allows
me to pass the cookie of the user running my script so that the target
site will generate the appropriate html contents for my script to
obtain.

I've heard that you might be able to do something like this with
LWP::UserAgent and HTTP::Cookies, but I'm not sure exactly how to go
about this.
Any suggestions or help would be appreciated.


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

Date: Fri, 7 Sep 2001 23:49:48 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Net::Telnet module
Message-Id: <slrn9pin8r.d8j.efflandt@typhoon.xnet.com>

On Thu, 06 Sep 2001, Chas Friedman <friedman@math.utexas.edu> wrote:
> On 6 Sep 2001 04:28:28 -0700, ianjy@hotmail.com (ian) wrote:
> 
>>I seem to be having a random problem with this module.....
>>Using the basic example provided (telnet to a host,run 'who' and print
>>the results)
>>Some of the time it works fine - output is as expected - no probs.
>>
>>But there are a lot of times when there is no output at all.
>>The logs show the prompts and the command being sent and more
>>prompts...
>>but no command echo and no results.
>>
>>Could this be a timing issue??
>>
>>I've tried various prompt matches - and simplified the remote systems
>>prompt,
>>the prompt is being recognised, but the command doesn't seem to be
>>seen by the remote host.
>>
>>Thanks
> I had problems like the ones you mention also. Here is a script which
> seems successful:
> #!/usr/bin/perl
> # file: remote.pl
> 
> use strict;
> use Net::Telnet;
> 
> my $passwd=shift;
> 
> my $telnet =
> Net::Telnet->new(Host=>'linux63.ma.utexas.edu',Prompt=>'/linux63> $
> /');
>  
> $telnet->waitfor('/login/');
> $telnet->print("friedman");
> $telnet->waitfor('/Password/');
> $telnet->print("$passwd\n");
> $telnet->waitfor('/linux63/');
> my @lines = $telnet->cmd("date");
> $telnet->print("logout\n");
> print @lines;
> ~
> (Of course, you'll have to change the prompt and user name.)

But it may work better if you waitfor the tail end of the prompt, so you
are sure that the system is ready.  For example if you waitfor 'login',
what if it is 'Login:', and it probably ends with a trailing space.  So it
may be better to look for /ogin: / and /assword: / and whatever the tail
and of your system prompt is (which also likely ends with a space).

-- 
David Efflandt - All spam is ignored - http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://cgi-help.virtualave.net/  http://hammer.prohosting.com/~cgi-wiz/


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

Date: Sat, 08 Sep 2001 00:26:03 GMT
From: tim@vegeta.ath.cx (Tim Hammerquist)
Subject: Re: OT: Re: Recommendations for a PERL editor
Message-Id: <slrn9piq49.uf.tim@vegeta.ath.cx>

Me parece que Jonadab the Unsightly One <jonadab@bright.net> dijo:
> tim@vegeta.ath.cx (Tim Hammerquist) wrote:
> 
> > > > Forget WINE. 
> > > 
> > > That's pretty much what I'm doing.  
> > 
> > Wine could only run two Win32 programs consistently (but not stably):
> > Notepad and UltraEdit-32.  Others seemed to rely too much on external
> > DLLs that Wine apparently can't handle yet.
> 
> It's not *that* bad.  

On my box it was.  Of course, most of the other applications I ran on
Win32 were pretty dll-intensive; Macromedia Director for example.  If I
could get my ROM emulators to run (w/ or w/o WINE) I'd be a very happy
man. =)

> But it isn't really stable, either, and if I'm going to 
> accept instability I may as well use Windows.  

Very well put. May I quote you on that?  Seriously?

Tim
-- 
Watch my captor grow old and die.
No satisfaction. Still here.
    -- Morpheus, The Sandman


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

Date: Sat, 08 Sep 2001 02:04:45 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: PERL modules and GPL license
Message-Id: <3b997cbc.2db6$2a9@news.op.net>

In article <3b98e3b4@news.victoria.tc.ca>,
Malcolm Dew-Jones <yf110@vtn1.victoria.tc.ca> wrote:
>David Coppit (newspost@coppit.org) wrote:
>: Mark Jason Dominus wrote:
>
>: > In article <30586a1d.0109060149.2fa2141a@posting.google.com>,
>: > Samppa <sami@xenetic.fi> wrote:
>: > 
>: >>I am planning to use PERL modules  which are publised under
>: >>GPL license. I am not changing the code of these modules just
>: >>using them.
>: >>
>: >>What is your opinion, how does these modules (under GPL)
>: >>affect to my code licensing and the availability
>: >>to my source code ?
>: > 
>: > The GPL requires that your entire program be released under the terms
>: > of the GPL.  The would mean that you are required to make the source
>: > code available.  
>: > 
>
>Not exactly.

Yes, exactly.

For example:

        Can I use the GPL for a plug-in for a non-free program?

             If the program uses fork and exec to invoke plug-ins,
             then the plug-ins are separate programs, so the license
             for the main program makes no requirements for them. So
             you can use the GPL for a plug-in, and there are no
             special requirements.

             If the program dynamically links plug-ins, and they make
             function calls to each other and share data structures,
             we believe they form a single program, so plug-ins must
             be treated as extensions to the main program. This means
             that linking the GPL-covered plug-in with the main
             program would violate the GPL.

http://www.gnu.org/licenses/gpl-faq.html


>  If you derive code from GPL code or link your code to GPL
>code then that is true. 

The situation here is that the guy has someone else's Perl module,
which he wants to use in his program.  This is exactly the situation
discussed above.

If it were a separate program running in a separate process, it would
be exempt, but it isn't, so it isn't.

As you point out, the LGPL was designed to allow such things as
dynamic linking of free libraries with non-free programs. This should
have suggested to you that such uses are *not* allowed under the GPL,
or there would have been no need for the LGPL in the first place.

>...questions, not answers...

Except you began with "not exactly", which makes it sound like you
have some idea what you're talking about.

If you're really interested in the answers, you may want to consult
the FSF's GPL FAQ, which addresses your questions in some detail.

-- 
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print


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

Date: Fri, 7 Sep 2001 15:03:04 -0700
From: Caroline Jacinta Tsay <ctsay81@stanford.edu>
Subject: Perl/CGI problem
Message-Id: <Pine.GSO.4.31.0109071500590.2274-100000@cardinal0.Stanford.EDU>

Hi all,

If I'm running a CGI script written in Perl after a user submits some
info. on a web page, why can't it run any other Perl modules such as
Win32::NetAdmin??   Right now, my script can run on the command line fine,
but if I call it when a user submits info. on a page, it won't run
correctly.

Any ideas?

Thanks so much for your help,
Caroline





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

Date: Sat, 08 Sep 2001 04:02:13 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Perl/CGI problem
Message-Id: <slrn9pigii.dq2.tadmc@tadmc26.august.net>

Caroline Jacinta Tsay <ctsay81@stanford.edu> wrote:

>my script can run on the command line fine,
>but if I call it when a user submits info. on a page, it won't run
>correctly.


Perl FAQ, part 9:

   "My CGI script runs from the command line but not the browser."


"it won't run correctly" is a worthless diagnostic. We cannot
help you if that is all you are going to give us to work with.

How do you know that it isn't "correct"? Did you see something?
What did you see? Get any error messages? Can you even see
your error messages if there were any?

Perl FAQ, part 9:

   "How can I get better error messages from a CGI program?"


>Any ideas?


There are lots (seven, by my count) of Frequently Asked Questions
that mention "CGI", you should probably have look at all of them:

   perldoc -q CGI


It is "working" in a shell environment, but not working in a
CGI environment. There is something about the environment
(not the programming language) that is different.

You do not have a Perl problem. You have a web server problem.

Try asking in a newsgroup that is about the web, such as:

      comp.infosystems.www.authoring.cgi
      comp.infosystems.www.servers.ms-windows


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Sat, 8 Sep 2001 01:08:44 +0200
From: Laocoon <Laocoon@eudoramail.com>
Subject: Re: pictures saving problem...
Message-Id: <Xns9116D09249B8Laocooneudoramail@62.153.159.134>

Try binmode()..perldoc -f binmode


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

Date: Sat, 8 Sep 2001 00:53:31 +0000 (UTC)
From: inwap@best.com (Joe Smith)
Subject: Re: pictures saving problem...
Message-Id: <9nbq6b$2sak$1@nntp1.ba.best.com>

In article <hfbm7.1285$e6.28999@news.chello.be>,
WebMeester <wm@rd66.rr.nu> wrote:
>I have to write a script that takes a few pictures (.gif and .jpg) from one
>webserver and saves them on an other webserver (kind of a mirror thing). The
>script I've written (using LWP) works partially. It does retrieve the pictures
>and saves them on the other server, but when I open a picture, it is all
>scrambled.

Why reinvent the wheel, when LWP::Simple does all that for you.

  perl -MLWP::Simple -e 'mirror("http://www.example.com/a.gif","a.gif");'
	-Joe
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.


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

Date: Sat, 08 Sep 2001 03:05:53 GMT
From: William Seeley <william-seeley@home.com>
Subject: Re: Shared Libraries
Message-Id: <3B998B20.C8071EF2@home.com>

That's a big subject, and a broad question. I would suggest you start by
familiarizing yourself with the Object Oriented capabilities in Perl.
You will be more likely to enlist the help of others when you have at
least a general understanding of what you want to do as well as a very
specific question

Good places to start are:

OO Perl by Damien Conway, and
Programming Perl by Larry Wall, et al.

Good Luck.
-Will

Smiley wrote:

> How do I compile Perl code into a shared library?



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

Date: Sat, 08 Sep 2001 03:57:03 GMT
From: gurm@intrasof.com (Smiley)
Subject: Re: Shared Libraries
Message-Id: <3b999176.38925471@news1.on.sympatico.ca>

Wow, I didn't realize it was that big a topic.  I've already got the
subroutines I want to use, I thought I could just compile them.

I guess I should be more specific.  I'm trying to set up a chat
program on a website I'm working on.  This isn't just a simple script
though, it comes with it's own server and allows you to add servlets
to override certain functions by setting up certain functions and
compiling them into a shared library.

I want to set up the library to set up a function called
iServAutheticate that will check my user database and return whether
the user in question is valid or not.

I'm thinking that this shouldn't be too hard of a task to complete -
but the documentation on this is a little fragmented and hard to
understand.

I don't think I need to go out and buy a book for a small task like
this, could you perhaps point me in the direction of a website that
might be able to help me out?

>That's a big subject, and a broad question. I would suggest you start by
>familiarizing yourself with the Object Oriented capabilities in Perl.
>You will be more likely to enlist the help of others when you have at
>least a general understanding of what you want to do as well as a very
>specific question
>



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

Date: 7 Sep 2001 15:34:41 -0700
From: sjklebar@hotmail.com (Steve Klebar)
Subject: system() can't start serever app - HELP
Message-Id: <1a4e7e5d.0109071434.2e64ca81@posting.google.com>

I can not start an application on a server (Mandrake 8.0, apache) via
a perl/cgi script started on a win client. I have set xhosts + (to
simplify test)

Client perl cgi script
$runcmd = "bin/switch";
$rtn = system ($runcmd);

Server bash script "/bin/switch";
echo "This is a test" >> /var/www/temp/test 
/usr/bin/appname
 
Results:
1) appname starts when bash script is run from the server cmd line
2) bash script will not run when started from client cgi script
($rtn=256)
3) comment out #/usr/bin/appname in bash script and
bash script runs when started from client cgi script ($rtn=0)

Thanks in advance for your time and help with this. Any suggestions
for areas of research or an actual fix is appreciated.

Steve


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

Date: Sat, 8 Sep 2001 00:04:10 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: system() can't start serever app - HELP
Message-Id: <slrn9pio3p.d8j.efflandt@typhoon.xnet.com>

On 7 Sep 2001 15:34:41 -0700, Steve Klebar <sjklebar@hotmail.com> wrote:
> I can not start an application on a server (Mandrake 8.0, apache) via
> a perl/cgi script started on a win client. I have set xhosts + (to
> simplify test)

What does xhosts have to do with CGI?  If you are trying to run an X 
program remotely, have you set $ENV{DISPLAY} to point to the remote X 
server.  This might not work from CGI unless you daemonized the Perl or 
bash first (perldoc perlipc).

> Client perl cgi script
> $runcmd = "bin/switch";
> $rtn = system ($runcmd);
> 
> Server bash script "/bin/switch";
> echo "This is a test" >> /var/www/temp/test 
> /usr/bin/appname

To also see stderr you might want to do:  /usr/bin/appname 2>&1

> Results:
> 1) appname starts when bash script is run from the server cmd line
> 2) bash script will not run when started from client cgi script
> ($rtn=256)
> 3) comment out #/usr/bin/appname in bash script and
> bash script runs when started from client cgi script ($rtn=0)

Looks like a permission (or maybe a path) problem.
So what is your Perl question?

-- 
David Efflandt - All spam is ignored - http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://cgi-help.virtualave.net/  http://hammer.prohosting.com/~cgi-wiz/


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

Date: Sat, 08 Sep 2001 04:02:14 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: system() error message
Message-Id: <slrn9pigqa.dq2.tadmc@tadmc26.august.net>

Matt Carey <mattc@country-life.com> wrote:
>I have a perl program(running on Linux/Apache) that accepts form data
>from a web page(consisting of textareas) and then uses a remote shell
>command to pass the form data to another server( an HP-UX).


I really really really hope you have taint checking turned on!

Do you?


>$runcommand = "rsh consac /usr/bin/nsperl
>/u/data/CONSAC/SRC.PERL/runuvprog.pl $data";
> $result = system($runcommand);

>Upon completion of the system call  this message appears in the browser:
>
>'Attempted READ of record ID larger than file/table maximum record ID
>size of 255 characters.'
>
>I'm trying to find out why I'm getting this message.  I'm not reading
                        ^^^
                        ^^^

The first step there would be to discover "where" the
message is coming from.

It is not coming from Perl, because it does not appear in perldiag.pod.

Your problem lies elsewhere, you are looking for answers in the 
wrong place...


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Sat, 8 Sep 2001 00:15:40 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: uploading files using CGI
Message-Id: <slrn9piopc.d8j.efflandt@typhoon.xnet.com>

On 6 Sep 2001 16:05:43 -0700, Arran <arran.price@datamail.co.nz> wrote:
> Hi all,
> Im a little confused in regard how to upload a file.
> I have a cgi script that a user will select a file to upload, press
> the upload button and the same script will do the actual uploading
> (all operation completed within the one script - it displays different
> pages dependant on what action button was used).
> 
> code extracts:
> 
> use CGI qw /:standard :html3/;   #using this
> start_html("my page title"),  start_multipart_form,   #starting form
> as multipart
> 
> print "File to upload: <input type=file name=upfile><br>",
>          $Q->submit('Action','Upload'),p;

You seem to be mixing function method and object method and input tags not 
using either method.  That could get confusing.  It would appear that $Q 
is undef (so probably ignored and unnecessary).

> after pressing upload, the script may present another page, when
> clicking the appropriate action from here the upload occurs. In order
> to keep the value of upfile. Im doing:
> 
>    print $Q->hidden('upfile','$MYFILE');
>    $MYFILE=param('upfile');
> 
> Im wondering if I can do this as Im not sure if I get passed the
> filename or more detail ie content, filetype etc(if not how to I
> retain it?).

No, most browsers rightly refuse to preset any filename for a file upload
field for security reasons (otherwise you could possibly hide a file
upload field in a form and grab a file without the user knowing it).

-- 
David Efflandt - All spam is ignored - http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://cgi-help.virtualave.net/  http://hammer.prohosting.com/~cgi-wiz/


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

Date: Sat, 08 Sep 2001 03:10:01 GMT
From: "What A Man !" <whataman@home.com>
Subject: Where can I find a Perl SSH Telnet Client?
Message-Id: <3B998C15.3B8C5017@home.com>

Does anyone know where I can find an SSH Client that's written in Perl
that will allow me to input telnet commands thru SSH Telnet? 

Thanks,
Dennis


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 V10 Issue 1713
***************************************


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