[17184] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4596 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 12 14:05:35 2000

Date: Thu, 12 Oct 2000 11:05:17 -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: <971373916-v9-i4596@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 12 Oct 2000     Volume: 9 Number: 4596

Today's topics:
    Re: Access DB & Perl <RuedigerKoch@web.de>
    Re: Calling Perl scripts inside HTML file within a Wind <nospam@david-steuber.com>
        Cannot find the error <soeder@ai-lab.fh-furtwangen.de>
    Re: Cannot find the error <anders@wall.alweb.dk>
    Re: Cannot find the error <mtaylorlrim@my-deja.com>
    Re: Cannot find the error <anmcguire@ce.mediaone.net>
    Re: Cannot find the error <mjcarman@home.com>
    Re: Cannot find the error nobull@mail.com
        cgi with perl on Apache-1.3.12-Linux-6.2 - beginner abevec@my-deja.com
        Changing name of file in header? <ah@datapharm.de>
    Re: Changing name of file in header? <ah@datapharm.de>
    Re: Changing name of file in header? <gus@black.hole-in-the.net>
    Re: Collecting Information (brian d foy)
    Re: Cutesy Arrows - Just say nope! <nospam@david-steuber.com>
        Dynamic site tree based on directory structure altarace@my-deja.com
    Re: Filehandle to string (or HTTP::Request)? nobull@mail.com
        Global TeleCommute Programmers - PERL JAVA JS CSS Dream GlobalPERLjavaPRG@INTperlPRG.com
    Re: hoe to alter @INC? <anmcguire@ce.mediaone.net>
    Re: hoe to alter @INC? <mauldin@netstorm.net>
    Re: hoe to alter @INC? <anmcguire@ce.mediaone.net>
    Re: hoe to alter @INC? <nospam@david-steuber.com>
    Re: How can I add 5 hours to the time my server reports nobull@mail.com
        How to get calling module/script inside a module... snakedjip@yahoo.com
    Re: How to get calling module/script inside a module... <tony_curtis32@yahoo.com>
    Re: How to read EMail  address of user(CGI) <nospam@david-steuber.com>
    Re: How to read EMail  address of user(CGI) nobull@mail.com
    Re: Invoking ssh from a script (Dave Sherohman)
    Re: is there a better way to do this? <nospam@david-steuber.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 12 Oct 2000 18:33:58 +0200
From: "Ruediger Koch" <RuedigerKoch@web.de>
Subject: Re: Access DB & Perl
Message-Id: <8s4p57$pjp$1@news.fth.sbs.de>


you could use DBI::Proxy. The windows server connects via odbc to access and
the unix client sends his requests to the proxy server.

Its not as hard as it sounds. Hope it helps

Neb <berube@odyssee.net> schrieb in im Newsbeitrag:
U5bF5.862$hH2.16757@news.globetrotter.net...
> Hi,
>
> Is there a way to use a MS Access database in a Perl script without using
> ODBC?  For example, on a Unix server?  I want to be able to query the
> database using SQL.  Is this possible?
>
> thanks in advance,
>
> neb
>
>
>
>




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

Date: Thu, 12 Oct 2000 16:51:56 GMT
From: David Steuber <nospam@david-steuber.com>
Subject: Re: Calling Perl scripts inside HTML file within a Windows environment
Message-Id: <m3vguyc89l.fsf@solo.david-steuber.com>

This is a webserver question.

-- 
David Steuber | Perl apprentice, Apache/mod_perl user,
NRA Member    | and general Internet web wannabe.
ICQ# 91465842
***         http://www.david-steuber.com/          ***


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

Date: Thu, 12 Oct 2000 18:57:11 -0700
From: Oliver Soeder <soeder@ai-lab.fh-furtwangen.de>
Subject: Cannot find the error
Message-Id: <39E66BF6.994B8C5C@ai-lab.fh-furtwangen.de>

Can anybody help me out?  I don't find the problem.

print "Bitte geben Sie eine Ziffernfolge ein:\n";
$zahl=<STDIN>;
chomp $zahl;
@feld=split(//,$zahl);
$i=1;

#1. Schritt

while (defined($feld[$i]))
        {
        $j=0;
        $mal2[$j]=$feld[$i]*2;
        j++;                                             #THERE SEEMS TO
BE AN ERROR HERE BUT I CAN'T FIND
        i=i+2;
        }
foreach $quer (@mal2)
        {
                if ($quer<10)
                {
                        $n=0;$o=0;
                        while(defined($mal2[$n]))
                        {
                                $smallerten[$o]=$mal2[$n];
                                n++; o++;
                        }




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

Date: Thu, 12 Oct 2000 18:37:27 +0200
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: Cannot find the error
Message-Id: <0OlF5.11839$UW.325894@news010.worldonline.dk>

Oliver Soeder wrote:

> Can anybody help me out?  I don't find the problem.

> while (defined($feld[$i]))
>         {
>         $j=0;
>         $mal2[$j]=$feld[$i]*2;
>         j++;                                             #THERE SEEMS TO
> BE AN ERROR HERE BUT I CAN'T FIND
>         i=i+2;
>         }

You may wish to use perl code if you expect perl to execute it.
Try prefixing variables with "$" or "@" or "%", according to type.

Before posting such questions, you'd like to run your scripts with the w 
scwitch, as well as using the strict and warning pragmas.

-anders

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


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

Date: Thu, 12 Oct 2000 16:27:37 GMT
From: Mark <mtaylorlrim@my-deja.com>
Subject: Re: Cannot find the error
Message-Id: <8s4opd$lrk$1@nnrp1.deja.com>

Just a shot in the dark, but shouldn't they all read....


>j++;     #THERE SEEMS TO BE AN ERROR HERE BUT I CAN'T FIND
>i=i+2;

$j++;
$i=$i+2


>$smallerten[$o]=$mal2[$n];
>n++; o++;

$n++; $o++;



Mark


--
Please reply to this newsgroup as my Deja mail
is used as a spam catcher only!


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


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

Date: Thu, 12 Oct 2000 11:35:31 -0500
From: "Andrew N. McGuire " <anmcguire@ce.mediaone.net>
Subject: Re: Cannot find the error
Message-Id: <Pine.LNX.4.21.0010121131490.19963-100000@hawk.ce.mediaone.net>

On Thu, 12 Oct 2000, Oliver Soeder quoth:

OS> Can anybody help me out?  I don't find the problem.
OS> 
OS> print "Bitte geben Sie eine Ziffernfolge ein:\n";
OS> $zahl=<STDIN>;
OS> chomp $zahl;
OS> @feld=split(//,$zahl);
OS> $i=1;
OS> 
OS> #1. Schritt
OS> 
OS> while (defined($feld[$i]))
OS>         {
OS>         $j=0;
OS>         $mal2[$j]=$feld[$i]*2;
OS>         j++;                                             #THERE SEEMS TO
           ^^^^^
           This is not the only place you forgot the '$'...

[ snip rest of script ]
          
If you had started your script with:

#!/usr/bin/perl -w

your problem will become obvious.  Any time you refer to a scalar variable
you must prefix it with the '$' sign.  I am guessing you're a C programmer?
Also learn to 'use strict;' as it will save you from making quite a few
mistakes you would have otherwise not noticed.

anm
-- 
perl -lwMstrict -e ' # Jim Menard -> Wyzelli -> Andrew McGuire
for$;(reverse++$|..100){$:=$;==$|?q++:"s";$@="bottle";$_=(q\e\x2)."l"x2**1
;m?(..)$?,;$$=" on";print$;=>v32,"$@$:".v32,"of b$`r".$$." th$`\b wa$1,"=>
v10."$; $@$: of b$`r,\012tak$`\b$$"."e down, pass it around,",q&&;$;--;$:=
$;==$|?$!:q-s-=>;print"$; $@$:$$\bf b$`r",$$." the wa$1\n"}print q#*burp*#
'



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

Date: Thu, 12 Oct 2000 11:42:36 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: Cannot find the error
Message-Id: <39E5E9FC.F7CA193D@home.com>

Oliver Soeder wrote:
> 
> while (defined($feld[$i]))
>         {
>         $j=0;
>         $mal2[$j]=$feld[$i]*2;
>         j++;

You mean '$j++;'

>         i=i+2;

And here, '$i = $i + 2;' or just '$i += 2;'

>         }
> foreach $quer (@mal2)
>         {
>                 if ($quer<10)
>                 {
>                         $n=0;$o=0;
>                         while(defined($mal2[$n]))
>                         {
>                                 $smallerten[$o]=$mal2[$n];
>                                 n++; o++;

Again, no $ on your scalar vars. This isn't C. :)

>                         }

Please run your script under -w and strict if you aren't already. The
diagnostics will warn you about barewords and attempting to modify
constants.

-mjc


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

Date: 12 Oct 2000 18:29:39 +0100
From: nobull@mail.com
Subject: Re: Cannot find the error
Message-Id: <u9y9zuynlo.fsf@wcl-l.bham.ac.uk>

Oliver Soeder <soeder@ai-lab.fh-furtwangen.de> writes:

> Can anybody help me out?  I don't find the problem.

>           j++;      #THERE SEEMS TO BE AN ERROR HERE BUT I CAN'T FIND
>           i=i+2;

In Perl scalar variables are prefixed with $.  (Actually that's an
over-simplification).

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Thu, 12 Oct 2000 17:51:27 GMT
From: abevec@my-deja.com
Subject: cgi with perl on Apache-1.3.12-Linux-6.2 - beginner
Message-Id: <8s4tmr$qke$1@nnrp1.deja.com>

I created a cgi Perl script in my cgi-bin directory that is suppose to
get executed on an "get" html command.  But the Appache server comes
back with an error.  I'm the server administrator.  All the
files/directories are mode 755 protected.  Any ideas how to correct this
problem.
 . thanks -abevec

Apache Error Reponse:

"Internal Server Error

The server encountered an internal error or misconfiguration and was
unable to complete your request.

Please contact the server administrator, root@localhost and inform them
of the time the error occurred, and
anything you might have done that may have caused the error.

More information about this error may be available in the server error
log."


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


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

Date: Thu, 12 Oct 2000 17:47:01 +0200
From: Andreas Huber <ah@datapharm.de>
Subject: Changing name of file in header?
Message-Id: <39E5DCF5.4B41BD67@datapharm.de>

Hi,

how can I change the name of a file perl is sending to a browser? Can I
do it in the header?

I have a imagedb on my site. There are small sample pictures which
linked to a cgi. This cgi read the big download image and send it to the
browser. The browser ask if you want to save the file, but give the cgi
filename "download.cgi" as sample filename. So nobody knows the right
Content-type, if it is a jpeg, gif, psd, or anything else....

thanks for the help

Ciao

--
Andreas Huber
Produktion & Entwicklung
Datapharm Netsystems AG

E-Mail: ah@datapharm.de
Tel.: (+49) 89 85 68 4 -202
Fax:  (+49) 89 85 68 4 -100




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

Date: Thu, 12 Oct 2000 17:51:34 +0200
From: Andreas Huber <ah@datapharm.de>
Subject: Re: Changing name of file in header?
Message-Id: <39E5DE06.A7D4E790@datapharm.de>







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

Date: Thu, 12 Oct 2000 16:41:01 GMT
From: Gus <gus@black.hole-in-the.net>
Subject: Re: Changing name of file in header?
Message-Id: <971368861.25500.0.nnrp-04.c29f015a@news.demon.co.uk>

Andreas Huber <ah@datapharm.de> wrote:
> Hi,

> how can I change the name of a file perl is sending to a browser? Can I
> do it in the header?

Add on extra path information to the URL, for example if your program
is called "download.pl" make the URLs

http://www.foo.bar/cgi-bin/download.pl/imagename.jpg


BTW, this really belongs in comp.infosystems.www.authoring.cgi

Regards,
	_Gus



-- 
gus@black.hole-in-the.net
0x58E18C6D
82 AA 4D 7F D8 45 58 05  6D 1B 1A 72 1E DB 31 B5
http://black.hole-in-the.net/gus/


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

Date: Thu, 12 Oct 2000 13:29:11 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: Collecting Information
Message-Id: <brian-ya02408000R1210001329110001@news.panix.com>

In article <8s3p63$sl7$1@nnrp1.deja.com>, gvtt@my-deja.com posted:

> Could anyone tell me if there is CGI code for free or to buy which,
> when someone visits my web site, the code will collect information
> about which sites that person has been on before?

in general, that inforamtion is only available if the user agent
mistakenly exposes it or you use something vile like a third domain
banner thingy.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>


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

Date: Thu, 12 Oct 2000 16:23:05 GMT
From: David Steuber <nospam@david-steuber.com>
Subject: Re: Cutesy Arrows - Just say nope!
Message-Id: <m33di2do63.fsf@solo.david-steuber.com>

"Godzilla!" <godzilla@stomp.stomp.tokyo> writes:

' With hopes of not reading disrespectful, your description
' perfectly and precisely defines use of modules, which are
' clearly, modern day Perl cargo cult.

And to think that all this time I thought it was a form of code reuse
that is encouraged by object oriented programming methodology.

If the wheel fits, use it.

perl -e 'print "just another Perl hack\n";'

-- 
David Steuber | Perl apprentice, Apache/mod_perl user,
NRA Member    | and general Internet web wannabe.
ICQ# 91465842
***         http://www.david-steuber.com/          ***


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

Date: Thu, 12 Oct 2000 17:40:07 GMT
From: altarace@my-deja.com
Subject: Dynamic site tree based on directory structure
Message-Id: <8s4t1n$q1o$1@nnrp1.deja.com>

Hi All,

I am looking for a way to have a navigation tree on my site that is
based on the site directory structure.

I assume it might need to have a perl script on the server side to
generate a sort of a map file, and a java script or applet to interpret
the map file and
build the tree accordingly.

Did anyone see something like that?

Haim


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


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

Date: 12 Oct 2000 18:29:21 +0100
From: nobull@mail.com
Subject: Re: Filehandle to string (or HTTP::Request)?
Message-Id: <u9zokaynm6.fsf@wcl-l.bham.ac.uk>

Jeff Boes <jboes@eomonitor.com> writes:

> Simpleminded approach: grab the content, open a file in /tmp, write it
> out, open a read-only filehandle to it.
> 
> Complex approach: overload the '<>' operator.
> 
> Other approaches: ??

The simpleminded version of the complex approach is to use IO::Scalar


-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Thu, 12 Oct 2000 17:37:38 GMT
From: GlobalPERLjavaPRG@INTperlPRG.com
Subject: Global TeleCommute Programmers - PERL JAVA JS CSS DreamWeaver
Message-Id: <CFmF5.9033$46.80900@typhoon.san.rr.com>

         *** TELE COMMUTE ONLY  
      
             WEB PAGE PROGRAMMER ****  

HIGH EXPERIENCE WITH DREAMWEAVER PREFERRED
KNOWLEDGE OF DHTML AND CSS CAPABILITIES OF DREAMWEAVER A+
KNOWLEDGE OF WINDOWS NT 4.0 IIS (server) A+
KNOWLEDGE OF WEB PROGRAMMING: PERL / CGI / JavaScript A +
Knowledge of programming: C / Java  A+

15 TO 40 HOURS PER WEEK  

$15.00 to $25.00 per hour commensurate with experience.

Using a Remote Control software utility called TIMBUKTU,
2 people can work on the same computer simultaneously.

Specific "Log-On' Schedule required. Flexible. 
Prefer Mornings (PST), but afternoons, ok.
2 to 3 hours per remomte 'log-on' session.
2 to 3 times per week. 
Timbuktu has an audio channel and chat features.
High-Bandwidth Not necessary, but PREFERRED. 

Some work done off-line, but this is PRIMARILY a 
real-time, log-on position. Instead of having a
specific schedule at an office, a specific computer
log-on schedule is required.

Please respond directly to:
TeleComMuter@Law.com



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

Date: Thu, 12 Oct 2000 10:57:23 -0500
From: "Andrew N. McGuire " <anmcguire@ce.mediaone.net>
Subject: Re: hoe to alter @INC?
Message-Id: <Pine.LNX.4.21.0010121056070.19951-100000@hawk.ce.mediaone.net>

On Thu, 12 Oct 2000, Jim Mauldin quoth:

JM> cen09220 wrote:
JM> > 
JM> > Rafael Garcia-Suarez wrote:
JM> > >
JM> > > Werner, Wolfgang wrote in comp.lang.perl.misc:
JM> > > >hi,
JM> > > >how can i change @INC?
JM> > > >i wan to have a new dir for modules
JM> > > >thans
JM> > >
JM> > > The preferred way to do this is to add at the beggining of your scripts:
JM> > >   use lib '/new/dir/for/modules';
JM> > 
JM> > Why is that better than pushing the path onto @INC?
JM> 
JM> Modules specified by a 'use' declaration are loaded during compilation,
JM> before the program begins to execute.  So even if you push something
JM> onto @INC as the very first statement of your program, it's already too
JM> late.

That is not true, IIRC, you can unshift the directory onto @INC in a 
BEGIN {} block to achieve the same effect.

anm
-- 
perl -lwMstrict -e ' # Jim Menard -> Wyzelli -> Andrew McGuire
for$;(reverse++$|..100){$:=$;==$|?q++:"s";$@="bottle";$_=(q\e\x2)."l"x2**1
;m?(..)$?,;$$=" on";print$;=>v32,"$@$:".v32,"of b$`r".$$." th$`\b wa$1,"=>
v10."$; $@$: of b$`r,\012tak$`\b$$"."e down, pass it around,",q&&;$;--;$:=
$;==$|?$!:q-s-=>;print"$; $@$:$$\bf b$`r",$$." the wa$1\n"}print q#*burp*#
'



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

Date: Thu, 12 Oct 2000 16:13:26 GMT
From: Jim Mauldin <mauldin@netstorm.net>
Subject: Re: hoe to alter @INC?
Message-Id: <39E5E2CF.6050ACEA@netstorm.net>

"Andrew N. McGuire" wrote:
> 
> On Thu, 12 Oct 2000, Jim Mauldin quoth:
> 
> JM> cen09220 wrote:
> JM> >
> JM> > Rafael Garcia-Suarez wrote:
> JM> > >
> JM> > > Werner, Wolfgang wrote in comp.lang.perl.misc:
> JM> > > >hi,
> JM> > > >how can i change @INC?
> JM> > > >i wan to have a new dir for modules
> JM> > > >thans
> JM> > >
> JM> > > The preferred way to do this is to add at the beggining of your scripts:
> JM> > >   use lib '/new/dir/for/modules';
> JM> >
> JM> > Why is that better than pushing the path onto @INC?
> JM>
> JM> Modules specified by a 'use' declaration are loaded during compilation,
> JM> before the program begins to execute.  So even if you push something
> JM> onto @INC as the very first statement of your program, it's already too
> JM> late.
> 
> That is not true, IIRC, you can unshift the directory onto @INC in a
> BEGIN {} block to achieve the same effect.
> 
Your statement is probably better written as "true unless you unshift
the directory into a BEGIN block".  But use lib has other advantages as
well, including simplicity.

-- Jim


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

Date: Thu, 12 Oct 2000 11:41:40 -0500
From: "Andrew N. McGuire " <anmcguire@ce.mediaone.net>
Subject: Re: hoe to alter @INC?
Message-Id: <Pine.LNX.4.21.0010121136220.19963-100000@hawk.ce.mediaone.net>

On Thu, 12 Oct 2000, Jim Mauldin quoth:

JM> "Andrew N. McGuire" wrote:
JM> > 
JM> > On Thu, 12 Oct 2000, Jim Mauldin quoth:
JM> > 
JM> > JM> cen09220 wrote:
JM> > JM> >
JM> > JM> > Rafael Garcia-Suarez wrote:
JM> > JM> > >
JM> > JM> > > Werner, Wolfgang wrote in comp.lang.perl.misc:
JM> > JM> > > >hi,
JM> > JM> > > >how can i change @INC?
JM> > JM> > > >i wan to have a new dir for modules
JM> > JM> > > >thans
JM> > JM> > >
JM> > JM> > > The preferred way to do this is to add at the beggining of your scripts:
JM> > JM> > >   use lib '/new/dir/for/modules';
JM> > JM> >
JM> > JM> > Why is that better than pushing the path onto @INC?
JM> > JM>
JM> > JM> Modules specified by a 'use' declaration are loaded during compilation,
JM> > JM> before the program begins to execute.  So even if you push something
JM> > JM> onto @INC as the very first statement of your program, it's already too
JM> > JM> late.
JM> > 
JM> > That is not true, IIRC, you can unshift the directory onto @INC in a
JM> > BEGIN {} block to achieve the same effect.

JM> Your statement is probably better written as "true unless you unshift
JM> the directory into a BEGIN block".  But use lib has other advantages as
JM> well, including simplicity.

I think my statement is clear as written, how do you unshift a directory
( or list of strings that represents a list of directories ) into a BEGIN 
block?  The first argument to unshift is an array, not a block.  I am
aware of the other advantages of 'use lib', but the advantage you pointed
out, is not a valid one, I am afraid. :-)

Best Regards,

anm
-- 
perl -lwMstrict -e ' # Jim Menard -> Wyzelli -> Andrew McGuire
for$;(reverse++$|..100){$:=$;==$|?q++:"s";$@="bottle";$_=(q\e\x2)."l"x2**1
;m?(..)$?,;$$=" on";print$;=>v32,"$@$:".v32,"of b$`r".$$." th$`\b wa$1,"=>
v10."$; $@$: of b$`r,\012tak$`\b$$"."e down, pass it around,",q&&;$;--;$:=
$;==$|?$!:q-s-=>;print"$; $@$:$$\bf b$`r",$$." the wa$1\n"}print q#*burp*#
'



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

Date: Thu, 12 Oct 2000 17:00:33 GMT
From: David Steuber <nospam@david-steuber.com>
Subject: Re: hoe to alter @INC?
Message-Id: <m3r95mc7v3.fsf@solo.david-steuber.com>

Jeff Pinyan <jeffp@crusoe.net> writes:

' It's 12 less characters, man!  *12*

It would really suck to run out of characters just before you finish
your program!

-- 
David Steuber | Perl apprentice, Apache/mod_perl user,
NRA Member    | and general Internet web wannabe.
ICQ# 91465842
***         http://www.david-steuber.com/          ***


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

Date: 12 Oct 2000 18:27:26 +0100
From: nobull@mail.com
Subject: Re: How can I add 5 hours to the time my server reports?
Message-Id: <u966my0y2p.fsf@wcl-l.bham.ac.uk>

"Ben Graves" <ben.graves@virgin.net> writes:

> How do I add five hours to the time it reports in a way that also changes
> the date?

Set $ENV{TZ} to the appropriate zone before calling localtime().
Details of the syntax/semantics of $ENV{TZ} are OS dependant but
you'll probably find 'GMT0BST' works for the UK timezone.

> I would like it to display the date in the following format;
> Mon 5th September, 2000

See the discussion of time formating in perldoc -f localtime 

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Thu, 12 Oct 2000 16:06:33 GMT
From: snakedjip@yahoo.com
Subject: How to get calling module/script inside a module...
Message-Id: <8s4ni2$kkl$1@nnrp1.deja.com>

Let's say I have a module "x.pm" that does something.

Now, let's say I have a script "x.pl" that uses "x.pm" :

#!/usr/bin/perl
use x;
my $x = new x;
my $result = $x->some_method();


Is there a way for "x.pm" to KNOW that the calling module is "x.pl" ?

Thanks.


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


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

Date: 12 Oct 2000 11:29:39 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: How to get calling module/script inside a module...
Message-Id: <87y9zudnv0.fsf@limey.hpcc.uh.edu>

>> On Thu, 12 Oct 2000 16:06:33 GMT,
>> snakedjip@yahoo.com said:

> Let's say I have a module "x.pm" that does something.
> Now, let's say I have a script "x.pl" that uses "x.pm" :

> #!/usr/bin/perl use x; my $x = new x; my $result =
> $x->some_method();

> Is there a way for "x.pm" to KNOW that the calling
> module is "x.pl" ?

"perldoc -f caller"

hth
t
-- 
Eih bennek, eih blavek.


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

Date: Thu, 12 Oct 2000 17:06:34 GMT
From: David Steuber <nospam@david-steuber.com>
Subject: Re: How to read EMail  address of user(CGI)
Message-Id: <m3n1gac7l1.fsf@solo.david-steuber.com>

How many times will this question be posted?  I've seen it four times
now.  *Four*.

The code for Melisa is still out there.  Put the appropriate VBScript
in your web page, and have people who use Outlook and Internet
Exlpoder mail you their entire address book so that you can spam them.

<watches slow trickle of web hits come to a complete halt>

-- 
David Steuber | Perl apprentice, Apache/mod_perl user,
NRA Member    | and general Internet web wannabe.
ICQ# 91465842
***         http://www.david-steuber.com/          ***


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

Date: 12 Oct 2000 17:53:02 +0100
From: nobull@mail.com
Subject: Re: How to read EMail  address of user(CGI)
Message-Id: <u97l7e0zo1.fsf@wcl-l.bham.ac.uk>

"Pliev" <pliev@cityline.ru> writes:

> Hello!
> I have web-site and am creating scripts for it.
> Tell me please, how I can to know,using CGI,  the E-Mail address of user,
> which has come to my  page?
> On my page is form, which must send users's text on my E-mail. May be I must
> to analyse %ENV ?

If the user has chosen to include their email address in their HTTP
requests then it can be found in $ENV{HTTP_FROM} which will have the
same format as an e-mail From header.

In practice nobody does this[1] indeed I don't think that (m)any of
the popular user agents even give them the option.

[1] The exception to this rule is web robots.  Web robots often do
include the e-mail address of the robot's owner so that if a robot
goes wild and hits a website unreasonably often the webmaster can
contact the botkeeper and get the problem sorted.

> Or to use JavaScript?

Yes, on some early JavaScript web clients there was a security hole
that allowed you to obtain the users email address without their
conscent.  You could also get it by using mailto: URLs in the ACTION
of a from.

This has nothing to do with Perl and these security holes have mostly
been plugged.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Thu, 12 Oct 2000 16:25:07 GMT
From: esper@news.visi.com (Dave Sherohman)
Subject: Re: Invoking ssh from a script
Message-Id: <slrn8ubpf3.7hb.esper@pchan.dojo>

On Thu, 12 Oct 2000 14:16:20 GMT, NP <nvp@spamnothanks.speakeasy.org> wrote:
> Since Expect.pm supports '-re', you should be able to match what the
> remote host is sending you with a regex[p].

Call me crazy, but a continual 'expect newline, inspect text before the
match' seems to defeat expect's purpose...

(OK, it's not _that_ bad.  However, IPC::Session has a nice method for
determining the response from commands which doesn't depend on knowing
anything about the other end's prompt.  In the basic case, its usage is
just

$errno = $session->send($command);
print $session->stdout();

It seems a lot more straightforward than expect for dealing with remote shell
sessions, the only problem is that nasty limitation of not being able to
handle interactive terminal-based logins.)

> Basically, what you're proposing will likely raise the same issues no
> matter which method you use.

My gut feel is that it's cleaner to say, 'give me a line, any line' and then
inspect it rather than trying to specify what all potentially interesting
responses might look like and waiting until one of them is received.

Another issue that turned up last night while I was trying to find
information on dealing directly with ptys is that linux (the target system)
supports a maximum of 256 ptys.  I have to be able to support "on the order
of" 100 open sessions at a time.  With 2 ptys (1 master, 1 slave) per
session, Expect.pm will hit a limit of 128 open sessions, even if nothing
else is using any ptys (and what are the odds of that?).  I haven't looked
into it closely enough to know yet, but, if it's possible to just use a pty
for the login sequence and then switch to file descriptors after that, this
limit goes away.  (I know fds work for talking to an open ssh session, but I
don't know whether the session, after logging in, could be readily
dissociated from the pty.)

> Or, you could just use chatX.pl or Comm.pl. :-)

Actually, I made some halfhearted attempts to find them last night in hopes
that their source might be a bit clearer than Expect.pm's, but came up empty.
I'll have to try harder today...

> Seriously, I'd suggest
> reviewing both the Expect.pm doc and examples AND the documentation for
> the Tcl-based Expect product.  That should really clear things up for
> you.

I'll take a look at the tcl-expect stuff, but, again, I think that the expect
model is itself overgeneral and requires the caller to be overspecific for my
taste.  And there's still that limit on available ptys.

-- 
"Two words: Windows survives." - Craig Mundie, Microsoft senior strategist
"So does syphillis. Good thing we have penicillin." - Matthew Alton
Geek Code 3.1:  GCS d- s+: a- C++ UL++$ P+>+++ L+++>++++ E- W--(++) N+ o+
!K w---$ O M- V? PS+ PE Y+ PGP t 5++ X+ R++ tv b+ DI++++ D G e* h+ r++ y+


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

Date: Thu, 12 Oct 2000 17:16:57 GMT
From: David Steuber <nospam@david-steuber.com>
Subject: Re: is there a better way to do this?
Message-Id: <m3hf6ic73r.fsf@solo.david-steuber.com>

"Godzilla!" <godzilla@stomp.stomp.tokyo> writes:

' A better way to do what? A better way to pick your
' toes? A better way to flick sticky boogers?

What is your problem?  You really need to relax, big time.

-- 
David Steuber | Perl apprentice, Apache/mod_perl user,
NRA Member    | and general Internet web wannabe.
ICQ# 91465842
***         http://www.david-steuber.com/          ***


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

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


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