[13845] in Perl-Users-Digest
Perl-Users Digest, Issue: 1255 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 2 15:05:58 1999
Date: Tue, 2 Nov 1999 12:05:17 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <941573116-v9-i1255@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 2 Nov 1999 Volume: 9 Number: 1255
Today's topics:
Re: Another 'or'? was [perl double-split] (Ilya Zakharevich)
Re: C++ and embedded perl <davidrankin@worldnet.att.net>
Re: Can this be made faster? <aqumsieh@matrox.com>
Re: CGI Programming in C/C++ HELP! <joseph_vanquakebeke@adc.com>
Re: Change group permissions to match user permissions (Greg Snow)
Re: comparing text with words <aqumsieh@matrox.com>
Re: comparing text with words <aqumsieh@matrox.com>
Re: comparing text with words <jeffp@crusoe.net>
Re: comparing text with words <lr@hpl.hp.com>
Re: Cookies ? <rootbeer@redcat.com>
Database script help (Jim)
Determining Open Mode <james.p.williams@usahq.unitedspacealliance.com>
dirty textfiles <nfy339g@tninet.se>
Re: Error: Can't do setuid <rootbeer@redcat.com>
Re: Extracting just the date from a string <jeffp@crusoe.net>
Formatting a Date Properly reedjd@bitsmart.com
Re: Formatting a Date Properly <msalter@bestweb.net>
Re: Formatting a Date Properly <jeffp@crusoe.net>
Re: How can I store/print a variable containing a DISPL <rootbeer@redcat.com>
How do I create a library file of subroutines? (Eric Dew)
Re: How do I create a library file of subroutines? <dchristensen@california.com>
Re: Including modules directly in a script <send@no.junk.mail>
Re: Including modules directly in a script (T. Yamada)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 2 Nov 1999 19:55:25 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Another 'or'? was [perl double-split]
Message-Id: <7vnfjd$mv4$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to Abigail
<abigail@delanet.com>],
who wrote in article <slrn81tqfl.ren.abigail@alexandra.delanet.com>:
> With Sarathy against, backed by some prominent p5p-ers, extremely unlikely
> it will happen anytime soon - no matter how many people really want this.
There is no rule that Sarathy is allowed to change his opinion. But
if he does, we can forgive him nevertheless, right?
Ilya
------------------------------
Date: Tue, 2 Nov 1999 12:04:37 -0500
From: "David Rankin" <davidrankin@worldnet.att.net>
Subject: Re: C++ and embedded perl
Message-Id: <7vn63q$8h$1@bgtnsc01.worldnet.att.net>
The only language that I am aware of that will interface with C or C++ is
assembly via the asm keyword. The way it works is to invoke the assembly
compliler like this:
asm{
// assembly instruction sequence
}
or
asm single instruction;
Angel Kypriotis <kypriot@algo.com.gr> wrote in message
news:7vmg8a$302g$1@ulysses.noc.ntua.gr...
> Greetings,
>
> I have created a C++ class. Its methods are implemented as Perl
subroutines
> residing in a module. My system is a Sun Sparc Ultra with Solaris 2.6. In
my
> driver program I try to call the Perl subs through the C++ class object
but
> I get an error message about undefined Perl subroutines called.Am I right
to
> assume that the Perl module is probably not parsed? If yes, how can I
> use/require a module in my C++ driver program? Note that in order to use
C++
> i compile everything with g++ 2.8.1, and the perl dist. was precompiled
with
> gcc. I have read in perlembed that one must compile the programs the way
> perl itself was compiled, but I want to use C++. I changed slightly the
> build script in the ExtUtils::Embed module, however I don't know if I'm
> doing it right.
> I built my class along with my driver program on a Linux box also the same
> way, but I got the same dissapointing results. My program either cannot
> find the module which contains the Perl sub called or it terminates with a
> segfault error.
>
> Any ideas would be appreciated, because it's demo-time and time is running
> out
>
> Thanks in advance
>
> Angel Kypriotis
> Algosystems S.A.
> email: kypriot@algo.com.gr
>
>
>
------------------------------
Date: Tue, 2 Nov 1999 10:04:22 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Can this be made faster?
Message-Id: <x3ybt9dsznu.fsf@tigre.matrox.com>
"PB" <22pb22@excite.com> writes:
> Interesting ....
>
> I put a
> $start = (times)[0];
> and a
> $end = (times)[0];
> $total_time = $end - $start;
>
> before and after the while{...} in order to record the execution in CPU
> seconds for all the different approaches mentioned in this threat, on about
> 100MB of text files, and these are the results:
The Benchmark module is much more accurate, but this should give you a
good indication.
> INITIAL WAY (PB):
>
> my $count = 0;
> while (@line = <FILE>) {
> foreach $line (@line){
> if ($line =~ /\s$string\s/oi) {$count++;}
> }
>
> $count: 5423 (hits on $string)
> Execution time: 0.782 seconds
>
>
>
> Ala Qumsieh <qumsieh@sympatico.ca> proposal:
>
> my $count = 0;
> for my $file (@files) {
> open F, $file or die $!;
> while (<F>) {
> $count += () = /(\s$string\s)/goi;
> }
> close F or die $!;
> }
>
> $count: 8
> Execution time: 0.016 seconds
The tiny count and small execution time bother me. Something has to be
wrong. Did you cut & paste the code?
> Kragen Sitaker <kragen@dnaco.net> proposal:
>
> #!/usr/bin/perl -w
> use strict; my $string = 'you'; my @files = @ARGV;
> my $count = 0;
> for my $file (@files) {
> open F, "<$file" or die "Opening $file: $!\n";
> $_ = do {local $/; <F>};
> $count += () = /^.*\s$string\s.*$/goim;
> }
> print "count: $count\n";
>
>
> $count: 5423
> Execution time: 2.172 seconds
>
>
> ==============
>
>
> Kragen's and my approach returned the same number of "hits", even though the
> originally proposed approach took considerably less time than Kragen's
> paragraph mode approach. Ala's way didn't even return the real number of
> hits.
This is strange. I believe you have made some error as $count in my
approach should have been at least as large as the others, if not
larger. What exactly is $string? Does it contain any special chars?
I tested the 3 snippets on some sample data, and it works as I
expected.
> I'm not sure if I did this correctly or not since my 'perlish' ways leaves
> some to be desired. If you would like to test this yourselves you can get
> the full script from http://www.perl-ntadmins.com. It's called LOGSTAT.PL
I can't make out anything useful from your script since $string is
passed from the command line.
> Thanks for your input and if you have any suggestions or comments I would
> love to hear them.
Show us $string, and part of the datafile that is supposed to
match and we'll take it from there.
--Ala
------------------------------
Date: Tue, 02 Nov 1999 13:18:33 -0600
From: Joseph Vanquakebeke <joseph_vanquakebeke@adc.com>
Subject: Re: CGI Programming in C/C++ HELP!
Message-Id: <381F3909.EFC53BB7@adc.com>
This is a multi-part message in MIME format.
--------------AFD0A05DAFC39DF2C3718E4D
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
You should check out O'Rielly the web eite is www.oreilly.com the have a
book called CGI Programming on the World Wide Web. ISBN 1-56592-168-2 They
also have a wide assortment of books on PERL.
Good Luck
Joseph
doncho wrote:
> I am currently learning CGI programming. Actually, I am not familiar with
> Perl or other languages instead of C/C++. Are there any sites, books, or
> references to learn CGI programming in C/C++, please help me.
> Thank you.
--
Joseph A. Van Quakebeke
x4215
You don't win silver, you lose gold.
--------------AFD0A05DAFC39DF2C3718E4D
Content-Type: text/x-vcard; charset=us-ascii;
name="joseph_vanquakebeke.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Joseph Vanquakebeke
Content-Disposition: attachment;
filename="joseph_vanquakebeke.vcf"
begin:vcard
n:Van Quakebeek;Joseph
x-mozilla-html:TRUE
org:ADC telecommunications
adr:;;;;;;
version:2.1
email;internet:Joseph_Vanquakebeek@adc.com
title:Software Engineer I
x-mozilla-cpt:;0
fn:Joseph Van Quakebeek
end:vcard
--------------AFD0A05DAFC39DF2C3718E4D--
------------------------------
Date: 2 Nov 1999 18:06:14 GMT
From: snow@statsci.com (Greg Snow)
Subject: Re: Change group permissions to match user permissions
Message-Id: <7vn96m$322$1@junior.statsci.com>
In article <7veqro$4lh$1@gellyfish.btinternet.com>,
Jonathan Stowe <gellyfish@gellyfish.com> wrote:
>On Fri, 29 Oct 1999 17:56:54 -0400 Tom Cockerline wrote:
>> Need to change the permissions for all directories and files beneath my
>> home directory so the group permissions will be the same as the user
>> permissions.
>>
>I'd cheat :
I'd cheat even more:
chmod -R g=u directory
And to make this (my reply, not the thread) on-topic, a version of chmod
is available through the Perl Power Tools: http://language.perl.com/ppt/
--
-------------------------------------------------------------------------------
Gregory L. Snow | Inertia makes the world go round,
(Greg) | Love makes the trip worth taking.
snow@statsci.com |
------------------------------
Date: Tue, 2 Nov 1999 10:44:41 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: comparing text with words
Message-Id: <x3y904gucd3.fsf@tigre.matrox.com>
abigail@delanet.com (Abigail) writes:
> It's useful for obfuscation purposes though:
>
> tr/\r\n\t / /s,
> print,
> for (/($pat)/); {
> print
> }
The (undocumented?) use of *anything* as a delimiter is useful for
obfuscation also:
tr s\r\n\t s ss;
I don't know if this is supported 100%, but if it is, then I think I
found a bug:
% perl -wl
$_ = "this is\na nice \nthing ";
tr s\r\n\t s ss;
print;
__END__
this is a nice thing
Good. Let's change the delimiter from 's' to 't':
% perl -wl
$_ = "this is\na nice \nthing ";
tr t\r\n\t t ts;
print;
__END__
his is a nice hing
Hmm..
--Ala
------------------------------
Date: Tue, 2 Nov 1999 10:31:44 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: comparing text with words
Message-Id: <x3yaeowucyo.fsf@tigre.matrox.com>
Larry Rosler <lr@hpl.hp.com> writes:
>
> In article <slrn81t0l5.66b.abigail@alexandra.delanet.com> on 2 Nov 1999
> 00:20:58 -0600, Abigail <abigail@delanet.com> says...
>
> ...
>
> > map {tr/\r\n\t / /s; print} /($pat)/;
>
> tr/\r\n\t / /s, print for /($pat)/;
y/\r\n\t / /s, print for /($pat)/;
I rarely see the use of y/// instead of tr/// for translation (or
transliteration, but let's not start another thread about that).
I wonder why? Unix?
--Ala
------------------------------
Date: Tue, 2 Nov 1999 12:44:34 -0500
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: comparing text with words
Message-Id: <Pine.GSO.4.10.9911021242310.4217-100000@crusoe.crusoe.net>
[posted & mailed]
On Nov 2, Ala Qumsieh blah blah blah:
> found a bug:
No, you didn't.
> % perl -wl
> $_ = "this is\na nice \nthing ";
> tr t\r\n\t t ts;
> print;
> __END__
> his is a nice hing
Sadly, you chose 't'. You wanted \t, then, to match a tab, but it didn't.
tr/abc\/ABC\\/
changes a->A, b->B, c->C, /->\
Yours is
tr t\r\n\t t ts;
which is also
tr/\r\nt / /s;
That \t isn't a tab. It's escaping the tr/// delimiter. Sorry. :)
--
MIDN 4/C PINYAN, USNR, NROTCURPI
jeff pinyan japhy@pobox.com
perl stuff japhy+perl@pobox.com
CPAN ID: PINYAN http://www.perl.com/CPAN/authors/id/P/PI/PINYAN/
------------------------------
Date: Tue, 2 Nov 1999 10:16:57 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: comparing text with words
Message-Id: <MPG.1288ca78b32da95b98a18d@nntp.hpl.hp.com>
In article <x3yaeowucyo.fsf@tigre.matrox.com> on Tue, 2 Nov 1999
10:31:44 -0500 , Ala Qumsieh <aqumsieh@matrox.com> says...
> Larry Rosler <lr@hpl.hp.com> writes:
> > In article <slrn81t0l5.66b.abigail@alexandra.delanet.com> on 2 Nov 1999
> > 00:20:58 -0600, Abigail <abigail@delanet.com> says...
> >
> > ...
> >
> > > map {tr/\r\n\t / /s; print} /($pat)/;
> >
> > tr/\r\n\t / /s, print for /($pat)/;
>
> y/\r\n\t / /s, print for /($pat)/;
>
> I rarely see the use of y/// instead of tr/// for translation (or
> transliteration, but let's not start another thread about that).
>
> I wonder why? Unix?
The 'tr' comes from the Unix/POSIX tr(1) command; the 'y' comes from the
transliteration command in sed(1).
I usually use 'y' in my own code (golf, you know :-), but 'tr' seems
more 'de rigeur' in this newsgroup (and in the Perl literature).
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 2 Nov 1999 10:24:41 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Cookies ?
Message-Id: <Pine.GSO.4.10.9911021022580.29670-100000@user2.teleport.com>
On Mon, 1 Nov 1999 z28pwr@my-deja.com wrote:
> If I want to set the cookie expire time to 15
> minutes i would use the +15m option and that
> would take the servers time add 15 minutes to it
> then send the cookie. The problem with that is
> that if the clients PC Time is 30 Minutes ahead
> then the Cookie will not set since it already
> passed that time. Is there anyway to grab the
> users time add 15 minutes to it and send it as
> the cookie expiration time ??
I think you're mistaken. But what does this have to do with Perl? Perhaps
you should search for the docs, FAQs, and newsgroups about browsers,
servers, and the protocols they use. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 02 Nov 1999 18:58:55 GMT
From: jim@jimmo.freeuk.com (Jim)
Subject: Database script help
Message-Id: <3820345f.8303149@news.freeuk.net>
Hello,
Can you help ?
We have written a perl script to read/write to a dbm database.
We now need to "hold" the user name when a user logs on to our website
to enable us to identify them.
How do we retain the user name once the scrips has finished executing
?
If the user needs to update his details within the database and not
have to logon again something must retain his user name.
Thanks
Jim & Neil
------------------------------
Date: Tue, 02 Nov 1999 19:51:06 GMT
From: Jim Williams <james.p.williams@usahq.unitedspacealliance.com>
Subject: Determining Open Mode
Message-Id: <7vnfb9$e35$1@nnrp1.deja.com>
Given a filehandle, how do I tell if it was originally opened to be
read from, written to, both, etc.? fcntl($h,F_GETFL,...) seems close,
but returns 2 for both STDIN and STDOUT. I'm running Perl 5.004_04 on
IRIX 6.5.
Thanks,
Jim Williams
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 2 Nov 1999 20:46:00 +0100
From: "danfan" <nfy339g@tninet.se>
Subject: dirty textfiles
Message-Id: <7vnero$be1$1@cubacola.tninet.se>
I want to write a little program that reads a textfile
and replaces dirty bytes with space, including 0x1A = eof
This means I can't use ordinary functions as 0x1A triggers an eof
condition.
Any suggestions?
Writing in C I used:
fh = _open(argv[1] , _O_RDWR | _O_BINARY ) /* OPEN*/
bytesread = _read( fh, buffer, nbytes ); /* read 64K*/
... do things ....
newpos = _lseeki64( fh, backpos, SEEK_CUR ); /* reposition,rewind */
byteswritten = _write( fh, buffer, bytesread )) /* Rewrite 64K */
_close( fh );
/* close */
/DG
------------------------------
Date: Tue, 2 Nov 1999 12:01:51 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Error: Can't do setuid
Message-Id: <Pine.GSO.4.10.9911021158200.29670-100000@user2.teleport.com>
On Tue, 2 Nov 1999, Thomas Leonhardt wrote:
> If I run the program I get the message: Can't do setuid
> I read in the pearl documentation/faq that this error might
> be caused by a missing sperl program. But I got that
> program in /usr/bin and all the rights are set.
> Any ideas what else might cause the error??
Maybe it's not in the right place - is it supposed to be in
/usr/local/bin, perhaps? But maybe you should try truss (or your system's
equivalent) to see what perl is really trying to exec. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 2 Nov 1999 12:22:36 -0500
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: Extracting just the date from a string
Message-Id: <Pine.GSO.4.10.9911021220380.4217-100000@crusoe.crusoe.net>
On Nov 2, Matt Williamson blah blah blah:
> Jason Rosenkowitz wrote:
>
> > I am trying to extract just the date from a string which might be of
> > variable length.
> >
> > ...
> > I have tried to use @date = split(/ /,$string) as there is a common split
> > of two spaces between email address and date but there might be two spaces
> > somewhere in the date which throws me out!!
>
> NOTE: this will lose that double-space that may sometimes occur in the date.
> If that's important to keep, you'll need to do something a bit fancier.
It's not that complicated at all. Jason almost had it, but he didn't know
of the third argument to split.
$text = "This is here Date is here";
# if I want "Date is here"...
$date = (split / /, $text, 2)[1];
That is the same as:
@tmp = split / /, $text, 2; # that 2 means only split it into 2 parts
$date = $tmp[1];
Not complicated. Regular expressions not needed.
--
MIDN 4/C PINYAN, USNR, NROTCURPI
jeff pinyan japhy@pobox.com
perl stuff japhy+perl@pobox.com
CPAN ID: PINYAN http://www.perl.com/CPAN/authors/id/P/PI/PINYAN/
------------------------------
Date: Tue, 02 Nov 1999 17:08:37 GMT
From: reedjd@bitsmart.com
Subject: Formatting a Date Properly
Message-Id: <7vn5qi$6hn$1@nnrp1.deja.com>
I'm having an issue formatting a date to be used by a shell. I've
been trying to compress it into one line:
perl -e '($d,$m,$y)=(localtime(time))[3..5];$m+=1;$y+=1900;print
sprintf "%4.0d%2.0d%2.0d\n",$y,$m,$d;'
This worked great for most of last month, but then this month started
and I got the following output:
199911 1
Notice the space? I want it to be zero padded:
19991101
I know perl can't typecast it to interger so it zero pads... or can it?
-Jordan
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 02 Nov 1999 17:44:04 GMT
From: Mike Salter <msalter@bestweb.net>
Subject: Re: Formatting a Date Properly
Message-Id: <Pine.BSF.4.05.9911021242560.10626-100000@monet.bestweb.net>
On Tue, 2 Nov 1999 reedjd@bitsmart.com wrote:
>perl -e '($d,$m,$y)=(localtime(time))[3..5];$m+=1;$y+=1900;print
>sprintf "%4.0d%2.0d%2.0d\n",$y,$m,$d;'
>
>This worked great for most of last month, but then this month started
>and I got the following output:
>199911 1
>
>Notice the space? I want it to be zero padded:
>19991101
Then you need to specify the padding char as %02d
------------------------------
Date: Tue, 2 Nov 1999 12:45:49 -0500
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: Formatting a Date Properly
Message-Id: <Pine.GSO.4.10.9911021244400.4217-100000@crusoe.crusoe.net>
[posted & mailed]
> perl -e '($d,$m,$y)=(localtime(time))[3..5];$m+=1;$y+=1900;print
> sprintf "%4.0d%2.0d%2.0d\n",$y,$m,$d;'
%d is an integer. Thus, %4.0d has a redundant ".0" in it. Of course
there are no digits after the decimal point in an integer.
You also want 0-padding instead of space-padding?
sprintf "%04d", 12; # 0012
Read perldoc -f sprintf.
--
MIDN 4/C PINYAN, USNR, NROTCURPI
jeff pinyan japhy@pobox.com
perl stuff japhy+perl@pobox.com
CPAN ID: PINYAN http://www.perl.com/CPAN/authors/id/P/PI/PINYAN/
------------------------------
Date: Tue, 2 Nov 1999 11:52:07 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: How can I store/print a variable containing a DISPLAY IP address?
Message-Id: <Pine.GSO.4.10.9911021149550.29670-100000@user2.teleport.com>
On Mon, 1 Nov 1999, Maurice Maltbia wrote:
> $IP_address = '111.222.333.64;
Do you really want just one quote mark there? Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 2 Nov 1999 19:26:32 GMT
From: edew@netcom.com (Eric Dew)
Subject: How do I create a library file of subroutines?
Message-Id: <7vndt8$1db$1@nntp2.atl.mindspring.net>
I haven't seen this in the perl FAQ, but maybe because I'm not using the
correct words.
This is what I would like to do:
I have a subroutine which I plan to use often in many scripts. Say,
sub oftenUsed {
my($this,$that);
do this;
do that;
return those;
}
Instead of having the sub routine reproduced in almost all scripts, I would
like to have it located in some library style file, say, fusr.pl (frequently
used sub routines).
More specifically, assume my scripts are located in /usr/local/bin/ and
the fusr.pl located in /usr/local/lib.
What do I write in my scripts to access these subroutines? Is it something
like,
require("/usr/local/lib/fusr.pl");
or
use "/usr/local/lib/fusr.pl";
or what?
Also, how is the content of the fusr.pl formatted? Do I have to include
#!/usr/local/bin/perl
at the top of the fusr.pl file, or can I just put the subroutines in the fi
le just like:
#------First line of file-------
sub firstUsefulRoutine {
my($this,$that,$them);
do this;
if (that) {
then do that;
} elsif {
do those;
} else {
do that and that;
}
}
sub nextUsefulRoutine {
my($them, $those, $allOthers);
while this, that;
}
[. . .]
<more sub routines {
...
} >
Any suggestions greatly appreciated.
EDEW
------------------------------
Date: Tue, 2 Nov 1999 11:58:08 -0800
From: "David Christensen" <dchristensen@california.com>
Subject: Re: How do I create a library file of subroutines?
Message-Id: <381f4257_4@news5.newsfeeds.com>
Eric Dew <edew@netcom.com> wrote...
> Instead of having the sub routine reproduced in almost all scripts, I
> would like to have it located in some library style file, say, fusr.pl
> (frequently used sub routines).
Sounds like you want a module. Type 'perldoc perlmod' or check out
Programming Perl or the Perl Cookbook.
I have written modules of functions and modules implementing classes/
objects. Some people have even figured out how to give a module both
types of interfaces -- Data::Dumper is an example.
--
David Christensen
dchristensen@california.com
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Wed, 3 Nov 1999 07:08:39 +1300
From: "Peter Sundstrom" <send@no.junk.mail>
Subject: Re: Including modules directly in a script
Message-Id: <941605740.568793@shelley.paradise.net.nz>
Jonathan Stowe wrote in message <381ef536_2@newsread3.dircon.co.uk>...
>In comp.lang.perl.misc Peter Sundstrom <send@no.junk.mail> wrote:
>> I know this seems a totally crazy thing to do, but I have reasons for
doing
>> it.
>>
>> What I want to know is how can I directly include a perl module in my
perl
>> script. Obviously I can't just plonk in the module code without some
mods.
>> What modifications would I generally need to make, or is it too
difficult?
>>
>
>What happened when you tried ?
>
I was using the MIME::Lite module. Some of the global variables aren't
available in the subroutines.
------------------------------
Date: 03 Nov 1999 04:10:39 +0900
From: tai@imasy.or.jp (T. Yamada)
Subject: Re: Including modules directly in a script
Message-Id: <87zowwr9ow.fsf@imasy.or.jp>
>>>>> "Peter" == Peter Sundstrom <send@no.junk.mail> writes:
Peter> What I want to know is how can I directly include a perl module
Peter> in my perl script.
How's this?
#!/usr/bin/perl
package Included::Perl::Module;
...just place source here...
package main;
...your script comes here...
--
T. Yamada <tai@imasy.or.jp>
PGP fingerprint = 6B 57 1B ED 65 4C 7D AE 57 1B 49 A7 F7 C8 23 46
------------------------------
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 1255
**************************************