[11241] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4841 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Feb 7 13:07:22 1999

Date: Sun, 7 Feb 99 10:00:26 -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, 7 Feb 1999     Volume: 8 Number: 4841

Today's topics:
        Ads script wanted editor@dvar.com
        appending to nohup.out (Mark P.)
        Can't locate loadable object for module Win32::UserAdmi <michael@webstead.com>
        cookies pointers <nospam-seallama@mailcity.com>
    Re: cookies pointers (Bababozorg)
        CREATING TEXT TABLE (Bababozorg)
        CREATING TEXT TABLE bababozorg@aol.com
    Re: CREATING TEXT TABLE <nospam-seallama@mailcity.com>
        Embedded perl leaking memory (Mitchell Morris)
        Get current URL (Leslie Perjes)
    Re: Getting Perl to work with WinNT PWS <jcounts@voicenet.com>
    Re: Getting Perl to work with WinNT PWS <gellyfish@btinternet.com>
    Re: Getting Perl to work with WinNT PWS <gellyfish@btinternet.com>
        how can i post messages? <yotakim@hyowon.cc.pusan.ac.kr>
        how can i post? <yotakim@hyowon.cc.pusan.ac.kr>
        How do I use CGI.pm to fetch parameters? <bencas@bigfoot.com>
        I want to build shopping-mall..where I can get help? <ohmygod@tksun.aiit.or.kr>
    Re: installing cgi.pm win32/98?!? <gellyfish@btinternet.com>
    Re: keeping track of members logged in (Ethan H. Poole)
    Re: keeping track of members logged in <stevenhenderson@prodigy.net>
    Re: Newbie question <gellyfish@btinternet.com>
    Re: NEWBIE regexp for web server conf file <aqumsieh@matrox.com>
        path references using Perl and IIS <cnorris@hotmail.com>
        PERL5SHELL and "sh -c" <jeb@burkby.com>
        req. help with file upload <tlc@noble.cioe.com>
        Sending files via e-mail - please help. <kaboom@gdynia.top.pl>
    Re: Sending files via e-mail - please help. (Clay Irving)
        test <yotakim@hyowon.cc.pusan.ac.kr>
    Re: Unblessed reference error when using DBI::DBD <gellyfish@btinternet.com>
    Re: useless use of scalar ref constructor <aqumsieh@matrox.com>
    Re: Using C-library in Perl? <aqumsieh@matrox.com>
        Viewing remote Perl script before executing brackett@pobox.com
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Sun, 07 Feb 1999 14:05:04 +0100
From: editor@dvar.com
Subject: Ads script wanted
Message-Id: <36BD8F80.476E@dvar.com>

Hi All,

I do everything on my website manually & this eats my time...it can be
easier. Who can help me out on this?

Who knows of an AD script that can give the following:
1. An unique id_code for all visitors who wants to place an Ad. They
 could place, delete or edit an Ad with this ID_code.
 All placed ads will be in catagories
 
 2. All place Ads must be automatically deleted from their respective
 catagory after, let's say, 10 days.
 3. Of course, I must be in a position to delete unwanted Ads, censoring

Thanks in advance.
Regards
Dvar
http://www.dvar.com


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

Date: Sun, 07 Feb 1999 15:40:33 GMT
From: mag@imchat.com (Mark P.)
Subject: appending to nohup.out
Message-Id: <36bdb2f6.393726188@news.ionet.net>

Hi, I have a script that starts a java application. The only problem
with it, is that it won't recognize the nohup part of the command so
that the process will continue to work. Here's the script.

#!/usr/bin/perl -w

$command = "nohup /opt/jdk1.1.5/bin/java -classpath
/opt/jdk1.1.5/lib/classes.zip:. rbannerd &";
select(STDOUT); $|++; print STDOUT <<EOF;
Content-type: text/plain

Your process has started.
EOF
@args = ("$command");
    exec(@args) == 0 or die "exec @args failed: $?";
exit;
	The stdout should say appending to nohup.out but instead it
runs the java program and I get the stdout from that. Any idea's?




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

Date: Sun, 7 Feb 1999 08:57:25 -0700
From: "Michael Reinhart" <michael@webstead.com>
Subject: Can't locate loadable object for module Win32::UserAdmin
Message-Id: <79kcp4$93c1@dagger.videotron.ab.ca>

Hi all... please don't flame me...I'm trying to learn.

I've downloaded and installed ActiveState Perl 5, and the UserAdmin scripts
from the O'Reilly book to my WinNT staging server (I've done the "hello
world") and am trying to progress to some of the UserAdmin tools.  Judging
by the message I get when I try to run a script, Perl might not be finding
the UserAdmin Libraries.

The script contains this at line 5:

use Win32::UserAdmin;

and when I run it, I get this message:

Can't locate loadable object for module Win32::UserAdmin in @INC (@INC
contains: C:\Perl\lib C:\Perl\site\lib .) at C:\PERL\scripts\userperm.pl
line 5 BEGIN failed--compilation aborted at C:\PERL\scripts\userperm.pl
line5

Am I correct in assuming that the Win32 in this line refers to the Win32
directory beneath C:\perl\lib ? ... and that UserAdmin refers to the file
UserAdmin.pm in that directory? ... my search path includes C:\perl\lib, if
so, how come my script isn't finding this library?

Thanks.

michael reinhart
mreinhart@audg.gov.ab.ca



--
Michael Reinhart
mreinhart@audg.gov.ab.ca
========================




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

Date: Sun, 07 Feb 1999 09:04:49 -0800
From: dan <nospam-seallama@mailcity.com>
Subject: cookies pointers
Message-Id: <36BDC7B0.7503DC86@mailcity.com>

can somebody give me a quick rundown on how to read and write cookies
with perl, or refer me to some documentation? thanks




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

Date: 7 Feb 1999 17:45:41 GMT
From: bababozorg@aol.com (Bababozorg)
Subject: Re: cookies pointers
Message-Id: <19990207124541.07345.00001062@ng110.aol.com>

WRITE:
print "Set-Cookie: test=$username:$password; expires=Sat, 31 Dec 2002 12:00:00
GMT\n";

READ:
$code = "test";
@cookiePairs = split (/; /,$ENV{'HTTP_COOKIE'});
foreach $pair (@cookiePairs)
{ ($name,$value) = split (/=/,$pair);
if ($name eq $code)
{ $cookieinfo = $value;
($username,$password) = split (/:/,$value);
last;
}
}


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

Date: 7 Feb 1999 16:06:39 GMT
From: bababozorg@aol.com (Bababozorg)
Subject: CREATING TEXT TABLE
Message-Id: <19990207110639.26455.00000998@ng25.aol.com>

hi
i am making a email which takes the data from the form (<input type=text ...>)
and put each data to the specific fields one one table that in email
for example:

NAME_______AGE_________TEL__________FAX____
hamed              17             000000000       00000000000
mike                 15             000001010       212121212
aa                     20            252525252        54848488848


these all be in a text format.
i dont know how to creat the space between the fields?
can anyone help me?
thanks
hamed


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

Date: Sun, 07 Feb 1999 16:11:37 GMT
From: bababozorg@aol.com
Subject: CREATING TEXT TABLE
Message-Id: <79kdvk$38s$1@nnrp1.dejanews.com>

hi
i am making a email which takes the data from the form (<input type=text ...>)
and put each data to the specific fields one one table that in email
for example:

NAME_______AGE_________TEL__________FAX____
hamed      17       000000000   00000000000
mike       15       000001010   212121212
aa         20       252525252   54848488848


these all be in a text format.
i dont know how to creat the space between the fields?
can anyone help me?
thanks
hamed

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Sun, 07 Feb 1999 08:59:19 -0800
From: dan <nospam-seallama@mailcity.com>
Subject: Re: CREATING TEXT TABLE
Message-Id: <36BDC666.2B5FDF56@mailcity.com>



Bababozorg wrote:

> hi
> i am making a email which takes the data from the form (<input type=text ...>)
> and put each data to the specific fields one one table that in email
> for example:
>
> NAME_______AGE_________TEL__________FAX____
> hamed              17             000000000       00000000000
> mike                 15             000001010       212121212
> aa                     20            252525252        54848488848
>
> these all be in a text format.
> i dont know how to creat the space between the fields?
> can anyone help me?
> thanks
> hamed

here is an example. this prints out info, obviously you can change the variables
etc.
format =  Album=@<<<<<<<<<<<<<  Artist=@>>>>>>>>>>>>
               $album,                                  $artist,
this formats the outputted text, alotting it a certain amount of spaces, and is
left and right justified, respectively. if you want more help on this, just email
me.




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

Date: 7 Feb 1999 17:01:39 GMT
From: mgm@unpkhswm04.bscc.bls.com (Mitchell Morris)
Subject: Embedded perl leaking memory
Message-Id: <slrn7brhnk.m9o.mgm@unpkhswm04.bscc.bls.com>


I'm trying to embed a Perl interpreter into a C++ program. After reading
through the perlembed manpage, I wrote up the simple version of the
code which worked fine except that it leaked memory like a sieve.
I subsequently cut out pieces until I got the smallest program that
demonstrated the issue, which I have included below.

Any suggestions will be welcomed, even those that say "RTFM" as long as
they mention which "FM".

Thanks,
+Mitchell



#include <iostream.h>
#include <strstream.h>

#include <stdlib.h>
#include <unistd.h>

#include <EXTERN.h>
#include <perl.h>

//======================================================================
int main(int argc, char** argv, char** env)
//======================================================================
{
	if(argc != 2) {
		cout << "Usage: " << argv[0] << " count" << endl;
		return 1;
	}

	int count = atoi(argv[1]);
	if(count <= 0) {
		cout << "invalid count, must be at least one" << endl;
		return 1;
	}

	strstream cmd;
	cmd << "ps ux " << getpid();
	system(cmd.str());

	int argc_ = 3;
	char* argv_[4] = { "", "-e", "print \"Hello, world!\\n\";", NULL };
	for(int i = 0; i < count; i++) {
		PerlInterpreter* my_perl = perl_alloc();
		perl_construct(my_perl);
		perl_parse(my_perl, NULL, argc_, argv_, NULL);
		perl_run(my_perl);
		perl_destruct(my_perl);
		perl_free(my_perl);
		system(cmd.str());
	}

	return 0;
}

-- 
Mitchell Morris

A journey of a thousand miles continues with the second step.
	-- Larry Wall


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

Date: Sun, 07 Feb 1999 14:55:12 GMT
From: lezli@lezlisoft.com (Leslie Perjes)
Subject: Get current URL
Message-Id: <79k97j$oqu$1@newsgate.elender.hu>
Keywords: perl

Hello,

I would like to point more than domain names to one IP number. After I would 
like to separate them to several starting pages. Is this possible by Perl? 
SERVER_NAME environent variabe will get correctly different domain names?
Please help, and copy the answers to my e-mail address. PHP and Phyton 
availabe, but I would like to use Perl is possible.

thanks,
Leslie


-------------------
Message from:
Leslie Perjes (Hungary)
E-mail: lezli@lezlisoft.com
URL: http://www.lezlisoft.com


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

Date: Sun, 7 Feb 1999 03:39:49 -0500
From: "John Counts" <jcounts@voicenet.com>
Subject: Re: Getting Perl to work with WinNT PWS
Message-Id: <79jjuv$d0q$1@news1.fast.net>

Is your perl executable really in /usr/bin/perl.  Probably not on a Win32
box.  That first line #!... is the path to the Perl executable.

news.mindspring.com wrote in message
<79j6fr$el7$1@camel25.mindspring.com>...
>I am trying to get a simple perl script to run on NT so that I can begin
>learning more about perl.  The script I am trying to run is:
>
>#!/usr/bin/perl
>print <<END_of_multiline_text;
>Content-type: text/html
>
><HTML>
><HEAD>
><TITLE>Hello World</TITLE>
></HEAD>
><BODY>
><H1>Greetings, Terrans!</H1>
></BODY>
></HTML>
>
>END_of_multiline_text
>
>
>However, when I point my browser (using local PWS) I see the #! and
>everyting but the END_of_multiline_text entries.  Is there an option that I
>forgot to check.  I have already made sure that the reference to the
>d:\InetPub\cgi-bin\ is executable and aliased to \cgi-bin.
>
>Any other ideas?  Thanks,
>Steve
>
>




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

Date: 7 Feb 1999 12:14:38 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Getting Perl to work with WinNT PWS
Message-Id: <79k03e$380$1@gellyfish.btinternet.com>

On Sat, 6 Feb 1999 22:59:28 -0600 news.mindspring.com wrote:
> 
<snip>
>
> However, when I point my browser (using local PWS) I see the #! and
> everyting but the END_of_multiline_text entries.  Is there an option that I
> forgot to check.  I have already made sure that the reference to the
> d:\InetPub\cgi-bin\ is executable and aliased to \cgi-bin.
> 

This is a server configuration error and as such is not particularly
related to Perl - the solution would be the same whether you were using TCL
or Python ... Despite that the answer has been posted many many times in
this group - search this group in DejaNews for "Script map".

/J\


-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 7 Feb 1999 12:11:21 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Getting Perl to work with WinNT PWS
Message-Id: <79jvt9$37t$1@gellyfish.btinternet.com>

On Sun, 7 Feb 1999 03:39:49 -0500 John Counts wrote:
> Is your perl executable really in /usr/bin/perl.  Probably not on a Win32
> box.  That first line #!... is the path to the Perl executable.

But on (most) NT boxes that line is not used to determine the location
of the executable - this has to be set up somewhere elese.  The shebang
line *is* parsed however to find any switches which might be present.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sun, 7 Feb 1999 20:10:45 +0900
From: "1h?5EB" <yotakim@hyowon.cc.pusan.ac.kr>
Subject: how can i post messages?
Message-Id: <79jsvo$874$1@baikdu.kaist.ac.kr>

hi.~~

i want to receive data in my form at  my web-site,
and i want to post the data to other web-sites.

i can see strings in the back of xxx.cgi?.
but some sites are hidden
how can i see the strings in the back of xxx.cgi?

if u have any source of posting to other sites..
or have the sol'n .of the upper question
please help me...

from cheetah





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

Date: Sun, 7 Feb 1999 20:27:06 +0900
From: "1h?5EB" <yotakim@hyowon.cc.pusan.ac.kr>
Subject: how can i post?
Message-Id: <79jtud$8f1$1@baikdu.kaist.ac.kr>

hi~

i want to receive data in my sites and
post the data to other sites.

i can see strings in the back of xxx.cgi? ,
but some sites are hidden..

how can i see strings in the back xxx.cgi?

please help me.. !!

or is there any other source ?


from cheetah

yotakim@hyowon.cc.pusan.ac.kr




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

Date: Sun, 7 Feb 1999 13:35:59 -0000
From: "el_pollo_diablo" <bencas@bigfoot.com>
Subject: How do I use CGI.pm to fetch parameters?
Message-Id: <79k5ac$sr4$1@news5.svr.pol.co.uk>

I'm trying to use cgi.pm to fetch parameters passed to my script using an
SSI call. My code is:

#!/usr/local/bin/perl

use CGI;

$query = new CGI;

$county = $query->param('county');

print $county;

print "hello";


As you can see its short 'n' sweet,  even laughable but I'm tearing my hair
out trying to work out whats going wrong! I dont even get the "hello"
message.

Please anybody put me out of my misery!
--
---
Ben





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

Date: Sun, 7 Feb 1999 21:23:21 +0900
From: <ohmygod@tksun.aiit.or.kr>
Subject: I want to build shopping-mall..where I can get help?
Message-Id: <79k0qk$li2$1@hiline.shinbiro.com>

I have Linux as web server , msql as DB .
And I can use some language ..like C, Perl, Javascript,Powerbuilder..etc..
But not good..^^;

I want to build online shopping mall..
How can I get some source..some instruction..some help.?

I'm korean..and a beginner in web-programming..-_-+

teach me please.....

song@internetplaza.co.kr






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

Date: 7 Feb 1999 12:41:28 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: installing cgi.pm win32/98?!?
Message-Id: <79k1lo$384$1@gellyfish.btinternet.com>

On Sun, 7 Feb 1999 01:39:19 -0000 el_pollo_diablo wrote:
> I'm using active perl and perl builder. I've just tried to install the
> cgi.pm file but I receive this error:
> 
> Can't locate CGI.pm in @INC at script line 48.
> BEGIN failed--compilation aborted at script line 48.
> 

If you are using ActivePerl then you should be able to use the PPM 
(Perl Package Manager) to install it - this is is documented in the
ActivePerl distribution somewhere (I couldnt tell you right now because
this is a Linux machine).

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sun, 07 Feb 1999 08:06:00 GMT
From: ehpoole@ingress.com (Ethan H. Poole)
Subject: Re: keeping track of members logged in
Message-Id: <IPbv2.189$Xm1.1008@news3.ispnews.com>

In article <36BD460C.20E012FD@rainbow.nwnet.co.uk>, paul@rainbow.nwnet.co.uk 
says...
>
>Simple way to delete old data from a file and re add new data... You
>might need to mess around with the code but its a start for you...
>
>
>open(FILE, "database.txt") || die "$!";
>@lines = <FILE>;
>close(FILE);
>
>open(WRITE, ">database.txt") || die "$!";
>foreach (@lines)
>{
>        if (/$username/)
>        {
>                next;
>        }
>        print WRITE;
>}
>close(WRITE);

And pray that two people don't logout at the same time or you will likely 
kick a lot of other users out in the confusion that results *and* end up 
with a corrupted user list that requires some manual cleanup. IOW, consider 
some method of locking the file before modifying it.

-- 
Ethan H. Poole              | Website Design and Hosting,
                            | CGI Programming (Perl & C)..
========Personal=========== | ============================
* ehpoole @ ingress . com * | --Interact2Day, Inc.--
                            | http://www.interact2day.com/



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

Date: Sun, 7 Feb 1999 06:04:31 -0600
From: "Steven T. Henderson" <stevenhenderson@prodigy.net>
Subject: Re: keeping track of members logged in
Message-Id: <A3hv2.51061$641.36115@news.san.rr.com>

yeah, but locking files has its own set of problems.... like what to do when
someone does try to logout at the same time and encounters the locked file.
what to do then? tell them to try back later?

so let us really split hairs, shall we?


1. get the time
2. touch the original file
3. read original file and perform any neccy operations on the data
4. write output to temp file
5. check time on original file
6. ulink orig file and move new file into place.

sorry, just trying to be a pain....


Ethan H. Poole wrote in message ...
>In article <36BD460C.20E012FD@rainbow.nwnet.co.uk>,
paul@rainbow.nwnet.co.uk
>says...
>>
>>Simple way to delete old data from a file and re add new data... You
>>might need to mess around with the code but its a start for you...
>>
>>
>>open(FILE, "database.txt") || die "$!";
>>@lines = <FILE>;
>>close(FILE);
>>
>>open(WRITE, ">database.txt") || die "$!";
>>foreach (@lines)
>>{
>>        if (/$username/)
>>        {
>>                next;
>>        }
>>        print WRITE;
>>}
>>close(WRITE);
>
>And pray that two people don't logout at the same time or you will likely
>kick a lot of other users out in the confusion that results *and* end up
>with a corrupted user list that requires some manual cleanup. IOW, consider
>some method of locking the file before modifying it.
>
>--
>Ethan H. Poole              | Website Design and Hosting,
>                            | CGI Programming (Perl & C)..
>========Personal=========== | ============================
>* ehpoole @ ingress . com * | --Interact2Day, Inc.--
>                            | http://www.interact2day.com/
>




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

Date: 7 Feb 1999 15:00:29 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Newbie question
Message-Id: <79k9qd$39d$1@gellyfish.btinternet.com>

On Mon, 1 Feb 1999 23:37:14 -0500 John Counts wrote:
> 
> Gary Smiley wrote in message <36B65899.1CCDC95B@nospam.mediaone.net>...
>>Here's the latest: My syntax is OK. If I run the pgm via a DOS prompt, it
>>"sees" the shared drive and writes to it. Over the Web via an HTML form, it
>>dies trying to open the file for appending.
> 
> 
> Your problem seems to be the file permissions of the user accessing the HTTP
> server.  If you are running Apache this is usually 'nobody'  if you're
> running IIS it's something like IUSER_[MACHINENAME].  You need to give this
> user write permission on the file in question.  

Infact it is probably more due to the fact that the user in question
has no permission to use the network at all and thus cannot access the
shared drive.  A network administrator should be asked to alter the user
rights of the user appropriately.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sat, 6 Feb 1999 14:21:49 -0500 
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: NEWBIE regexp for web server conf file
Message-Id: <x3yyambs5h0.fsf@tigre.matrox.com>


Scott Wiersdorf <scott@iPartner.net> writes:

> I'm trying to match something like this:
>  <VirtualHost www.carpictures.com carpictures.com>
> or this:
>  <VirtualHost www.carpictures.com>
> or this:
> <VirtualHost www.something.com something.com anotherthing.com ...
> adnauseam.com>
> where ... is any number of domain names.
> 
> I've tried this:
> @host = map{ /(?:<[Vv]irtual[Hh]ost\s+)(?:(\S+)\s*)+>/ig }

WOW. Are you sure you know what map() does?

> which doesn't work, and I've tried other things which will only match
> the first domain name.  I'd like to grab all of the domain names on the
> VirtualHost line (but not "<VirtualHost " or the last ">") and stick
> them in an array.  Can this be done with a nice regexp?  Or should I
> just grab the line and split() it?

Although Perl's regexps are extremely powerful, sometimes it's better
to avoid them. I would do exactly that if I were you.

Solution

$string =~ s/^<\S+|>$//g;
@host = split ' ', $string;

HTH,
Ala



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

Date: 7 Feb 1999 15:02:59 GMT
From: "Craig" <cnorris@hotmail.com>
Subject: path references using Perl and IIS
Message-Id: <01be52ab$3b5712c0$c13a56d1@puter>

I'm trying to make a perl app that when receiveing input from a web page,
runs a program and displays the image the program generated in a newly
created page. Everything works fine, except when I'm trying to reference
the location of the new page on the server. Do I have to do a URL? I've
tried putting the files in virtual directories and by doing the c:\ path.
I'm sure it's something simple, but I'm still learning. I'm using the
newest buld of Perl and am running Win NT with the Personal Web Server.

Thanks.
Craig Norris
Computer lackey


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

Date: Sun, 07 Feb 1999 12:02:45 -0500
From: Joe Burpee <jeb@burkby.com>
Subject: PERL5SHELL and "sh -c"
Message-Id: <36BDC735.9EE9DF51@burkby.com>

I notice that this was the subject of at least one old thread in another
newsgroup, and was
to be "fixed".  I am using an Active Perl binary with Cygwin under
Win95.  If I set PERL5SHELL=".../sh -c" the -c seems to be ignored.

The effect is that I can run binaries or sh/bash scripts ok, but the #!
line is just another comment.  For example, I can't run a perl script
(beginning #!/usr/bin/perl) under backtick.  This behaviour is
inconsistent with Perl under Linux, so it complicates porting.  Is there
a fix?
-- 
Joe


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

Date: Sun, 7 Feb 1999 10:47:29 -0500
From: "tlcora" <tlc@noble.cioe.com>
Subject: req. help with file upload
Message-Id: <7Fiv2.996$45.16882@news.goodnet.com>

**This message was inadvertantly posted to comp.lang.perl - sorry for any
inconvenience.-tlc

I need some help (therapy jokes aside).
I need to have clients upload various file formats to avoid ftp.

I can't use CGI.pm because the server for this site is only running perl
5.001.
I tried removing the 'require 5.004', but the off-the-shelf scripts return
an Internal server error.  I've had no problems getting the scripts to work
properly on machines running 5.004.

I can use cgi-lib.pl to successfully upload the files and save them on the
server, but the files are useless (I don't know if the data is being parsed
or what, but they are not in their original format - I would hesitate to
even call myself a novice at this).

While getting the sys admin to upgrade perl is a definite necessity, I'm
afraid it wouldn't happen until well after any script I could come up with
would be deemed 'improper' - hence me standing by the side of the road
holding a sign "will hack for food".

Any advice, or pointers to missed references would be greatly appreciated!

TIA
tlc-





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

Date: Sun, 07 Feb 1999 14:02:33 +0100
From: Marek Wawoczny <kaboom@gdynia.top.pl>
Subject: Sending files via e-mail - please help.
Message-Id: <36BD8EE9.E9EC1302@gdynia.top.pl>

Hello!

I would like to send a binary file via e-mail (with sendmail). How to do
it? I have some code (the subroutine which is sending the files is
below) in Perl but it is not working. All permissions and stuff like
that are set correctly. I think that with the code is something wrong.
Please help. 

--Start--
open(MAIL,"|$mailprog -t");

print MAIL "To: $email ($realname)\n";
print MAIL "From: $fromaddr ($fromname)\n";
if ($organization) {
   print MAIL "Organization: $organization\n";
}
else {
   print MAIL "Organization: Auto sent file\n";
}
print MAIL "Subject: $file\n";
print MAIL "X-Courtesy-Of: SendIt! 1.0\n\n";
open(INPUT,"$filebase/$file")||&error;
while (<INPUT>) {
   chop $_;
   print MAIL $_,"\n";
}
close (INPUT);
close (MAIL);
--End--
-- 
Marek Wawoczny
Serwis Internetowy Kaboom
 WWW: http://www.kaboom.gdynia.top.pl
 FTP: ftp://ftp.kaboom.gdynia.top.pl
 E-mail: kaboom@gdynia.top.pl
 ICQ UIN: 5292063


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

Date: 7 Feb 1999 09:10:35 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Sending files via e-mail - please help.
Message-Id: <79k6sr$fk0$1@panix.com>

In <36BD8EE9.E9EC1302@gdynia.top.pl> Marek Wawoczny <kaboom@gdynia.top.pl> writes:

>Hello!

Howdy.

>I would like to send a binary file via e-mail (with sendmail). How to do
>it? 

How do you usually do it? Most folks uuencode or MIME encode the binary
file.

>I have some code (the subroutine which is sending the files is
>below) in Perl but it is not working. All permissions and stuff like
>that are set correctly. I think that with the code is something wrong.
>Please help. 

You can't send binary file in Email messages -- The binary file must be
encoded first. You didn't encode the file.

>--Start--
>open(MAIL,"|$mailprog -t");

>print MAIL "To: $email ($realname)\n";
>print MAIL "From: $fromaddr ($fromname)\n";
>if ($organization) {
>   print MAIL "Organization: $organization\n";
>}
>else {
>   print MAIL "Organization: Auto sent file\n";
>}
>print MAIL "Subject: $file\n";
>print MAIL "X-Courtesy-Of: SendIt! 1.0\n\n";
>open(INPUT,"$filebase/$file")||&error;
>while (<INPUT>) {
>   chop $_;
>   print MAIL $_,"\n";
>}
>close (INPUT);
>close (MAIL);
>--End--

Take a look at:

    http://reference.perl.com/query.cgi?mail

and use something like MIME::Lite

-- 
Clay Irving
clay@panix.com


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

Date: Sun, 7 Feb 1999 23:04:55 +0900
From: "1h?5EB" <yotakim@hyowon.cc.pusan.ac.kr>
Subject: test
Message-Id: <79k75q$aob$1@baikdu.kaist.ac.kr>

test




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

Date: 7 Feb 1999 15:48:52 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Unblessed reference error when using DBI::DBD
Message-Id: <79kcl4$39o$1@gellyfish.btinternet.com>

On Sat, 06 Feb 1999 06:40:29 GMT Brian Lavender wrote:
> 
> Would I check to see if I made the connection with the statement:
> if (my $dbh = DBI->connect('dbi:Oracle:l2cefmp1','l2pmmbel','xxxxx'))
> { 
> #code here
> }
> 

Yes, that'll do it

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sat, 6 Feb 1999 14:01:50 -0500 
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: useless use of scalar ref constructor
Message-Id: <x3yzp6rs6e9.fsf@tigre.matrox.com>


Marty Landman <marty@catnmoose.com> writes:

> 
> When I coded the following the compiler  said "useless use of scalar ref
> constructor".
> 
>  !&Post ? &Prt_Form  :
>      {&Form_ok  ? &Prt_Listing  : &Prt_Form};

The curly braces are creating a reference to an anonymous hash, which
is being disposed of then.

> When I changed the curly brackets to parens as below, the message went
> away.
> 
>  !&Post ? &Prt_Form  :
>      (&Form_ok  ? &Prt_Listing  : &Prt_Form);

Of course. The parentheses are used for grouping.

> I had thought that the curly brackets could be used to group together
> stmts so they execute in place of a single stmt, guess I'm wrong again.

It only does if it actually starts the statement. In your case, the ?:
operator returns something depending on the condition, and if the
condition (!&Post) is false, it will return a reference to a hash. Try
adding a 'do' before the curly braces and that should resolve the
ambiguity.

> I want the outer if-false-expr to execute the parenthesized trinary ?:
> expr... hope I'm expressing myself properly here, but you get the idea.

Your second statement above should do exactly that.

> The parenthesis eliminated the compiler warning (I said perl -wc
> mypgm.cgi from the cmd line) but am I getting the executable code that I
> want?  And what's the problem with using {} instead of () in this case?

Why don't you try and see for yourself ? :)
As I said, in your statement, the trinary operator returns the return
value of whichever expression it evaluates. Surrounding the expression
by curly braces makes Perl think that you are returning a reference
to a hash. Parenthese are used for grouping and are more suitable for
your case.

You can have a look at perlref, and check out anonymous hashes.

HTH,
Ala



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

Date: Sat, 6 Feb 1999 14:34:23 -0500 
From: Ala Qumsieh <aqumsieh@matrox.com>
To: Siddharth Bajaj <sbajaj@verisign.com>
Subject: Re: Using C-library in Perl?
Message-Id: <x3yww1vs4w1.fsf@tigre.matrox.com>


Siddharth Bajaj <sbajaj@verisign.com> writes:

> I was wondering if there is a way in which one can call C-library
> routines in Perl or the other way embed Perl in C-programs.
> If you could point me to a suitable reference/book, I'll aprreciate
> that.

Of course. It's all there right in front of you .. installed on your
system. Just a few keystrokes away!

To call C from Perl:

- read 'perlcall' and 'perlxs'

To embed Perl in C

- read 'perlembed'

Hope this helps,
Ala



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

Date: Sun, 07 Feb 1999 08:19:18 GMT
From: brackett@pobox.com
Subject: Viewing remote Perl script before executing
Message-Id: <79jia1$en3$1@nnrp1.dejanews.com>

Hi --

Is there an easy way to view a remote Perl script before executing it? For
example, if I know clicking "OK" will trip a Perl script at
http:///111.111.111.11/cgi-bin/script.pl, how can I see the script before
letting it do whatever it does?

Thanks much.

B,

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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 4841
**************************************

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