[17253] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4675 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 20 11:10:29 2000

Date: Fri, 20 Oct 2000 08:10:15 -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: <972054614-v9-i4675@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 20 Oct 2000     Volume: 9 Number: 4675

Today's topics:
    Re: Posting from perl to "cgi" <mbudash@sonic.net>
    Re: programming (Martien Verbruggen)
    Re: programming <anders@wall.alweb.dk>
    Re: programming <ubl@schaffhausen.de>
    Re: Rijndael in Perl <runu.knips@gmx.de>
    Re: Rijndael in Perl <runu.knips@gmx.de>
        Send Mail and Pass Data to URL <richard@pacificCG.com>
        Time-out error fayerman@my-deja.com
    Re: whence $0 (Paul David Fardy)
        Working w/ Hashes of Arrays w/in an object <martin.mclaughlin@uvm.edu>
    Re: Working w/ Hashes of Arrays w/in an object <aqumsieh@hyperchip.com>
        XML::XSLT ?? <nospam_fge@worldonline.dk>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 20 Oct 2000 06:32:19 -0700
From: Michael Budash <mbudash@sonic.net>
Subject: Re: Posting from perl to "cgi"
Message-Id: <mbudash-B654E2.06321920102000@news.pacbell.net>

In article <8souqn$ksu$1@nnrp1.deja.com>, aviachili@my-deja.com wrote:

> Hi,
> 
> Using a form, I am posting this to my perl
> proggie:
> user=michel&password=miriam
> In perl I check the user and password for
> validation BEFORE I sent the data over to the
> excisting cgi.
> Now the thing is, the second "CGI" does expect a
> posted form. It uses PHP to take the values
> posted and process them.
> Now, HOW do you post from perl.
> Instead of calling a cgi like this: test.cgi?
> username=blah&password=pass I want it to be
> POSTED.

check out the LWP (libwww-perl) group of modules, they rule:

http://www.perl.com/CPAN-local/modules/by-module/LWP/

hth-
-- 
Michael Budash ~~~~~~~~~~ mbudash@sonic.net


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

Date: Sat, 21 Oct 2000 00:01:42 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: programming
Message-Id: <slrn8v0ghl.fji.mgjv@martien.heliotrope.home>

On Fri, 20 Oct 2000 12:30:03 -0000,
	p_devaki1@yahoo.com <p_devaki1@yahoo.com> wrote:
> what is the application of cgi & perl? how does it differ from other 
> networking programming languages?

Perl isn't really a networking language. And CGI is no networking
protocol either. It's an interface (Common Gateway Interface) for
programs to run on behalf of HTPP servers.

http://www.cgi-resources.com/, go to the Documentation section.
http://www.perl.com/

Perl is often associated with CGI, because CGI is a lot about text
handling, and Perl is just good at that. But most of the CGI
applications I've written I've written in C. I know of C++, tcl, sh,
csh, Python, and even Fortran CGI programs. I'm sure that many other
languages are used. None of those I would classify as a networking
language.

> i want to give talk on cgi with perl ,can i get the basics of cgi & 
> perl ,its use over other languages,why it is used,? where exactly it is 
> used ? when did the people start using this? & other related information

Don't take this the wrong way, but if you need to ask all these
questions, why are _you_ the person giving the talk?

To get the basics of CGI, visit the link above. To get the basics of
Perl, read the documentation, or buy a good book. To talk about the
differences with other languages, learn all of those other languages,
and compare them.

Perl has been in use since 1987, well before the Web took off. I happen
to believe that Perl is mostly used for system administration tasks, but
I could be wrong. I think it is used because it gets jobs done, and it
gets them done in acceptable time. Besides that, Perl is fun to work
with. it is used all over the world. Other related information can be
found at various places.

If you need a ghostwriter, maybe you should post a job offer in one of
the job groups. Not here, please.

> Posted via CNET Help.com
> http://www.help.com/

aha. Time to update the score file.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | If it isn't broken, it doesn't have
Commercial Dynamics Pty. Ltd.   | enough features yet.
NSW, Australia                  | 


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

Date: Fri, 20 Oct 2000 16:11:23 +0200
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: programming
Message-Id: <ZoYH5.8216$Tq1.299067@news010.worldonline.dk>

p_devaki1@yahoo.com wrote:

> what is the application of cgi & perl? how does it differ from other
> networking programming languages?
> i want to give talk on cgi with perl ,can i get the basics of cgi &
> perl ,its use over other languages,why it is used,? where exactly it is
> used ? when did the people start using this? & other related information
> 
> --
> Posted via CNET Help.com
> http://www.help.com/

Good starting poinst could be

http://www.perl.org
http://www.perl.com
http://history.perl.org

http://www.google.com
http://www.amazon.com

-anders

-- 
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]


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

Date: Fri, 20 Oct 2000 16:11:18 +0200
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: programming
Message-Id: <39F05287.25AAF6D6@schaffhausen.de>

p_devaki1@yahoo.com schrieb:
> 
> what is the application of cgi & perl? how does it differ from other
> networking programming languages?
> i want to give talk on cgi with perl ,can i get the basics of cgi &
> perl ,its use over other languages,why it is used,? where exactly it is
> used ? when did the people start using this? & other related information

CGI is a programming language used to program dynamic web-content as an
alternative to HTML.
Oh, I'm mistaken, its a Gateway Interface between a web-server and some kind
of program. There is no direct connection between Perl and CGI.

If I want to know something about Perl I start looking at www.Perl.com
You probably dont want to know anything about CGI itself, but maybe you 
want to look at the documentation of CGI.pm which isdistributed with the 
standard installation of modern Perl builds.

Have Fun,

malte


-- 
$me = Person->new("Malte Ubl");
$me->comp ("Schaffhausen | Interactive");
$me->job  ("Developer for web-based Applications");
$me->phone("+49 4121 472964");
$me->fax  ("+49 4121 472938");
exit; # reference count = 0 -> $me->DESTROY


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

Date: Fri, 20 Oct 2000 15:06:27 +0200
From: Runu Knips <runu.knips@gmx.de>
Subject: Re: Rijndael in Perl
Message-Id: <39F04353.87109384@gmx.de>

"Tony L. Svanstrom" wrote:
> I think he meant how I can use Perl to avoid attacks where the attacker
> looks at what's "left behind" (tempfiles, diskswapping...).

Interesting.

I don't even know the answer for C. Is it actually possible with
Windows or Linux to get memory which isn't swappable ? As an
ordinary user process, or as a administrator process ?


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

Date: Fri, 20 Oct 2000 15:24:23 +0200
From: Runu Knips <runu.knips@gmx.de>
Subject: Re: Rijndael in Perl
Message-Id: <39F04787.64578A5B@gmx.de>

Rasputin wrote:
> tony@svanstrom.com <Tony L. Svanstrom> wrote:
> >Runu Knips <runu.knips@gmx.de> wrote:
> >> those who know me have no need of my name wrote:
> >> > <1eipo5k.cqrn9u17tsqe1N%tony@svanstrom.com> divulged:
> >> > >Anyone that knows if Rijndael exists in Perl yet and/or if
> >> > >someone's working on it?
> >> > ummm.  how would one protect the plaintext?
> >> I've no clue what you're actually asking. The plaintext is guarded
> >> by transforming it to ciphertext using some encryption routine, for
> >> example Rijndael. But the simple fact that you know what
> >> 'plaintext' is means you already know that.
> >I think he meant how I can use Perl to avoid attacks where the
> >attacker looks at what's "left behind" (tempfiles, diskswapping...).
> 
> Don't use tempfiles, and encrypt your swap.
> OpenBSd does this, (using Rijndael, funnily enough)
> I'd imagine other decent OSes could be patched.

I would be surprised if Linux would get such a feature, because
encrypting the swap of course slows it down substantly.

> It's not really perl's job.

Yep.


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

Date: Fri, 20 Oct 2000 14:56:10 GMT
From: "Richard" <richard@pacificCG.com>
Subject: Send Mail and Pass Data to URL
Message-Id: <e2ZH5.6809$rD3.221095@newsread2.prod.itd.earthlink.net>

I'm using a form to send data to the URL of our credit card transaction
service. However, they don't return data from any custom fields. We would
like to send the data to our "mailer.cgi" and have the script forward the
data to the URL of the card processor where the customer can complete the
transaction. Is there a line of code I can add to the script that would
forward the data?

Any assistance would be greatly appreciated!

Richard





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

Date: Fri, 20 Oct 2000 12:59:55 GMT
From: fayerman@my-deja.com
Subject: Time-out error
Message-Id: <8spfk8$r4$1@nnrp1.deja.com>

$t->cmd(String => "0123456",
Prompt => "/2. Enter the OU Code (NNN\/NNN):/",
Timeout => 5);

First line of this code causes time-out, what can be wrong?


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 20 Oct 2000 13:39:43 GMT
From: pdf@morgan.ucs.mun.ca (Paul David Fardy)
Subject: Re: whence $0
Message-Id: <8sphuv$crt$1@coranto.ucs.mun.ca>

>>>>> "merlyn" == merlyn@stonehenge.com (Randal L. Schwartz) writes:
>>>>> "Peter" == Peter McMorran <mcmorran@visi.net> writes:

>>> So $0 contains the name of the file containing the Perl script
>>> currently being executed, but where can I find the path to said
>>> file?

Peter> A little clarification is in order here. On Unix-like systems, if
Peter> you have a script called fred.pl, and run it from the prompt as

Peter> % fred.pl 

Peter> then $0 contains either the simple name of the file, if it was
Peter> run from the current directory, or the expanded path to the file
Peter> consisting of the name prefixed by the entry in $path that was
Peter> used to find it.

merlyn> Or something else entirely.  Remember, $0 is trivial to spoof... Perl
merlyn> even gives you the tools to do it:
merlyn> 
merlyn>    system { $what_I_want_dollar_0_to_say } $program, @args;
merlyn> 
merlyn> It just happens that the shells *usually* put the program name
merlyn> in $0.  But that's just a *usually*.

That should be

	system { $program } $what_I_want_dollar_0_to_say, @args;

I just wanted to correct Randal, once.  :-)

Paul Fardy
-- 
Paul David Fardy             | Computing and Communications
Systems Administrator        | Memorial University of Newfoundland
e-mail: pdf@mun.ca           | St. John's, NF  A1C 5S7     CANADA


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

Date: Fri, 20 Oct 2000 09:14:57 -0400
From: Martin McLaughlin <martin.mclaughlin@uvm.edu>
Subject: Working w/ Hashes of Arrays w/in an object
Message-Id: <39F04551.BE984257@uvm.edu>

 I wonder if you could clarify my misconception with the following.

I have a RateTable object and one of the properties (IDD_MAT) is a
hash.   Each element of the hash is an array.  In the show method, I can

access the individual elements w/in the hash using the syntax:

print "$self->{IDD_MAT}->{aaa}->[2]\n";

But I would like to do something like the following:

    my %h = $self->{IDD_MAT}; #What do I need to do to access the
hash???
    foreach my $key (keys %h) {
      print "IDDMAT = $key value = %h->{$key}\n";}

Using the test harness foo, I get the following output:

> foo
name=<fielname.dat>
directory=<AAAA>
Access elements directly:
asasasasasas
4
Access elements via hash variable:
Reference found where even-sized list expected at RateTable.pm line 47.
IDDMAT = HASH(0x20033a34) value = %h->{HASH(0x20033a34)}
>

Do you see where I've gone astray?????  Any recommendations?

Thanks,
Marty

Code snippets for foo & RateTable.pm:

zoo> cat foo
#!/usr/bin/perl -w

use RateTable;

$rt = RateTable->new("AAAA","fielname.dat");
$rt->open();
$rt->show();

=========
RateTable.pm:

package RateTable;
use strict;

#####################################
## Constructor                     ##
#####################################

sub new {
 my $self = {};
 $self->{DIRECTORY} = $_[1];
 $self->{NAME} = $_[2];
 $self->{IDD_MAT} = ();
 bless($self);
 return $self;
}

#####################################
## Methods to get/set properties   ##
#####################################
sub directory {
 my $self = shift;
 if (@_) {$self->{DIRECTORY} = shift}
 return $self->{DIRECTORY};
}

sub name {
 my $self = shift;
 if (@_) {$self->{NAME} = shift}
 return $self->{NAME};
}

#####################################
## Methods                         ##
#####################################
sub show {
 # displays the current contents of the class
 my $self = shift;
 printf "name=<%s>\ndirectory=<%s>\n",
          $self->name || "",
          $self->directory || "";

 if ($self->{IDD_MAT}) {
    print "Access elements directly:\n";
    print "$self->{IDD_MAT}->{aaa}->[2]\n";
    print "$self->{IDD_MAT}->{bb}->[1]\n";
    print "Access elements via hash variable:\n";
    my %h = $self->{IDD_MAT}; #What do I need to do to access the
hash???
    foreach my $key (keys %h) {
      print "IDDMAT = $key value = %h->{$key}\n";}
 }
}
sub open {
 # reads the values in from file
 my $self = shift;

 $self->{IDD_MAT}->{"aaa"}=[1,2, "asasasasasas"];
 $self->{IDD_MAT}->{"bb"}=[3,4, "aacccccsdfffff"];


}
1;




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

Date: Fri, 20 Oct 2000 14:22:32 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: Working w/ Hashes of Arrays w/in an object
Message-Id: <7a4s27wq1h.fsf@merlin.hyperchip.com>


Martin McLaughlin <martin.mclaughlin@uvm.edu> writes:

>  I wonder if you could clarify my misconception with the following.
> 
> I have a RateTable object and one of the properties (IDD_MAT) is a
> hash.   Each element of the hash is an array.  In the show method, I can
> 
> access the individual elements w/in the hash using the syntax:
> 
> print "$self->{IDD_MAT}->{aaa}->[2]\n";

I prefer to use the following syntax, since it's shorter:

	$self->{IDD_MAT}{aaa}[2]

> But I would like to do something like the following:
> 
>     my %h = $self->{IDD_MAT}; #What do I need to do to access the
> hash???

You need to read perlref and perldsc! Then, the following will be
obvious:

	my %h = %{$self->{IDD_MAT}};

But why do you want to do that? If you do not intend to modify your
hash, making a copy simply wastes memory. Moreover, any changes you make
to %h will NOT be reflected back on the anonymous hash referred to by
$self->{IDD_MAT}.

>     foreach my $key (keys %h) {
>       print "IDDMAT = $key value = %h->{$key}\n";}

	print "IDDMAT = $key value = $h{$key}\n";

> Do you see where I've gone astray?????  Any recommendations?

You did not take the time to read the documentation and understand
Perl's complex data structures. They are simple and staightforward once
you understand them. I suggest you have a good look at the perlref and
perldsc docs.

--Ala


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

Date: Fri, 20 Oct 2000 16:00:52 +0200
From: "F.G." <nospam_fge@worldonline.dk>
Subject: XML::XSLT ??
Message-Id: <39F05013.BCBB98FC@worldonline.dk>

Hello,
working with XML::XSLT I have got som problems. My program:

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

#!/usr/bin/perl
print "content-type: text/html\n\n";

$xmlfile="14-1.xml";
$xslfile="14-4.xsl";

use XML::XSLT;

my $parser = XML::XSLT->new ($xslfile, "FILE", warnings => "Active");
$parser->transform_document ($xmlfile, "FILE");

$parser->print_result;

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

The problem:
Working on a command line the output of the transformation is printed on
the screen; using the program with my apache, there is no page-content
to be shown. - It seems, that the "print_result" prints to STDOUT, but
why does the webserver does not return the output?

Thanks for you help.
Franziskus



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

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


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