[13456] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 866 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 21 14:07:22 1999

Date: Tue, 21 Sep 1999 11:05:13 -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: <937937113-v9-i866@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 21 Sep 1999     Volume: 9 Number: 866

Today's topics:
    Re: Accessing SCSI-Devices from Perl? (AcCeSsDeNiEd)
        Ad hominem (was Re: perl related question now!) (Kragen Sitaker)
    Re: Anomymous Hash <anders_wallin@my-deja.com>
    Re: Attachment with sendmail in cgi-script <klrtl@home.com>
        Chicago Based Opportunity denisesusan@my-deja.com
    Re: Combining variables - newbie (Matthew David Zimmerman)
        hyperlink submits <jwc@acsu.buffalo.edu>
    Re: hyperlink submits (Kragen Sitaker)
    Re: hyperlink submits <bob@myriad.com>
    Re: hyperlink submits (Kragen Sitaker)
    Re: Is anyone capable of explaining this?? (Larry Rosler)
    Re: mkdir(). What am I doing wrong? (Philip 'Yes, that's my address' Newton)
    Re: mkdir(). What am I doing wrong? (Philip 'Yes, that's my address' Newton)
    Re: mkdir(). What am I doing wrong? <jtraug@seanet.com>
    Re: mkdir(). What am I doing wrong? (Sean McAfee)
    Re: mkdir(). What am I doing wrong? <sephiroth@id-base.com>
        MP3 file sorting in PERL <kraizman@hotmail.com>
        need help for Perl/CGI application <artax@shineline.it>
        need HELP for Perl/CGI application <artax@shineline.it>
    Re: need help for Perl/CGI application (Kragen Sitaker)
    Re: OmniPerl:  We're cheaper than OmniMark <mike@crusaders.no>
    Re: Output buffering/flusing problem in PERL-CGI (Kragen Sitaker)
    Re: Perl : Excel OLE Automation <duraipPLEEASE__REMOVE_THIIS@extendsys.com>
    Re: Perl : Excel OLE Automation <duraipPLEEASE__REMOVE_THIIS@extendsys.com>
    Re: Perl : Excel OLE Automation <mattking@techie.com>
    Re: perl related question now! <aqumsieh@matrox.com>
    Re: perl related question now! <mike@crusaders.no>
    Re: range of array indexes <aqumsieh@matrox.com>
    Re: Redirect STDERR <samay1NOphSPAM@hotmail.com>
        sending HTML files in e-mail rwswebmaster@my-deja.com
    Re: sending HTML files in e-mail <samay1NOzdSPAM@hotmail.com>
        THANKS <daniel@vesma.co.uk>
        Using Perl Modules outside lib directory? (AcCeSsDeNiEd)
    Re: Using Perl Modules outside lib directory? (Kragen Sitaker)
        Web browers <jazzie01NOivSPAM@hotmail.com>
        Web browers <jazzie01NOmsSPAM@hotmail.com>
    Re: Web browers (Kragen Sitaker)
    Re: Which are the best books for learning Perl for use  <elaine@chaos.wustl.edu>
        Win32::AdminMisc::ScheduleAdd <l.suheimat@mdx.ac.uk>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Tue, 21 Sep 1999 17:13:56 GMT
From: dillon_rm@magix.com.sg (AcCeSsDeNiEd)
Subject: Re: Accessing SCSI-Devices from Perl?
Message-Id: <37e7b923.1701923@news.magix.com.sg>

I do not know what exactly you want. 
(Communicating with a CRD drive / Scanner perhaps?)

So it might be difficult to help you.

I've never heard of any scsi perl modules.

Your best bet would be to get some third party program (e.g:
SCSI.exe). Your perl script would then talk to this program to access
your SCSI device.


On Tue, 21 Sep 1999 15:17:20 +0200, stephan.budach@knsk-bbdo.de
(Stephan Budach) wrote:

>Hi,
>
>i know, it sounds a bit weird, but has anyone successfully accessed a
>SCSI-Device from within Perl? I guess, this is going to be a hard one for
>me.
>
>Stephan Budach

To e-mail me, remove "_rm"


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

Date: Tue, 21 Sep 1999 17:23:41 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Ad hominem (was Re: perl related question now!)
Message-Id: <xaPF3.520$QJ.20558@typ11.nn.bcandid.com>

In article <x3y7llk6wkm.fsf@tigre.matrox.com>,
Ala Qumsieh  <aqumsieh@matrox.com> wrote:
>This word (ad hominem) popped up a couple of weeks ago in some post,
>and suddenly everyone is using it (and I *still* don't know what it
>means!). 
>
>Is it The Way To Be? Is it good to be ad hominem?

Ad hominem means, as far as I can remember from Latin classes, "against
the man".  An argument is ad hominem if the argument attacks a person
instead of an idea.

If I say your ideas about genetic superiority resemble the discredited
ideas of the Nazis and of social Darwinists, that is not argumentum ad
hominem.  If I say you are a Nazi, that is argumentum ad hominem.

Argumentum ad hominem is what is known as a "fallacy": using it will
cause reasonable people to dismiss your arguments.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Sep 21 1999
48 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Tue, 21 Sep 1999 16:34:05 GMT
From: Anders Wallin <anders_wallin@my-deja.com>
Subject: Re: Anomymous Hash
Message-Id: <7s8c1t$ita$1@nnrp1.deja.com>

In article <APC&1'0'50775db5'668@igc.apc.org>,
  Michael de Beer <madebeer@igc.apc.org> wrote:
> Have you read the perldoc/man-page perldsc ?
<snip>

I am very grateful for all direct help and pointers to various pieces of
information. The Perl community is indeed very helpful!

Best regards
Anders Wallin


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 21 Sep 1999 17:43:45 GMT
From: "Joel Blanchette" <klrtl@home.com>
Subject: Re: Attachment with sendmail in cgi-script
Message-Id: <ltPF3.74$2k1.8212@news1.rdc2.on.home.com>

There is a much better and easier way to make a file attachement.  Not sure
if it is the bnest way but if it is for small files you can you this
code...But I would recommend the modules over this snippet....

 my($mailprog) = "/usr/bin/sendmail";
 open (MAIL,"|$mailprog -t");
 print MAIL "To:my\@here.net\n";
 print MAIL "From: To:your\@there.net\n";
 print MAIL "Subject: karl \n\n";

$file = "hey.txt";
open(FILE, "uuencode $file $file|") or die;
while( <FILE>) { print MAIL; };

close(FILE);
close(MAIL);


Joel Blanchette
Perl/Web Designer
256-1976
Cell. 229-2304
klrtl@home.com

--
Walter Winter <wiwa@sbox.tu-graz.ac.at> wrote in message
news:7s7qpl$su8@fstgal00.tu-graz.ac.at...
> Hi there,
> I want send a file via e-mail (sendmail) with an Cgi-perl script
> I have this pice of script
>
> my($mailprog) = "/usr/bin/sendmail";
> open (MAIL,"|$mailprog -t");
> print MAIL "To:my\@here.net\n";
> print MAIL "From: To:your\@there.net\n";
> print MAIL "Subject: karl \n\n";
>
> Does anyone know how to attach a file within this script
> Thank´s
> walter
> mailto:winter@dayside.net
> --
>  Walter Winter
>
>
>




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

Date: Tue, 21 Sep 1999 16:34:15 GMT
From: denisesusan@my-deja.com
Subject: Chicago Based Opportunity
Message-Id: <7s8c27$itk$1@nnrp1.deja.com>

Wanted:   Project Mgr/IT Liaison for fast growing Internet Co in
Northern Suburb of Chicago.  Prefer local candidates - sorry, cannot
sponsor at this time.  Excellent comp package - casual work atmosphere.

Required skills:  Unix (linux/solaris preferred).  Two or more of the
following a must:  Java, Perl, Netscape Enterprise, Apache,
Vignette.(C++/Forte a plus)...Some RDBMS preferred, i.e., Oracle.
Excellent communication, facilitation, negotiation skills necessary as
well as solid project lead or project mgmt experience.  Ability to
handle systems administration duties as well.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 21 Sep 1999 17:37:11 GMT
From: mdz4c@node14.unix.Virginia.EDU (Matthew David Zimmerman)
Subject: Re: Combining variables - newbie
Message-Id: <7s8fo7$9rc$1@murdoch.acc.Virginia.EDU>

In article <7s71hj$km9$1@nnrp1.deja.com>, Graham W. Boyes  <me@toao.net> wrote:
>Hello,
>
>I have two variables, $var1 and $var2 which I'd like to combine into a
>single variable $var3 with a space in between.  How should I do this?
>
>I grant that sounds really, REALLY stupid.

It's a very simple question. But don't mind the gurus. They can be
cranky.

$var1 = 'foo';
$var2 = 'bar';
$var3 = "$var1 $var2";   # $var3 is now 'foo bar'

Noticed I used two different kinds of quotation marks to define strings.
The double quotation marks are said to be /variable interpolated/, that is
to say, whenever Perl encounters a variable inside the double quotation
marks, it substitutes the value of the variable for the name. On the
other hand, the single quotation marks are literal, i.e.

$var3 = '$var1 $var2';   # $var3 is now '$var1 $var2'

There are resources out there for the absolute beginner. There is a book
called "Learning Perl" by Schwartz and Christiansen (there's also a Win32
version). I started in Perl with that tutorial, and I recommend it highly. 

HTH! Matt
-- 
Matthew Zimmerman ------------  http://www.people.virginia.edu/~mdz4c
Interdisciplinary Biophysics Program --------- University of Virginia
| "You got to be very careful if you don't know where you're going, |
| because you might not get there."                   -- Yogi Berra |


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

Date: Tue, 21 Sep 1999 12:40:42 -0400
From: James W Corpening <jwc@acsu.buffalo.edu>
Subject: hyperlink submits
Message-Id: <37E7B509.34EAAF0@buffalo.edu>

Hi.
I've searched the FAQs, perl.com, and other places, but I haven't found
a hint as to how to make a hyperlink work as a submit button.  Is it
possible (I sorta remember seeing instructions, somewhere)?  If so, how?

Thank you.
-jc



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

Date: Tue, 21 Sep 1999 17:19:30 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: hyperlink submits
Message-Id: <C6PF3.491$QJ.16568@typ11.nn.bcandid.com>

In article <37E7B509.34EAAF0@buffalo.edu>,
James W Corpening  <jwc@acsu.buffalo.edu> wrote:
>I've searched the FAQs, perl.com, and other places, but I haven't found
>a hint as to how to make a hyperlink work as a submit button.  Is it
>possible (I sorta remember seeing instructions, somewhere)?  If so, how?

This is not a Perl question, and should be posted elsewhere.

You can include query strings in hyperlinks for GET forms: <a
href="http://www.example.com/query.cgi?terwiliger=waltzes+with+bears">like
this</a>.

You can't make a hyperlink submit form information.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Sep 21 1999
48 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Tue, 21 Sep 1999 11:38:12 -0600
From: Bob Fawcett <bob@myriad.com>
Subject: Re: hyperlink submits
Message-Id: <37E7C284.8DEFB92E@myriad.com>

Kragen Sitaker wrote:
> 
> In article <37E7B509.34EAAF0@buffalo.edu>,
> James W Corpening  <jwc@acsu.buffalo.edu> wrote:
> >I've searched the FAQs, perl.com, and other places, but I haven't found
> >a hint as to how to make a hyperlink work as a submit button.  Is it
> >possible (I sorta remember seeing instructions, somewhere)?  If so, how?
> 
> This is not a Perl question, and should be posted elsewhere.
> 
> You can include query strings in hyperlinks for GET forms: <a
> href="http://www.example.com/query.cgi?terwiliger=waltzes+with+bears">like
> this</a>.
> 
> You can't make a hyperlink submit form information.
> --
> <kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
> Tue Sep 21 1999
> 48 days until the Internet stock bubble bursts on Monday, 1999-11-08.
> <URL:http://www.pobox.com/~kragen/bubble.html>


Use the javascript onclick method:
<a name="hotlink" href="" onclick="document.BLAST.action.value = '
Analyize Hits '; set_blast_id($id); set_blast_num($number); submit();
return false;">$seq_name{$id}</a>

This one also runs some javascript functions and sets a form value
before submitting the form.

-Bob


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

Date: Tue, 21 Sep 1999 17:44:49 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: hyperlink submits
Message-Id: <luPF3.630$QJ.22939@typ11.nn.bcandid.com>

In article <37E7C284.8DEFB92E@myriad.com>, Bob Fawcett  <bob@myriad.com> wrote:
>Kragen Sitaker wrote:
>> You can't make a hyperlink submit form information.
>
>Use the javascript onclick method:
><a name="hotlink" href="" onclick="document.BLAST.action.value = '
>Analyize Hits '; set_blast_id($id); set_blast_num($number); submit();
>return false;">$seq_name{$id}</a>
>
>This one also runs some javascript functions and sets a form value
>before submitting the form.

Sorry, I wasn't thinking of JavaScript.  Because I always have it
turned off, and I roundly curse people whose web pages are unusable
without it.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Sep 21 1999
48 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Tue, 21 Sep 1999 10:40:58 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Is anyone capable of explaining this??
Message-Id: <MPG.1251630437ed3d6b989fad@nntp.hpl.hp.com>

In article <7s5ltd$lsm$1@nnrp1.deja.com> on Mon, 20 Sep 1999 16:04:08 
GMT, Amonotod <amonotod@netscape.net> says...
>   lr@hpl.hp.com (Larry Rosler) wrote:
> 
> > Then you have not read the documentation for 'open', which one might
> > consider a prerequisite for offering answers based on it.  This is
> > from the second paragraph of that document:
> >
> > You can put a '+' in front of the '>' or '<' to indicate that you want
> > both read and write access to the file; thus '+<' is almost always
> > preferred for read/write updates--the '+>' mode would clobber the file
> > first.
> >
>  Could not find mention of this in Camel Book,

The first part (the facts) is in the second paragraph of open() on p. 
191.  The second part (the consequences) isn't.  Keep in mind that the 
printed book is now three years older than the web-based documentation.

 ...

> > Welcome to the club.
>   Your humbleness is astoundingly impressive.

    s/humbleness/realism/;

> > > --
> > A magic invisible space character after those two dashes would make my
> > newsreader cut out the signature automatically, which is a Good Thing.
>   Please explain further, I will accomodate as posssible.

The 'sigdash' convention is "\n-- \n", which is rather dumb, considering 
that the trailing space is invisible and that many text-processing 
agents trim trailing space.

 ...

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Tue, 21 Sep 1999 16:48:46 GMT
From: nospam.newton@gmx.net (Philip 'Yes, that's my address' Newton)
Subject: Re: mkdir(). What am I doing wrong?
Message-Id: <37e7b4de.170451331@news.nikoma.de>

On Tue, 21 Sep 1999 15:03:26 GMT,
mcafee@waits.facilities.med.umich.edu (Sean McAfee) wrote:

>In article <7s855a$3gr$1@gxsn.com>, Daniel Vesma <daniel@vesma.co.uk> wrote:
>>I am trying to get a script to create an empty directory with wide-open
>>CHMOD settings.
>
>>mkdir($makeDIR, 777);
>
>I thought you said you were creating the directory with wide-open settings!
>This is only owner=write, group=execute, and other=execute permissions.
>And what's that extra 512 for?  Permission bits don't go that high.

setuid, setgid, sticky?

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.net>


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

Date: Tue, 21 Sep 1999 16:48:48 GMT
From: nospam.newton@gmx.net (Philip 'Yes, that's my address' Newton)
Subject: Re: mkdir(). What am I doing wrong?
Message-Id: <37e7b52c.170528968@news.nikoma.de>

On Tue, 21 Sep 1999 16:30:51 +0100, "Daniel Vesma"
<daniel@vesma.co.uk> wrote:

>The chart at http://www.go-nexus-go.com/chmodchart.html says that 777 is
>wide-open

As an octal number, yes. chmod numbers are usually given in octal. The
chmod(1) command assumes you're supplying them in octal. Perl assumes
you're supplying them in decimal, so you have to convert them yourself
(either write it as an octal constant, or -- if you're into useless
work -- change the permission number to base 10 and use a decimal
constant).

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.net>


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

Date: 21 Sep 1999 09:50:00 -0700
From: Jim Traugott <jtraug@seanet.com>
Subject: Re: mkdir(). What am I doing wrong?
Message-Id: <uaeqg2oqv.fsf@seanet.com>

>>>>> "Daniel" == Daniel Vesma <daniel@vesma.co.uk> writes:

    > Hi Guys,
    > I am trying to get a script to create an empty directory with wide-open
    > CHMOD settings.

    > I am using this...

    > use CGI qw(param);
    > print "Content-type: text/html\n\n";
    > $foo = param("foo");
    > $makeDIR = "/my/path/is/here/" . $foo;
    > mkdir($makeDIR, 777);
Use mkdir($makeDIR, oct("777"));
The 777 is an octal number.
The mode will still be affected by your umask; you can set your
umask to 0 before the mkdir with:
umask 0;


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

Date: Tue, 21 Sep 1999 17:13:29 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: mkdir(). What am I doing wrong?
Message-Id: <Z0PF3.494$V7.69028@news.itd.umich.edu>

In article <37e7b4de.170451331@news.nikoma.de>,
Philip 'Yes, that's my address' Newton <nospam.newton@gmx.net> wrote:
>On Tue, 21 Sep 1999 15:03:26 GMT,
>mcafee@waits.facilities.med.umich.edu (Sean McAfee) wrote:
>>And what's that extra 512 for?  Permission bits don't go that high.

>setuid, setgid, sticky?

Oops!  I meant "permission" in the English sense of the word, not the
expanded Unix sense that includes such things as "set effective user ID on
execution", but didn't express myself precisely.

-- 
Sean McAfee                                                mcafee@umich.edu
print eval eval eval eval eval eval eval eval eval eval eval eval eval eval
q!q@q#q$q%q^q&q*q-q=q+q|q~q:q? Just Another Perl Hacker ?:~|+=-*&^%$#@!


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

Date: Tue, 21 Sep 1999 18:26:01 +0100
From: "sephiroth@id-base.com" <sephiroth@id-base.com>
Subject: Re: mkdir(). What am I doing wrong?
Message-Id: <37E7BFA9.8268CEEA@id-base.com>

Daniel Vesma wrote:

> Hi Guys,
>
> I am trying to get a script to create an empty directory with wide-open
> CHMOD settings.
>
> I am using this...
>
> use CGI qw(param);
> print "Content-type: text/html\n\n";
> $foo = param("foo");
> $makeDIR = "/my/path/is/here/" . $foo;
> mkdir($makeDIR, 777);
> print "YAY";
>
> It creates the directory, but when I try to go to them in ie5, I get the
> error...

Have you tried putting something in the directory? The forbidden access
error message usually pops up when you have nothing in the directory.

--
Aaron jp----is----------------------
Dj ShinyBlue--owner--of-------------
http://www.freelocalcalls.com/p3----
http://get.to/blahblur--------------
http://members.dencity.com/blahblur-




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

Date: Tue, 21 Sep 1999 13:22:15 -0400
From: "Michael Kraizman" <kraizman@hotmail.com>
Subject: MP3 file sorting in PERL
Message-Id: <7s8eja$b79$1@news2.tor.accglobal.net>

For those of you with large collections of MP3s, here's a small script I
wrote to extract the ID3 information from your MP3 files and sort them
accordingly. Have fun with it!

MK

#!/usr/bin/perl
# Author: Michael Kraizman
# Date: circa April, 1999
# Description: Sorts MP3 files in current directory into subdirectories
# based on ID3 tag information. The current sort criteria is:
#
# ./[Artist Name]/[Album Name]/[Song Title].mp3
#
# More information on the ID3 format can be found at:
# http://www.id3.org/id3v1.html
#
# Disclaimer:
# While this has worked for me fine, I take no responsibility for your files
# getting zonked (or going to bit heaven). Use at your own risk.

$rootdir = ".";
$catalog = "catalog.txt";
$jukebox = "jukebox.m3u";

sub Usage {
 print "$0\n";
 exit;
}

foreach $arg (@ARGV) {
 Usage() if ($arg =~ /-[h|?]/);
}

opendir(DIR, ".") || die "Can't opendir: $!";
@files = grep { /\.[mM][pP]3$/ and -f "./$_" } readdir(DIR);
closedir DIR;

open(M3U,  "> $rootdir/$jukebox") or warn "Could not create file: $!";
open(CTLG, "> $rootdir/$catalog") or warn "Could not create file: $!";

foreach $file (sort @files) {
 open(MP3, $file) or warn "Could not open file: $!";
 seek(MP3, -128, 2);
 read(MP3, $id3, 128);
 close(MP3);

 ($tag,$title, $artist, $album, $year, $comment,
$genre)=unpack("a3a30a30a30a4a30C1",$id3);

 if( !($tag =~ /^TAG/) ) {
  print "This file does not have a valid ID3 tag: $file\n";
  mkdir "unknown", 666 unless -e "unknown";
  rename $file, "$rootdir/unknown/$file" ;
  next;
 }

 $title =~ s/_/ /g;
 $title =~ s/(\s*)$//;
 $title =~ s/^(\s*)//;
 $title =~ s/[\?\/\!\.\&\,]//g;
 $title =  "unknown" if $title eq "";

 $album =~ s/_/ /g;
 $album =~ s/(\s*)$//;
 $album =~ s/^(\s*)//;
 $album =~ s/[\?\/\!\.\&\,]//g;
 $album =  "unknown" if $album eq "";

 $artist =~ s/_/ /g;
 $artist =~ s/(\s*)$//;
 $artist =~ s/^(\s*)//;
 $artist =~ s/[\?\/\!\.\&\,]//g;
 $artist =  "unknown" if $artist eq "";

 mkdir "$rootdir/$artist", 666 unless -e "$rootdir/$artist";
 mkdir "$rootdir/$artist/$album", 666 unless -e "$rootdir/$artist/$album";
 rename "$file", "$rootdir/$artist/$album/$title.mp3";

 print M3U  "$rootdir/$artist/$album/$title.mp3\n";
 print CTLG "Artist: $artist\nAlbum: $album\nTitle:
$title\nPath:$rootdir/$artist/$album/$title.mp3\n\n";
}

close(M3U);
close(CTLG);




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

Date: Wed, 22 Sep 1999 18:31:19 +0200
From: "Federico" <artax@shineline.it>
Subject: need help for Perl/CGI application
Message-Id: <7s8c59$ava$9@serv1.iunet.it>

Anybody could help me?

    First of all sorry for my terrible English! ^_^ I have read the
Herrmann's book "Teach yourself CGI PROGRAMMING with PERL 5 in a week", but
I think I haven't found what I need to know.

    I have to built a CGI application written in Perl 5 that:

- send a HTML form information to a remote server with the methods GET or
POST;

- receive the reply from the server and store it in a variable for a further
elaboration.

In other words, this application has to simulate, in a simpler way, what a
broswer do when it interacts whit a host HTML server sending a form and
receiving the answer. I don't know which Perl functions I must use and how.
I've thought, for example for the POST method, to open a file in this way:

    open(filename, '>>POST
http://www.sitename.com/subdirectory/program_cgi.cgi HTTP/1.1')

and then send the form information codified in URI standard to the STANDARD
OUTPUT;

1) is it correct?

2) have I to send some header too?

3) can I find the remote server reply in STANDARD INPUT?

4) if all yes, how can I do for the GET method?


    Thank you all, it would be great if you want reply me at
artax@shineline.it Bye,

                    Federico Bari.











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

Date: Wed, 22 Sep 1999 18:51:47 +0200
From: "Federico" <artax@shineline.it>
Subject: need HELP for Perl/CGI application
Message-Id: <7s8d7h$eam$1@serv1.iunet.it>

Anybody could help me?

    First of all sorry for my terrible English! ^_^ I have read the
Herrmann's book "Teach yourself CGI PROGRAMMING with PERL 5 in a week", but
I think I haven't found what I need to know.

    I have to built a CGI application written in Perl 5 that:

- send a HTML form information to a remote server with the methods GET or
POST;

- receive the reply from the server and store it in a variable for a further
elaboration.

In other words, this application has to simulate, in a simpler way, what a
broswer do when it interacts whit a host HTML server sending a form and
receiving the answer. I don't know which Perl functions I must use and how.
I've thought, for example for the POST method, to open a file in this way:

    open(filename, '>>POST
http://www.sitename.com/subdirectory/program_cgi.cgi HTTP/1.1')

and then send the form information codified in URI standard to the STANDARD
OUTPUT;

1) is it correct?

2) have I to send some header too?

3) can I find the remote server reply in STANDARD INPUT?

4) if all yes, how can I do for the GET method?


    Thank you all, it would be great if you want reply me at
artax@shineline.it Bye,

                    Federico Bari.








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

Date: Tue, 21 Sep 1999 17:46:55 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: need help for Perl/CGI application
Message-Id: <jwPF3.643$QJ.20797@typ11.nn.bcandid.com>

In article <7s8c59$ava$9@serv1.iunet.it>, Federico <artax@shineline.it> wrote:
>In other words, this application has to simulate, in a simpler way, what a
>broswer do when it interacts whit a host HTML server sending a form and
>receiving the answer. I don't know which Perl functions I must use and how.
>I've thought, for example for the POST method, to open a file in this way:
>
>    open(filename, '>>POST
>http://www.sitename.com/subdirectory/program_cgi.cgi HTTP/1.1')
>
>and then send the form information codified in URI standard to the STANDARD
>OUTPUT;
>
>1) is it correct?

No.

>2) have I to send some header too?

Yes.

>3) can I find the remote server reply in STANDARD INPUT?

No.

>4) if all yes, how can I do for the GET method?

You add the query string to the URL after a ?.

Use libwww-perl aka LWP.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Sep 21 1999
48 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Tue, 21 Sep 1999 19:46:29 +0200
From: "Trond Michelsen" <mike@crusaders.no>
Subject: Re: OmniPerl:  We're cheaper than OmniMark
Message-Id: <EtPF3.1655$1s6.21306@news1.online.no>


Rasmus Rimestad <rasmusr@online.no> wrote in message
news:FHNF3.1545$1s6.21161@news1.online.no...
> You're not serious about this are you?

I think you just proved why jeopardy-style posting /really/ should be
avoided.

If you had taken the time to hit CTRL-End, you could've seen this:

>(While I *have* created the OmniPerl lexer, this entire thing is just a
> >spoof.  I really think you should look at OmniMark if you're having a
> >rotten day.  It will make you feel so much better about yourself.)

--
Trond Michelsen





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

Date: Tue, 21 Sep 1999 16:07:09 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Output buffering/flusing problem in PERL-CGI
Message-Id: <N2OF3.146$QJ.11046@typ11.nn.bcandid.com>

In article <7s89k0$jme$1@epos.tesco.net>,
Yann S Taddei <yann@yann.screaming.net> wrote:
>Although partial output is generated almost as soon as the script it invoked
>(and more gets generated throughout the script), it all seems to be getting
>buffered and actually sent out only at the termination of the script.

Do you have the same problem at the command line?  Perhaps it is not
Perl, but your web server, that is causing the problems.

-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Mon Sep 20 1999
49 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: 21 Sep 1999 16:55:09 GMT
From: "pjd" <duraipPLEEASE__REMOVE_THIIS@extendsys.com>
Subject: Re: Perl : Excel OLE Automation
Message-Id: <7s8d9d$dbe$0@198.102.102.248>

>Do I have to install Excel on the PC running the script?
I am afraid so.

>Does the OS matter?
>(The OS is 98).

Not really. Any win32 system ought to be fine.

>
>(This is mainly for info).
>With the other other script, the PC with Excel had this error:
>Undefined subroutine &Win32::OLECreateObject called at
>D:/web/banking/perl/lib/OLE.pm line 104.
>

Are you sure you have a more recent/complete version of ActivePerl running
in this system ?. All the necessary modules installed ?

>And the PC without Excel (97) had:
>Can't call method "Workbooks" on unblessed reference at test.pl line 16.
>

Not surprising. Not unless you can pull off some DCOM stuff.

hope that helps
pj




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

Date: 21 Sep 1999 17:24:57 GMT
From: "pjd" <duraipPLEEASE__REMOVE_THIIS@extendsys.com>
Subject: Re: Perl : Excel OLE Automation
Message-Id: <7s8f19$ijp$0@198.102.102.248>

>Maybe this version is "currently working" but it still has no error
>checking and therefore is bound to send more users back to the newsgroup
>with questions as it has in the past.  The script does not "use strict"
>and has several things which could cause "-w" warnings but the main
>thing it lacks is any error checking on its open statement.  At the very
>least, change this:
>


my bad.
It is not a  good example. But I didnt mean it to be the official,working xl
sample.
My intention was to make Matt's script work with minimal diff.

pj




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

Date: Tue, 21 Sep 1999 19:46:48 +0200
From: "Matt King" <mattking@techie.com>
Subject: Re: Perl : Excel OLE Automation
Message-Id: <7s8e5b$15pg$1@news.uk.ibm.com>

> >Do I have to install Excel on the PC running the script?
> I am afraid so.
OK. I guess I have to install the program them, I didn't want to though.
Can't win 'em all.......

> Are you sure you have a more recent/complete version of ActivePerl running
> in this system ?. All the necessary modules installed ?
I have Active Perl 519. What are the necessary modules? Basically I have the
orginal Active installation running. I have installed the DB_File and GD and
GIFgraph.

> Not surprising. Not unless you can pull off some DCOM stuff.
? What DCOM stuff???? Where do I get this......

Matt





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

Date: Tue, 21 Sep 1999 12:47:22 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: perl related question now!
Message-Id: <x3y7llk6wkm.fsf@tigre.matrox.com>


David Cassell <cassell@mail.cor.epa.gov> writes:

>                                 Note that I am not going
> to continue by calling you a 'loser' also, as _ad_hominem_
                                                ^^^^^^^^^^^^
                                                ^^^^^^^^^^^^
                                                ^^^^^^^^^^^^

> arguments and name-calling are not appropriate here.

This word (ad hominem) popped up a couple of weeks ago in some post,
and suddenly everyone is using it (and I *still* don't know what it
means!). 

Is it The Way To Be? Is it good to be ad hominem?

--Ala



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

Date: Tue, 21 Sep 1999 19:36:12 +0200
From: "Trond Michelsen" <mike@crusaders.no>
Subject: Re: perl related question now!
Message-Id: <XjPF3.1645$1s6.21156@news1.online.no>


Ala Qumsieh <aqumsieh@matrox.com> wrote in message
news:x3y7llk6wkm.fsf@tigre.matrox.com...
> >                                 Note that I am not going
> > to continue by calling you a 'loser' also, as _ad_hominem_
>                                                 ^^^^^^^^^^^^
> > arguments and name-calling are not appropriate here.
> This word (ad hominem) popped up a couple of weeks ago in some post,
> and suddenly everyone is using it (and I *still* don't know what it
> means!).

Me neither... I'll have to look it up.

ad hominem
  1. Latin. appealing to a person's prejudices, emotions, or special
interests rather than to his intellect or reason.
  2. attacking an opponent's character rather than answering his argument.
[lit. to the man]

( I /love/ thick dictionaries :-)

> Is it The Way To Be? Is it good to be ad hominem?

I think it's safe to assume that it isn't a Good Thing (tm) to use ad
hominem arguments.

--
Trond Michelsen





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

Date: Tue, 21 Sep 1999 12:38:45 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: range of array indexes
Message-Id: <x3y90606wyz.fsf@tigre.matrox.com>


"Allan M. Due" <Allan@due.net> writes:

> Peter Icaza wrote in message <7s5rm0$d51o$1@pike.uhc.com>...
> :
> :i seem to come up with this problem often and i think that there must
> :be abetter way.  i want to put into a string, array elements x thru the
> :end of array.  something like:
> :
> : $str = array[$x-$#array];
> :or
> :$str = join(' ', array[$x-$#array] );
> :
> :yet i do it in a loop as:
> :for ($X=7; $X<$Z; $X++)    {
> :      $str.= "$array[$X] ";
> :      }
> :i dont find anything addressing this.  any pointers to resources or is
> :this "wish list" item a fantasy?
> 
> Why not just :
> 
> $str = join('',@array);
> 
> ?

Because he doesn't want to join ALL of the array. He also wants to
separate the array elements with spaces. What Peter really needs is
slightly different:

	$str = join ' ' => @array[$x..$#array];

HTH,
Ala



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

Date: Tue, 21 Sep 1999 10:49:39 -0700
From: Samay <samay1NOphSPAM@hotmail.com>
Subject: Re: Redirect STDERR
Message-Id: <1cb3e3d0.db7008ef@usw-ex0107-052.remarq.com>

open STDERR,">errofile";
your code




* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Tue, 21 Sep 1999 17:04:10 GMT
From: rwswebmaster@my-deja.com
Subject: sending HTML files in e-mail
Message-Id: <7s8dq0$kaq$1@nnrp1.deja.com>

I am looking for a script or program that allows for myself to send
HTML documents via e-mail to people.  I have a program that only sends
the HTML code in plain text, even though my mail program is set up to
accept HTML and I have received e-mail with all the graphics,
backgrounds, fonts, etc.  Any help would be greatly appreciated.

Thanks,
David Spivey


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 21 Sep 1999 10:41:55 -0700
From: Samay <samay1NOzdSPAM@hotmail.com>
Subject: Re: sending HTML files in e-mail
Message-Id: <070dbf92.d96ae6da@usw-ex0107-052.remarq.com>

Not perl related though, try www.iharvest.com
They put whole bunch of files, whatever you want to put 
from different websites as  a webPackage.. *.web or *.exe 



* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Tue, 21 Sep 1999 18:26:23 +0100
From: "Daniel Vesma" <daniel@vesma.co.uk>
Subject: THANKS
Message-Id: <7s8erf$7i9$1@gxsn.com>

Thanks guys! It's working great :)

Daniel Vesma
http://www.thewebtree.com
http://www.thewebtree.com/daniel-vesma





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

Date: Tue, 21 Sep 1999 17:26:59 GMT
From: dillon_rm@magix.com.sg (AcCeSsDeNiEd)
Subject: Using Perl Modules outside lib directory?
Message-Id: <37e7bce6.2665328@news.magix.com.sg>

Ok here's the situation: -

The administrator at the webhosting provider refuses to install
certain perl modules in the lib directory.

Is there anyway I can install the perl modules in a different
directory (e.g: cgi-bin) and let my script access the modules from
there?

How do I tell my scripts to access the modules from a different
directory?

Maybe I need to change this:

use Win32::ODBC



Thanks


To e-mail me, remove "_rm"


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

Date: Tue, 21 Sep 1999 17:42:56 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Using Perl Modules outside lib directory?
Message-Id: <AsPF3.624$QJ.22710@typ11.nn.bcandid.com>

In article <37e7bce6.2665328@news.magix.com.sg>,
AcCeSsDeNiEd <dillon_rm@magix.com.sg> wrote:
>Is there anyway I can install the perl modules in a different
>directory (e.g: cgi-bin) and let my script access the modules from
>there?

use lib '/home/dillon/cgi-bin';

Isn't this in the FAQ?
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Sep 21 1999
48 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Tue, 21 Sep 1999 09:51:43 -0700
From: Jazz <jazzie01NOivSPAM@hotmail.com>
Subject: Web browers
Message-Id: <0b2fea80.58e29d86@usw-ex0102-009.remarq.com>

What web browers was introduced in 1993.

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Tue, 21 Sep 1999 09:56:34 -0700
From: Jazz <jazzie01NOmsSPAM@hotmail.com>
Subject: Web browers
Message-Id: <184874d0.5a26a710@usw-ex0102-009.remarq.com>

What web brower was introduced in 1993?

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Tue, 21 Sep 1999 17:24:48 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Web browers
Message-Id: <AbPF3.530$QJ.19781@typ11.nn.bcandid.com>

In article <0b2fea80.58e29d86@usw-ex0102-009.remarq.com>,
Jazz  <jazzie01NOivSPAM@hotmail.com> wrote:
>What web browers was introduced in 1993.

Written in Perl?  None, AFAIK.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Sep 21 1999
48 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Tue, 21 Sep 1999 12:15:12 -0400
From: Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
Subject: Re: Which are the best books for learning Perl for use in a Web  environment?
Message-Id: <37E7AEBD.4B3D9A2D@chaos.wustl.edu>

Cameron Dorey wrote:

> pattern here. Not to say that there aren't other good books out there,
> but always look in one of these two places: 
> 1.      Books published by O'Reilly.

http://perl.oreilly.com

Also, Addison-Wesley @ http://www.awl.com and Manning @ http://www.manning.com

I might also recommend "Web Security", L. Stein, A-W and "Programming
Web Graphics with Perl & Gnu Software", Wallace, ORA.
http://www.oreilly.com/catalog/designperl/ looks like an interesting
book but won't ship until 2000.

e.


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

Date: Tue, 21 Sep 1999 17:02:46 GMT
From: Laith Suheimat <l.suheimat@mdx.ac.uk>
Subject: Win32::AdminMisc::ScheduleAdd
Message-Id: <7s8dnc$k9t$1@nnrp1.deja.com>

Hello,

I'm having problems submitting a job on NT using AdminMisc.
The plan is the perl script runs every ten minutes, so needs to
resubmit itself time_now + 10.

The fragment looks like this (excuse the long-winded code):

@lt = localtime;
my $mins = $lt[1] + 10;
my $next = $lt[2].":".$mins;
$DOW = " ";
$DOM = " ";
$Flags = "JOB_RUN_PERIODICALLY";
$Command = "perl d:\\dba\\perl\\ftptest.pl";
$Job = Win32::AdminMisc::ScheduleAdd("\\\\$machnam",
                                      $next,
                                      $DOM,
                                      $DOW,
                                      $Flags,
                                      $Command);

Although this submits to AT OK, it schedules it to run at local time +
10 minutes on the next 21st day of the month. I have tried using
different flags (JOB_RUNS_TODAY, etc.) to no avail.

In WinAT there is an option to set the job to run today - I think this
is what I need, but how to set it using ScheduleAdd?

All the AdminMisc FAQs, archived mails etc. only deal with the
situation where a job needs to be run once on a particular day.

Also, neither Roth's 'Win32 Perl Programming' or the win32 resource
kit 'Perl Utilities Guide' have much info on ScheduleAdd.

Any help would be greatly appreciated!

Laith Suheimat


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

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


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 866
*************************************


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