[9304] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2899 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 18 10:18:40 1998

Date: Thu, 18 Jun 98 07:00:31 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 18 Jun 1998     Volume: 8 Number: 2899

Today's topics:
    Re: 2D arrays (Mike Stok)
    Re: Bug?  Why is this... (John Klassa)
    Re: Duplicate emails with sendmail!  hmm, how about a t (Gabor)
    Re: Duplicate emails with sendmail! <quednauf@nortel.co.uk>
    Re: Excel - Perl conversion (Alexander Farber)
    Re: formline and predefined formats (Kevin Reid)
    Re: gurusamy vs activeware perl nt (Patrick Timmins)
    Re: htpasswd in perl? <mortensi@idt.ntnu.no>
    Re: htpasswd in perl? <merlyn@stonehenge.com>
    Re: I need help with my ^M problem. (Tad McClellan)
        Moving application from DOS to a GUI. <dsheets@glue.umd.edu>
    Re: perl command line options <norman.bunn@mci.com>
    Re: Perlscript Problem <msergeant@ndirect.co.uk>
    Re: print <<END (with variables) (Kevin Reid)
        Question concerning the use of Net::FTP <rainer@demag.rwth-aachen.de>
    Re: REVIEW: Perl CGI Programming - No Experience Requir (Chris Nandor)
    Re: REVIEW: Perl CGI Programming - No Experience Requir (Chris Nandor)
        Search a file on a unix system. <stijf@hotmail.com>
    Re: Search a file on a unix system. <mortensi@idt.ntnu.no>
        Socket problem in perl CGI program, help please <yanbo@softfoundry.com>
    Re: subroutines <barnett@houston.Geco-Prakla.slb.com>
        Tricky exporter problem <msergeant@ndirect.co.uk>
    Re: Tricky exporter problem <msergeant@ndirect.co.uk>
    Re: Windows95, Perl-32 and Personal Web Server (PWS) <heribert.wettels@sueddeutsche.de>
        wrap() (Glen)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 18 Jun 1998 12:55:05 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: 2D arrays
Message-Id: <6mb2n9$4cs@news-central.tiac.net>

In article <01bd9a8f$58d1fec0$26c809c0@internet>,
Thomas Mclaughlin <it.sllas@btinternet.com> wrote:
>I have been looking thru the "Learning Perl" book on arrays but cannot find
>2D arrays. I am a perl newbie and want to use a 2D array like in C (it has
>been a few 
>years since I wrote any C code and now write shell scripts). I want to
>write a perl
>prog to calculate the size of an Informix database table from the following
>format:

You probably want to look at the perllol (lists of lists) and perldsc
(data structures cookbook) man pages which come with recent perl
distributions.  You can use the perldoc command to view them:

  perldoc perllol

If there's anything which you want to know which isn't covered in tho
supplied documentation (including the frequently asked questions and their
answers - perlfaq) then you might post a question asking about it.

If you don't have the docs on line then you might look at
http://www.perl.com/CPAN-local/doc/manual/html/pod/index.html (which may
be a little old, but should tide you over until you can find more recent
versions.)

Remember that you can play with the debugger to get an idea of what's
going on, you can start the debugger using the command line

  perl -de 1

  DB<1> $struct{'Absent Lovers'}[0][3] = 'Thela Hun Ginjeet'

  DB<2> $struct{'Absent Lovers'}[0][8] = 'Three Of A Perfect Pair'

  DB<3> $struct{'Absent Lovers'}[2][1] = 'Sartori In Tangier'

  DB<4> X struct
%struct = (
   'Absent Lovers' => ARRAY(0x14019fb08)
      0  ARRAY(0x14019fb38)
         0  undef
         1  undef
         2  undef
         3  'Thela Hun Ginjeet'
         4  undef
         5  undef
         6  undef
         7  undef
         8  'Three Of A Perfect Pair'
      1  undef
      2  ARRAY(0x14019bd68)
         0  undef
         1  'Sartori In Tangier'
)

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: 18 Jun 1998 12:20:39 GMT
From: klassa@aursgh.aur.alcatel.com (John Klassa)
Subject: Re: Bug?  Why is this...
Message-Id: <6mb0mn$66q$1@aurwww.aur.alcatel.com>

On 15 Jun 1998 01:42:48 GMT, Mike Stok <mike@stok.co.uk> wrote:
->Split uses its first argument as a regex (except for the special ' '
->case).  The single quoted string \t is 2 characters </> and <t>, the regex
->engine knows that these represent a tab and acts accordingly.   If you had
->used double quotes then the \t would have been turned into a tab by
->the quotes and passed into the regex engine as a single character.

Correct me if I'm wrong, but isn't the end result the same in either case?
That is, the regex engine looks for a tab, on which the "split" splits (so
to speak)...

-- 
John Klassa / Alcatel Telecom / Raleigh, NC, USA <><


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

Date: 18 Jun 1998 12:12:31 GMT
From: gabor@vmunix.com (Gabor)
Subject: Re: Duplicate emails with sendmail!  hmm, how about a triplicate
Message-Id: <slrn6oi11e.qi3.gabor@localhost.vmunix.com>

# On Thu, 18 Jun 1998 ajm@antopia.com wrote:
# 
# Help!  I'm having a problem with sendmail.

Help!  I've fallen and can't get up.


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

Date: Thu, 18 Jun 1998 13:38:35 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: Duplicate emails with sendmail!
Message-Id: <35890A4B.6565E006@nortel.co.uk>

Abigail wrote:
> 
> ajm@antopia.com (ajm@antopia.com) wrote on MDCCLII September MCMXCIII in
> <URL: news:6ma6ff$r8h$1@nnrp1.dejanews.com>:
> ++ Help!  I'm having a problem with sendmail.

 ...and two
days ago for no apparent reason all calls to sendmail have started generating
and sending two identical duplicate emails!...

Are you suggesting that Perl mutates your script? Or that Perl itself mutates?
(i.e. doubles its function by splitting its genes and copying them?). Aren't you
stating yourself that this is quite probably a sendmail problem, if you didn't
change your script and your Perl interpreter?

> 
> Help! I'm having a problem with my goldfish. I tought, comp.lang.perl.misc
> must be the perfect place to ask, because I keep my Perl books 2 shelves
> above the aquarium, and once one of the books fell in the water!!!!!!!!!

Oh dear, now your Goldfish is probably eating EVERYTHING and pooing complex
strings full of cryptic messages. Consider storing the books UNDER the Aquarium.
This will stop your Goldfish from being so darn intelligent!

-- 
____________________________________________________________
Frank Quednau               
http://www.surrey.ac.uk/~me51fq
________________________________________________


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

Date: 18 Jun 1998 12:02:52 GMT
From: eedalf@eed.ericsson.se (Alexander Farber)
Subject: Re: Excel - Perl conversion
Message-Id: <6mavlc$2do20@aken.eed.ericsson.se>

In article <6m9tqv$j2e$2@comdyn.comdyn.com.au>, Martien Verbruggen writes:
> In article <6m9lob$48m$1@nnrp1.dejanews.com>,
> 	Juli@my-dejanews.com writes:
> > I am looking for a script that will convert excel into perl.
> 
> Euhm.. How do you imagine that? Excel is a spreadsheet program, and
> Perl is a programming language. It's like asking for a tire that will
> convert your chair into a banana.

Hi,

i think there's no such script yet. But maybe Laola can help - 
see http://wwwwbs.cs.tu-berlin.de/~schwartz/pmh/index.html

/Alex





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

Date: Thu, 18 Jun 1998 08:35:08 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: formline and predefined formats
Message-Id: <1das3ds.164mxf2snwqncN@slip166-72-108-99.ny.us.ibm.net>

Mark Evan Jones <markjones@mindless.com> wrote:

> I'm asking because I have several formats that I occasionally want to
> use without writing to a file, and which very well could change.  If
> they do change, I don't want to have to hunt down all the places the
> picture appears (though that shouldn't be all that many places, it would
> still be daunting for someone else to find).  Is there another way I can
> accomplish this without writing to a temp file (eew)?

How about using write(STDOUT)?

-- 
  Kevin Reid.      |         Macintosh.
   "I'm me."       |      Think different.


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

Date: Thu, 18 Jun 1998 13:32:53 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: gurusamy vs activeware perl nt
Message-Id: <6mb4u5$aft$1@nnrp1.dejanews.com>

In article <3588e00b.0@news.lamine.com>,
  "no" <no@no.no> wrote:
[snip]
> Before i use only gurusamy perl, i want to test it on my web server without
> danger on a copy of cgi perl, is it possible use activeware perl with
> actually cgi perl and gurusamy perl with a copy of cgi perl to test if it's
> ok. on perl the first line is
> "#!/usr/bin/perl" how to say this perl use activeware and this use gurusamy
> perl.
>
> How use extension .cgi instead of .pl for my perl cgi, i search in registry
> but i don't find any trace of the install gurusamy perl, when i launch a cgi
> perl toto.cgi i have the response "HTTP/1.0 501".
>

I've had different ports of Perl on the same Win95 machine at one time
(Gurusamy and ActiveWare). I just installed them in different base
directories, then associated files with '.cgi' extensions to the ActiveWare
Perl, and files with '.pl' extensions to Gurusamy's Perl. Depending on your
httpd daemon, this may or may not work.

Hope this helps.

Patrick Timmins
U. Nebraska Medical Center

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 18 Jun 1998 12:47:06 GMT
From: Morten Simonsen <mortensi@idt.ntnu.no>
Subject: Re: htpasswd in perl?
Message-Id: <6mb28a$1i0$2@due.unit.no>

> I think  Dr. DiVerdi owes Mr  Schwartz at least an expleantion.

I think someone is taking this a little too serious. Not everybody
knows the Perl gurus, and if he really was offended (why should he?)
by this, I am pretty sure that he could speak for himself. And if not
Randal Schwartz needed the Perl-lesson (who knows, maybe he had
forgotton that stuff:-)), maybe some other did..

Morten Simonsen


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

Date: Thu, 18 Jun 1998 13:49:53 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: htpasswd in perl?
Message-Id: <8cu35iddl6.fsf@gadget.cscaper.com>

>>>>> "Morten" == Morten Simonsen <mortensi@idt.ntnu.no> writes:

>> I think  Dr. DiVerdi owes Mr  Schwartz at least an expleantion.
Morten> I think someone is taking this a little too serious. Not everybody
Morten> knows the Perl gurus, and if he really was offended (why should he?)
Morten> by this, I am pretty sure that he could speak for himself. And if not
Morten> Randal Schwartz needed the Perl-lesson (who knows, maybe he had
Morten> forgotton that stuff:-)), maybe some other did..

Actually, I nearly fell off my chair laughing.

I just attributed the whole thing to, well, a bad attribution. :-)

If Mr. DiVerdi didn't know who I was before the post, he's certainly
aware now.  I think he'll also pay a little closer attention to the
operation of his newsreader as well.

And yes, his code left a little to be desired, but that's often the case. :-)

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 75 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Thu, 18 Jun 1998 08:11:49 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: I need help with my ^M problem.
Message-Id: <lm3bm6.mrm.ln@localhost>

Bobby Chan (kwb_cha@alcor.concordia.ca) wrote:

:         Thank you all for the tremendous help with my ^M problem. I need
: to specially thank Bob Trieger and Ted McClellan for giving me a correct
: way of dealing with this problem. Bob suggested using s/\cM//g and Ted
: suggested using tr/\r//d. Both ways worked perfectly!


   s/Ted/Tad/g;


When you want to replace character-for-character, rather than replace
multi-char strings, you should always prefer tr/// over s///.

It's faster.


-----------------------------
#!/usr/bin/perl -w

use Benchmark;

timethese(1000000, {
    'tr///' =>     '$_="\rone\rtwo\rthree"; tr/\r//d',
    's///'  =>     '$_="\rone\rtwo\rthree"; s/\cM//g',
});
-----------------------------

Benchmark: timing 1000000 iterations of s///, tr///...
      s///: 30 secs (30.22 usr  0.00 sys = 30.22 cpu)
     tr///:  8 secs ( 9.46 usr  0.00 sys =  9.46 cpu)


See?  ;-)


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Wed, 17 Jun 1998 16:12:53 -0400
From: David Sheets <dsheets@glue.umd.edu>
Subject: Moving application from DOS to a GUI.
Message-Id: <35882345.C2464B24@glue.umd.edu>

    I am working on moving an application from a DOS/UNIX version, to a
version that uses a GUI and will run on Windows 95 and X Windows with
(hopefully) only small modifications to the code. I have been looking at
Tcl/Tk as a possible option, but it seems like there might be problems
with using that. I know nothing about either Perl or Python but after
reading through the FAQ's think I might be able to use them.
    The original program is written entirely in C, and we are hoping to
find a language that will allow us to both use our math routines as they
are now (ie, our current C code should interface with the language) and
write the GUI in a method that will be easily portable to Win95 and
X Windows.
    We mainly want a way to display some menus, call our C math
functions, and then put pixels to the screen as our math functions spit
them out. If anyone could comment on Perl, Python, Tcl, or even any
other language's usefulness for this application, it would be very
helpful in our final decision. Thank you in advance for any input.

    --David Sheets (dsheets@glue.umd.edu)



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

Date: Thu, 18 Jun 1998 12:02:27 GMT
From: "Norman Bunn" <norman.bunn@mci.com>
Subject: Re: perl command line options
Message-Id: <nl7i1.421$Ro2.491840@pm01nn>

Does NT Server 4.0 have an equivalent?

Norman

>On Wed, 17 Jun 1998, Norman Bunn wrote:
>
>> Is there anyway to tell perl from the command line not to look for input?
>
>Check your shell's documentation about redirecting input to come from
>/dev/null (or your system's equivalent).
>
>Tom Phoenix       Perl Training and Hacking       Esperanto
>Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/
>




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

Date: Thu, 18 Jun 1998 14:24:05 +0100
From: Matt Sergeant <msergeant@ndirect.co.uk>
Subject: Re: Perlscript Problem
Message-Id: <358914F5.63726A69@ndirect.co.uk>

Skrub wrote:
> 
> I know this is the Perl forum, but I couldn't find a perlscript newsgroup,
> so I hope osmeone here can help me.
> 
> I need to use perlscript in an active server page to access files on the
> server. I know it can be done with vbscript, so I hope it can be done in
> perlscript. I really don't want to have to go and learn vbscript.
> 
> If anyone knows how to do this, please e-mail me.

Read the NG if you want an answer ;-)

Check out my PerlScript FAQ. It tells you the basics. Otherwise
PerlScript is exactly the same as Perl, just open the file you want and
read it.

http://www.geocities.com/SiliconValley/Way/6278/perl.html

-- 
<Matt/>


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

Date: Thu, 18 Jun 1998 08:35:11 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: print <<END (with variables)
Message-Id: <1das3gw.u7490f17887o7N@slip166-72-108-99.ny.us.ibm.net>

Alex Barilo <hash@email.infotrade.co.uk> wrote:

> THANX, Eric! It is exactly what I need. But I have a question again:
> it works perfectly fine if I use:
> @{[my_func]}  or
> @{[my_func()]}        or
> ${[my_func]}[0]
> 
> but it doesn't work here:
> 
> #!/usr/local/bin/perl -w
> sub big_test { return 555 }
> print <<"EOT";
>   ${big_test}                 # Use of uninitialized value
The variable named $big_test.
>   ${&big_test}                        # Use of uninitialized value
The variable named $555.
>   ${big_test()}                       # Use of uninitialized value
Ditto.
>   ${&big_test()}              # Use of uninitialized value
Ditto.
>   ${main::big_test()}         # Use of uninitialized value
Ditto.
>   ${&main::big_test()}                # Use of uninitialized value
Ditto.
>   &{main::big_test()}         # just prints '&{main::big_test()}'
& is not interpolated.
>   ${&{main::big_test()}}      # (!) Undefined subroutine &main::555
The variable named by the return value of the subroutine named by the
return value of main::big_test()
> EOT
> 
> why do I need it to get it as anonymous array? Please note the last
> line -- something interesting is going on. Can someone explain this
> please.

Inside of the braces, it expects a reference to a scalar. All of the
things you are giving it are treated as symbolic references.

-- 
  Kevin Reid.      |         Macintosh.
   "I'm me."       |      Think different.


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

Date: Thu, 18 Jun 1998 15:15:25 +0200
From: Rainer Finocchiaro <rainer@demag.rwth-aachen.de>
Subject: Question concerning the use of Net::FTP
Message-Id: <358912ED.5FD998F3@demag.rwth-aachen.de>

Hi all,

I want to upload a file to the cgidir of a remote Webserver AND make it
executable.

No problem with the upload, works flawlessly, but I can't seem to figure
out how to set the file to another mode like rwxr-x-r-x. I tried the
following

my $ftp = new Net::FTP($ip) || &io_error("Cannot connect to $ip");
$ftp->login($login, $pass);
$ftp->type("binary");
$ftp->mkdir(dirname($dest_file),true);
$ftp->put($source, $dest_file);
$mode = 0755;
$ftp->quot(chmod $mode $dest_file);
 ...

and

$ftp->command(CHMOD, $mode, $dest_file);
 ...

but everything had no effect. I have no idea how to continue and would
appreciate any help.

Thanks in advance

Rainer
-- 
Rainer Finocchiaro
Hainbuchenstr. 2
52072 Aachen
Deutschland

Email: rainer@demag.rwth-aachen.de
Talk: rainer@vanadium.demag.rwth-aachen.de


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

Date: Thu, 18 Jun 1998 12:10:08 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: REVIEW: Perl CGI Programming - No Experience Required
Message-Id: <pudge-1806980807220001@dynamic162.ply.adelphia.net>

In article <6m9de2$man$1@cyprus.atlantic.net>, chip@mail.atlantic.net
(Chip Salzenberg) wrote:

# According to c.c.eiftj@54.usenet.us.com (Rahul Dhesi):
# >In <pudge-1406982115300001@192.168.0.3> pudge@pobox.com (Chris Nandor)
writes:
# >>Here we put a subscript on the contents of `perl -v`, split that line into
# >>a list, and subscript that list, and neither is an array.
# >
# >By my definition it is.
# 
# "... but if you define 'religious' as 'liking peanut butter and jelly
# sandwiches', then -- Yes, I'm a religious person." -- Emo Phillips

And if you define "free" as "provided with ketchup", then yes, that burger
is free.

Whoops ... hit cancel, hit canc--

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


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

Date: Thu, 18 Jun 1998 12:11:45 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: REVIEW: Perl CGI Programming - No Experience Required
Message-Id: <pudge-1806980808590001@dynamic162.ply.adelphia.net>

In article <6m9ni8$dut$1@samba.rahul.net>, c.c.eiftj@54.usenet.us.com
(Rahul Dhesi) wrote:

# But this doesn't help at all!  How can a programmer looking at some
# lines of perl decide how they would be rpresented internally within the
# perl interpreter?

Killfiled, for my own sanity; I suggest other do likewise.

* ^Pudge ponders killfiling himself ...

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


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

Date: Thu, 18 Jun 1998 14:14:40 +0200
From: Steve <stijf@hotmail.com>
Subject: Search a file on a unix system.
Message-Id: <358904B0.11B5@hotmail.com>

Hi Everyone!

I'm sorry that this isn't the correct newsgroup to post this message.
But on the other newsgroups I've had no response.

Does anyone know how I can search for a file?
If I'm in the root and I want to search for a file in a subdirectories
what command do I give??

Thanks!


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

Date: 18 Jun 1998 12:29:20 GMT
From: Morten Simonsen <mortensi@idt.ntnu.no>
Subject: Re: Search a file on a unix system.
Message-Id: <6mb170$1i0$1@due.unit.no>

Steve <stijf@hotmail.com> wrote:
> Hi Everyone!

> I'm sorry that this isn't the correct newsgroup to post this message.
> But on the other newsgroups I've had no response.

> Does anyone know how I can search for a file?
> If I'm in the root and I want to search for a file in a subdirectories
> what command do I give??

If you're in a UNIX-filesystem (includes Linux) you should type:

find . -name "the_name_of_the_file"

If you're in a Windows OS then I guess this is no problem (using the
find-tool).

Morten Simonsen


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

Date: 18 Jun 1998 13:32:56 GMT
From: "Yanbo Wang" <yanbo@softfoundry.com>
Subject: Socket problem in perl CGI program, help please
Message-Id: <01bd9abd$4847bf80$026464c0@wyb.straitcom>

Hello, everybody, I have met a problem and need your help, this is
my cgi program:(I add the line number to explain it clearly)
 .....
1 &ReadParse(*input);
2 ($user, $host) = split(/\@/, $input{'address'});
3 $iaddr   = inet_aton($host) || return(-101);
4 $paddr   = sockaddr_in(25, $iaddr);
5 $proto   = getprotobyname('tcp');
6 socket(SOCK, PF_INET, SOCK_STREAM, $proto) || return(-101);
7 connect(SOCK, $paddr) || return(-101);
8 }                

 ...
the user will input a email address from a html form,
and it stored in $input{'address'};
I have done some debug, and no problem with $user and $host,
but the program halt when excute line 7:
connect (SOCK, $paddr) || return(-101);
and it even didn't return the value(-101);

but If I add a line before line 2 just like this:
$address = "khongliu\@nease.net";
every runs ok, I have tried a lot of method, but can't resolve
the problem yet. please help.
Thank you.

I don't come here often, please email me to: khongliu@nease.net
your help will be appreciated greatly!


flae





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

Date: Thu, 18 Jun 1998 08:18:53 -0500
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
To: Inge Soetens <soetensi@se.bel.alcatel.be>
Subject: Re: subroutines
Message-Id: <358913BD.4A7A5C95@houston.Geco-Prakla.slb.com>

[courtesy cc to cited author]

Inge Soetens wrote:
> 
> Hi ,
> 
> one of the subroutines I made is needed in several perl scripts.
> Is it possible to put subroutines in separate files
> and then include them in different perl scripts afterwards ?
Sure.  They're called Modules.

> If so, what is the syntax to include and use them ?
Have a look at any of the installed Modules (/usr/local/lib/perl5 in my
case).  They will provide a useful template.

For details on creating/modifying modules yourself, see:
perldoc perlmod
'Blue Camel'
perldoc -f use
perldoc -f require


> I tried use and import, but either these are the wrong commands,
> or what I'm is completely wrong.
> 
> Can somebody help me ?
Once you've reviewed the above, try to create one.  If you have more
problems, please post again, making sure to include some code snippets
that exhibit the problem you're having.


> Thanks
'Forget about it.'

Dave

-- 
"Security through obscurity is no security at all."
		-comp.lang.perl.misc newsgroup posting

----------------------------------------------------------------------
Dave Barnett                 U.S.: barnett@houston.Geco-Prakla.slb.com
DAPD Software Support Eng    U.K.: barnett@gatwick.Geco-Prakla.slb.com
----------------------------------------------------------------------


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

Date: Thu, 18 Jun 1998 14:31:44 +0100
From: Matt Sergeant <msergeant@ndirect.co.uk>
Subject: Tricky exporter problem
Message-Id: <358916C0.3D069E56@ndirect.co.uk>

I'm trying to add to my Perl module to allow users to write PerlScript
(MS Active Server Pages) code that's "strict". The current problem is
that when you "use strict" in a PerlScript ASP the compiler barfs when
it sees a $Response or other variable that is magically defined by the
scripting engine.

My solution was to try changing the header of my ASP module to say:

%EXPORT_TAGS =	( 'strict' => [qw(
			$Application
			$ObjectContext
			$Request
			$Response
			$Server
			$Session
			)]
		);
Exporter::export_ok_tags('strict');

$Application = $main::Application;
$ObjectContext = $main::ObjectContext;
$Request = $main::Request;
$Response = $main::Response;
$Server = $main::Server;
$Session = $main::Session;

=======

But this doesn't work - I assume it's because when included in a script
there is some sort of conflict between exporting these objects (into the
main:: namespace) and assigning to them from that namespace. So the
question is, can I get around this (preferably without renaming the
variables!).

-- 
<Matt/>


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

Date: Thu, 18 Jun 1998 14:50:32 +0100
From: Matt Sergeant <msergeant@ndirect.co.uk>
Subject: Re: Tricky exporter problem
Message-Id: <35891B28.546989E3@ndirect.co.uk>

Don't worry - fixed it myself (should have spent some more time on it b4
posting! ;-)

Matt Sergeant wrote:
[stuff about perlscript and exported vars]

-- 
<Matt/>


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

Date: Thu, 18 Jun 1998 15:12:46 +0200
From: Heribert Wettels <heribert.wettels@sueddeutsche.de>
Subject: Re: Windows95, Perl-32 and Personal Web Server (PWS)
Message-Id: <3589124E.C941E04E@sueddeutsche.de>

I also experienced problems with the PWS from "The Evil Empire" and just
installed OmniHTTPD which turned out to work much better. It's freeware and
can be downloaded from http://www.fas.harvard.edu/~glau/httpd/

Heribert


Pete Sattler wrote:

> > I am trying to set-up an environment on Windows 95 for developing web
> > applications.  I have installed ActiveState's Perl for Win32 (build 316)
> > along with Microsoft's personal web server (PWS).  I'm finding that
> anytime
> > I try to make a call using system() or backticks PWS hangs.  I've found
> > some recent postings in this newsgroup that discussed the lack of
> > intelligence in the standard Windows command shell (command.com).  I
> > installed the more intelligent 4DOS shell from JP Software, but I have
> been
> > unable to correct the problem.
> >
> See http://support.microsoft.com/support/kb/articles/q156/7/55.asp for
> Microsoft's "official" resolution, which didn't seem to work for Win95.
>
> > Has anyone else been able to successfully implement this environment?
> Any
> > help is greatly appreciated!
> >
> > Pete Sattler
> > Chase Manhattan Bank
> >





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

Date: Thu, 18 Jun 1998 12:39:23 GMT
From: glen@perfectday.com (Glen)
Subject: wrap()
Message-Id: <35890a13.15844534@news.easynet.co.uk>

Has anyone used wrap() ?

I'm trying to perform the following to send an email, and wrapping
long lines, but I just get no message contents being sent as a result
of the print.

print MAIL wrap("","",$string);

Glen.


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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.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 2899
**************************************

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