[12596] in Perl-Users-Digest
No subject found in mail header
daemon@ATHENA.MIT.EDU (John Stanley)
Fri Jul 2 01:17:30 1999
Date: Thu, 1 Jul 1999 22:04:29 -0700 (PDT)
From: John Stanley <stanley@ruby.OCE.ORST.EDU>
To: perlusers-hutyt@ruby.OCE.ORST.EDU
Return-Path: <Perl-Users-Request@ruby.oce.orst.edu>
Precedence: bulk
From: Perl-Users Digest <Perl-Users-Request@ruby.oce.orst.edu>
To: Perl-Users@ruby.oce.orst.edu (Perl-Users Digest)
Subject: Perl-Users Digest, Issue: 1 Volume: 9
Message-Id: <930891869-v9-i1@ruby.oce.orst.edu>
Perl-Users Digest Thu, 1 Jul 1999 Volume: 9 Number: 1
Today's topics:
Re: "Pushing" keys from Perl program. <xyf@inetnebr.com>
Re: 2 simple (not to me tho) questions <uri@sysarch.com>
[Q]: access hashes from a sub? (Jih-Shin Suen)
array membership (brian e jones)
Re: Can not write my file to the server (Abigail)
CGI Help please... arpith@hotmail.com
Client Pull & Server Push <troyknight@troyknight.eurobell.co.uk>
Re: Client Pull & Server Push (Martien Verbruggen)
Re: Clueless and in need of help! (Harmanie)
Computing log base 10 in perl (Greg Miller)
Re: Computing log base 10 in perl <cassell@mail.cor.epa.gov>
Re: Computing log base 10 in perl <tchrist@mox.perl.com>
Counting parenthesis (NT and Solaris) <frederic@tavern.xsj.xilinx>
Date::Manip can't handle Arizona Time zone? kgentes@gentek.net
Re: DBI/DBD mSQL: mSQL.so bobnospam@khusro.math.umn.edu
ExtUtils::MakeMaker - Need -K PIC not -K pic <stuart_harvey@alumni.hmc.edu>
Re: File uploading question <jaimedp@pacbell.net>
for Developers <flanker@sonnet.ru>
Generating HTML from variables <kpb@dolby.com>
getting script source <ngaccess@millions.net>
Re: getting script source (H. Camphausen)
Re: getting script source (H. Camphausen)
Re: getting script source (Matthew Bafford)
Re: getting script source <tchrist@mox.perl.com>
Help for Process (Jun Zhuang)
Re: Help for Process ()
Re: Help w/perl script (Alastair)
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 01 Jul 1999 17:45:49 -0500
From: ktb <xyf@inetnebr.com>
Subject: Re: "Pushing" keys from Perl program.
Message-Id: <377BEF9D.5C407882@inetnebr.com>
Peter Suschlik wrote:
>
> ktb wrote:
>
> Hi.
>
> > I would like to create a program that when run would type for me. I
> > have a problem getting the 'num lock' key to work under linux in X.
>
> Try ``setleds''.
Setleds works great for console but not for X.
>
> > I've tried several fixes to no avail. I thought there must be someway
> > to tell the computer to "turn" this key on. Is there a way to "push"
> > keyboard keys with Perl?
>
> Yes, indirectly. You need the "$include/kd.h" - convert to "kd.ph" by using
> h2ph.
> Use it with require "$inlcude/kd.h" and ``perldoc -f ioctl''.
>
> It is not tested. Just an idea.
>
> Regards.
>
> Peter Suschlik
I'm not sure exactly what you just said but I will poke around.
Thanks,
kent
>
> --
> Learning German (lesson #444):
> seiteneffektfrei, das Golfplaetze, dieses Klosettpapier, diese
> AusSenwirtschaft,
> diese Auslandsreferat, der Makroexpansionszeit, dieses Importplanung,
> dieses Erzieher.
------------------------------
Date: 01 Jul 1999 22:14:28 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: 2 simple (not to me tho) questions
Message-Id: <x73dz74x2z.fsf@home.sysarch.com>
>>>>> "SL" == Steve Lamb <morpheus@despair.rpglink.com> writes:
SL> And I hope you're never in that position either for you'll be
SL> so busy worrying about how to do something so perfectly everyone
SL> will just tremble in fear instead of getting the work done.
well, in the classes i am currently teaching, i mention some bad perl
things and that if i ever see any code like that, i will kill them. they
get the message. and they actually get and laugh at my jokes, unlike
some usenet trolls we know (hint: i mean you).
SL> Nah, only from people who are snobbish twits, misquote me,
SL> take what I said an expand it to something I didn't only to
SL> inflate their own egos.
i never said anything to you to inflate my ego. i couldn't do such a
thing with the likes of you.
SL> Before striking at them? Uh, newsflash, Tom "struck" first.
SL> Not my fault he, and you, have hit upon someone who doesn't take
SL> to bullshit snobbery by quivering in fear and hiding in a corner.
SL> Might I suggest you learn how to instruct without coming off as a
SL> pretentious prick?
or that you learn to write without coming off like a whining brat who
can't play with adults. tom can dish and take it. you can't seem to do
either.
tom commented initially on how quoting a naked variable is
bad. period. you defended it based on the print context which wil
stringify it anyway. he then said it is bad anywhere. you defended that
it was ok in this context. he went off on other contexts. you kept
refering to page 10 of the camel and started to shout, curse and act
liek the tiwt we have seen you to be. tom plonked you. you keep
defending yourself by whining and cursing. end of story.
>> oh, well, i tried to make some sense to you but you will keep
>> living in your delusional world.
SL> Quite the contrary, all you've done is toss insults. I've
SL> also learned a bit. I've also learned some very important
SL> lessons.
not the really important ones about perl and usenet.
SL> 1: Tom, because of who he is, can be an asshole and everyone has
SL> to deal with it.
why not? he is fun and very bright. would you were either.
SL> 2: You, apparently, feel that being who you are also entitles you
SL> to be an asshole and have everyone deal with it.
most everyone else has no problem with me. you seem to. so it is your
problem how you deal with me. i am here and not going away.
SL> 3: Neither of you can let minor points of style go and cannot
SL> prove your point without taking the scope of the arguement outside
SL> what was given.
sometimes minor points of style are more important that you realize. and
if you fail to handle them you will never get the larger points. you
haven't posted any other code so we have no way of judging your
stuff. but by the poor way you write and efend yourself, it is patently
obvious you are not a deep thinker. so we can extrapolate to the rest of
you coding ability from that. you have to prove otherwise before anyone
of us would change our minds on that view.
>> if you want to, try another language where you don't have to think
>> so much and really understand the decisions you make. like VB.
SL> Might I suggest you change languages so you can continue to
SL> appear godlike to those who actually give a crap?
i am a perl god. i now convert you to a toad. go hop away.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: 1 Jul 1999 16:04:35 -0500
From: jihshin@linux11.ph.utexas.edu (Jih-Shin Suen)
Subject: [Q]: access hashes from a sub?
Message-Id: <7lgl53$em6$1@linux11.ph.utexas.edu>
Hi, All:
I think i still don't get it.... :(
I got the problem in accessing different hashes.
But don't know how.
I have data hashes:
%dose1 has the form (key=date1, val1), (date2, val2)..
%dose2
%dose3
.........
If i like to use one sub to calculate the val to the cubic power,
and output them to individual file, say
dose1.dat has the form (date, val^3), (date2, val2^3)...
dose2.dat
dose3.dat
How to write such a sub?
Thanks for any input.
Q
--
Ah-Q, made by God
AhQ@mail.utexas.edu
------------------------------
Date: Fri, 2 Jul 1999 02:30:51 GMT
From: cluebag@world.std.com (brian e jones)
Subject: array membership
Message-Id: <FE81nF.6tC@world.std.com>
i'm sure there is a simple solution to this question, but i just can't think of it. i am creating an interactive oncall list which uses two arrays to group the two different types of systems we have. when the user inputs the name of the system they want info on it checks it against the two arrays in order to determine which oncall information to access. i wanted to use an if/else loop to accomplish this, but couldn't think of a simple way to check $a against @b. this is my first script and i feel like i've hit a wall, i'd appreciate any suggestions you have. thanks,
-brian
------------------------------
Date: 1 Jul 1999 18:35:57 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Can not write my file to the server
Message-Id: <slrn7nnuqd.31h.abigail@alexandra.delanet.com>
Filip M. Gieszczykiewicz (fmgst+@pitt.edu) wrote on MMCXXX September
MCMXCIII in <URL:news:7lem7s$e0e$1@usenet01.srv.cis.pitt.edu>:
""
"" Speaking of robots to monitor this group - whenever anyone suggests
"" "die" in a cgi-bin environment... NEVER just "die()" in a cgi-bin
"" script - ANY output to STDOUT without the proper preamble will yield
"" a Server Error 500 - which is incredibly uninformative.
Rubbish. That's why there's CGI::Carp.
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
.qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
.qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'
-----------== 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: Fri, 02 Jul 1999 01:41:25 GMT
From: arpith@hotmail.com
Subject: CGI Help please...
Message-Id: <7lh5c4$ueo$1@nnrp1.deja.com>
Hi,
I'm new to CGI and would like to know if there are any free cgi hosting
servers, so that I can check out how these things work and my custom cgi
scripts.
Thanks,
Arpith.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 2 Jul 1999 01:23:19 +0100
From: "Troy Knight" <troyknight@troyknight.eurobell.co.uk>
Subject: Client Pull & Server Push
Message-Id: <7lh0lb$2aj8$1@slrn.eurobell.net>
I'm not exactly a newbie so I wouldn't appreciate newbie answers. I just
want to know if any can tell me why my browser won't display client pull and
server push animations. I have IE5 and all multimedia options enables in the
browser. Thanks in adv.
------------------------------
Date: Fri, 02 Jul 1999 02:11:01 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Client Pull & Server Push
Message-Id: <VcVe3.138$VK2.6017@nsw.nnrp.telstra.net>
In article <7lh0lb$2aj8$1@slrn.eurobell.net>,
"Troy Knight" <troyknight@troyknight.eurobell.co.uk> writes:
> I'm not exactly a newbie so I wouldn't appreciate newbie answers. I just
> want to know if any can tell me why my browser won't display client pull and
> server push animations. I have IE5 and all multimedia options enables in the
> browser.
You are a newbie. Anyone who isn't would know that perl has nothing
to do at all with WWW browser stuff, client pull, or server push.
Ask in an appropriate group, somewhere in the comp.infosystems.www.*
hierarchy.
Martien
--
Martien Verbruggen |
Interactive Media Division | The world is complex; sendmail.cf
Commercial Dynamics Pty. Ltd. | reflects this.
NSW, Australia |
------------------------------
Date: 01 Jul 1999 21:56:22 GMT
From: harmanie@aol.com (Harmanie)
Subject: Re: Clueless and in need of help!
Message-Id: <19990701175622.25912.00005827@ng-da1.aol.com>
>
>What does it tell you in your server logs?
<blushing> and I can find these where?
Christine
------------------------------
Date: Thu, 01 Jul 1999 23:20:49 GMT
From: gmiller@iglou.com (Greg Miller)
Subject: Computing log base 10 in perl
Message-Id: <377ff726.650266004@news.alt.net>
The log function in perl is base e. I know there's a way to
use the base e log to compute the log base 10. Does anyone know how
it's done?
Greg Miller
gmiller@iglou.com members.iglou.com/gmiller/
www.net-chess.com
------------------------------
Date: Thu, 01 Jul 1999 17:42:35 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Computing log base 10 in perl
Message-Id: <377C0AFB.560AF3AD@mail.cor.epa.gov>
Greg Miller wrote:
>
> The log function in perl is base e. I know there's a way to
> use the base e log to compute the log base 10. Does anyone know how
> it's done?
Oh sure. Lots of Perlites know how to do this.
Oh. You want the *answer*. Well, you know we're not helpful
around here. :-)
But anyway, there are a number of ways to do this, including:
use POSIX qw(log10);
print POSIX::log10(1000), "\n";
or use the standard math formula
log base 10 of x = (log base e of x) / (log base e of 10):
$log10 = log($x) / log(10);
although it would really be cleaner to use the constant pragma
to make the natural log of 10 into a constant, if you're going
to be using it over and over...
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 1 Jul 1999 18:58:21 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Computing log base 10 in perl
Message-Id: <377c0ead@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
gmiller@iglou.com (Greg Miller) writes:
: The log function in perl is base e. I know there's a way to
:use the base e log to compute the log base 10. Does anyone know how
:it's done?
From the Perl Cookbook:
.EQ
log sub n (x) = { {log sub e (x)} over {log sub e (n)} }
.EN
--tom
--
There is no reason for any individual to have a computer in their home. --Ken Olsen, 1977
------------------------------
Date: 01 Jul 1999 17:48:09 -0700
From: Frederic Rivoallon <frederic@tavern.xsj.xilinx>
Subject: Counting parenthesis (NT and Solaris)
Message-Id: <xh1n1xfancm.fsf@tavern.xsj.xilinx>
This little code below seems to be working OK on NT (perl 5.005_02)
but not on Solaris (perl 5.004). On solaris it does not count the
left parenthesis!!!
Any ideas?
#!/usr/local/bin/perl -w
@datafile = <>;
foreach (@datafile) {
chomp;
$nb = count_par($_);
print "ORIG: $_ $nb\n";
}
#
# This sub counts parentheses in a string (on NT it does)
#
sub count_par {
my $chaine = shift;
my $c = 0;
while ($chaine =~ /([()])/gc) {
$c += {qw(\( 1 \) -1)}->{$1};
}
return $c;
}
Frederic
------------------------------
Date: Fri, 02 Jul 1999 00:01:29 GMT
From: kgentes@gentek.net
Subject: Date::Manip can't handle Arizona Time zone?
Message-Id: <7lgvgk$sja$1@nnrp1.deja.com>
Folks,
I was trying to use the Date::Manip module and the
first invocation of its methods bombed out my Perl
module. I looked through the error and it looks to
me like the Date::Manip package doesn't understand
the Arizona timezone (Arizona has its own time zone,
in case you all didn't know- it never changes to DST
since we have too much sun already)... anyways,
is there an upgrade to this package that fixes this
or should I attempt to contact the author? What does
one do when such a staple module comes crashing
down around ones head. Also, in the event this
is not readily fixable, what would others recommend
is a reasonable substitute for this package?
Here is the actual code that I am using the Date::Manip
module calls in :
# this subroutine simply checks the
# date/time it is given against the last
# parsed date/time stamp from the database.
# a true return means that the date/time
# passed into this sub routine is newer
# than the database reference.
sub anewobservation {
my($obs_datetime_val, $db_datetime_val) = @_;
$date1=&ParseDate($db_datetime_val);
$date2=&ParseDate($obs_datetime_val);
return ($date1 lt $date2);
}
Help help help...
Kim
oh ya, when Perl hits the first "&ParseDate" the following
is the output to the command window -
------------------------------------------------------------
C:\SPIn>perl -d parse.pl
ERROR: Date::Manip unable to determine TimeZone.
Date::Manip::Date_TimeZone called at
C:/Perl/site/lib/Date/Manip.pm line
1186
Date::Manip::Date_Init() called at
C:/Perl/site/lib/Date/Manip.pm line 1
727
Date::Manip::ParseDate('1/1/99') called at parse.pl line 2445
main::anewobservation('06/30/1999 21:34:56', '1/1/99') called at
parse.p
l line 1387
main::parsefileTelProb('Win32::OLE=HASH(0x10efea0)',
'c:/spin/collected/
Arizona/F12/TelP8I/f12gx01-p/930871721_concatb...', 2, 1) called at
parse.pl lin
e 393
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 01 Jul 1999 16:36:12 CDT
From: bobnospam@khusro.math.umn.edu
Subject: Re: DBI/DBD mSQL: mSQL.so
Message-Id: <1999Jul1.163612@khusro.math.umn.edu>
In article <slrn7n2pc0.5i.alastair@calliope.demon.co.uk>, alastair@calliope.demon.co.uk (Alastair) writes:
|> bobnospam@khusro.math.umn.edu <bobnospam@khusro.math.umn.edu> wrote:
|> >
|> >If the subject heading got your interest, then you probably know how
|> >to solve my little problem.
|> >
|> >Towit, some output:
|> >
|> >>csctest.pl
|> >perl: can't resolve symbol 'msqlErrMsg'
|> >install_driver(mSQL) failed: Can't load '/usr/local/lib/perl5/site_perl/5.005/
|> >i686-linux/auto/DBD/mSQL/mSQL.so' for module DBD::mSQL:
|> >Unable to resolve symbol at /usr/local/lib/perl5/5.00503/i686-linux/
|> >DynaLoader.pm line 169.
|>
|> I'm no expert, but use a similar set of modules. I'd start by checking whether
|> perl accepts this ;
|>
|> use DBI;
|>
|> If not, I'd re-install Msql-Mysql-modules-1.A (where A = the latest) from
|> source - I believe it includes the DBI modules (from memory). Get it on CPAN
|> (http://www.cpan.org).
If by accept you mean that perl chokes on it, or cannot find it, then apparently
it accepts use DBI; without comment.
For example, this:
use strict;
use DBI;
my $dsn = "DBI:mSQL:database=gamla_db1:localhost";
my $dbh = DBI->connect($dsn,username,topsecretpassword,{RaiseError => 1});
gives this:
perl: can't resolve symbol 'msqlErrMsg'
install_driver(mSQL) failed: Can't load '/usr/local/lib/perl5/site_perl/5.005/
i686-linux/auto/DBD/mSQL/mSQL.so' for module DBD::mSQL: Unable to resolve symbol
at /usr/local/lib/perl5/5.00503/i686-linux/DynaLoader.pm line 169.
at (eval 1) line 3
at ./csctest.pl line 21
which is causing ever-accelerating hair loss. :^)
|> >my $libref = dl_load_file($file, $module->dl_load_flags) or
|> >croak("Can't load '$file' for module $module: ".dl_error()."\n");
|>
|> If this is an error in dynamic loading, make sure your Perl build supports
|> dynamic loading. Check by typing 'perl -V' and look for lines line (in Linux) ;
|>
|> Dynamic Linking
|> -shared
Excellent suggestion. The result is:
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic -Wl,-rpath,/usr/local/lib/perl5/5.00503/i686-linux/CORE'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
I am uncertain whether this is equivalent in some fashion to your -shared
result. Is it possible to compile mSQL2, DBI, and DBD static in order to avoid
possible loading errors? Or is this the wrong tree for barking?
|> >I compiled and installed
|> >
|> >DBI-1.08
|> >Data-ShowTable-3.3
|> >Msql-Mysql-modules-1.2200
|>
|> I have similar.
|>
|> HTH.
Thanks for you help. If you like, CC to me: bob at math dot umn dot edu.
Adios,
Chris
------------------------------
Date: Thu, 1 Jul 1999 20:44:29 GMT
From: "Stuart A. Harvey 586-0388" <stuart_harvey@alumni.hmc.edu>
Subject: ExtUtils::MakeMaker - Need -K PIC not -K pic
Message-Id: <377BD32D.BABC5BF6@alumni.hmc.edu>
--------------F52738C18D47609024AF6AEC
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Is there a clean way to change the -K pic flag to -K PIC when using MakeMaker?
Stuart
--
Stuart A. Harvey, M/S FA33 stuart.a.harvey@boeing.com
Member of the Technical Staff PHONE: (818) 586-0388
Boeing North American Inc., Rocketdyne Division FAX: (818) 586-7385
--------------F52738C18D47609024AF6AEC
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<pre>Is there a clean way to change the -K pic flag to -K PIC when using MakeMaker?</pre>
<pre></pre>
<pre>Stuart</pre>
<pre></pre>
<pre>--
Stuart A. Harvey, M/S FA33 stuart.a.harvey@boeing.com
Member of the Technical Staff PHONE: (818) 586-0388
Boeing North American Inc., Rocketdyne Division FAX: (818) 586-7385</pre>
</html>
--------------F52738C18D47609024AF6AEC--
------------------------------
Date: Thu, 01 Jul 1999 20:37:29 -0700
From: "Jaime D. Perez" <jaimedp@pacbell.net>
Subject: Re: File uploading question
Message-Id: <377C33F9.34194B59@pacbell.net>
Alex, I would like to get a copy of that file. Can you point out to me
where I can find it?
TIA
-Jaime
Alex wrote:
> Please help,
> I intend to use the file-uploading script from Jeff Carnahan.This is a
> very good script, indeed.
> But I have a question:
> If I only allow people to upload the specified filenames, e.g.
> upload1.html, upload2.html and upload3.html. Filenames other than these
> are not allow to upload.
> How can I do that ?
> Thank you
> alex
------------------------------
Date: Fri, 2 Jul 1999 03:29:14 +0400
From: "Michael Yevdokimov" <flanker@sonnet.ru>
Subject: for Developers
Message-Id: <7lgtv8$epg$1@ghost.rosmail.com>
Dear Developers,
We provide materials for programmers and Web developers from all over the
world.
Your are welcome to submit your software on Developer Network web site.
You have just to fill in the submition form.
http://www.developer.net.ru/download/submit.htm
It is recommended to add new links for the new versions of your software.
If you develop any new software and write press-release about it you are
also welcome to send it to us to be published on pages of Developer Network
for free.
Members of Developer Network are sites from different parts of the world.
For example, our site is being hosted in Russian Federation, the second one
is in India, the third one is in Ukraine, and more...
We hope to cooperate with you!
--
Best wishes,
Michael Yevdokimov
Email: flanker@sonnet.ru
root@developer.net.ru
ICQ: 40272699
-----------------------------------------------
DEVELOPER NETWORK
http://www.developer.net.ru
support@developer.net.ru
info@developer.net.ru
-----------------------------------------------
------------------------------
Date: Thu, 1 Jul 1999 14:56:30 -0700
From: "Ken Becker" <kpb@dolby.com>
Subject: Generating HTML from variables
Message-Id: <7lgo6d$874@iserver2.dolby.com>
Hello,
I have a database in which are stored a number of images. Depending upon a
user's selection criteria, one or more of these images are to be extracted
from the database and displayed on a single HTML page. I can do this by
pulling the data streams which are stored in the database from each
selected record, then creating a JPEG file for each image, then creating an
HTML document which binds the images all together with some text and links,
but I was wondering of anyone know of a more elegant wat to do this.
Ideally, I'd like to put this whole shebang together in memory and spit that
out to the user's browser.
Can anyone help me?
Thanks,
Ken
------------------------------
Date: Thu, 01 Jul 1999 19:07:49 -0400
From: pop <ngaccess@millions.net>
Subject: getting script source
Message-Id: <377BF4C5.6E4E3E70@millions.net>
Hello all,
Is it possible to get a script to return the entire script contents?
Or IOW, can someone get a script to 'send' itself to them?
I know it will if its setup wrong or misconfigured but I am speaking of
a 'properly configured' working script.
TIA
------------------------------
Date: 2 Jul 1999 00:06:38 GMT
From: h.camp@scm.de (H. Camphausen)
Subject: Re: getting script source
Message-Id: <MPG.11e6206294c8fc098969a@news.scm.de>
[Fup zu pop's Posting vom Thu, 01 Jul 1999 19:07:49 -0400]
> Is it possible to get a script to return the entire script contents?
>
> Or IOW, can someone get a script to 'send' itself to them?
How about this one:
#!..../perl.exe -w
# do some stuff here...
# now let's get verbose:
my ($f_in, @f_in);
open (FI, "< path/to/myself/its_me.pl") || die "I am not here!\n";
@f_in = <FI>;
close (FI);
print "@f_in";
# want a one-liner?
$f_in = join ('', grep (s/\n//g, @f_in));
print $f_in;
# ...and continue with other things...
hth, Hartmut
--
---------------------------------------------------
CREAGEN Computerkram Fon: 06424/923826
Hartmut Camphausen Fax: 06424/923827
Kirchstrasse 8 Emil: h.camp@creagen.de
35043 Marburg WWW: http://www.creagen.de/
------------------------------
Date: 2 Jul 1999 00:12:17 GMT
From: h.camp@scm.de (H. Camphausen)
Subject: Re: getting script source
Message-Id: <MPG.11e6221ffae563fb98969b@news.scm.de>
[Fup zu H. Camphausen's Posting vom 2 Jul 1999 00:06:38 GMT]
Forgot to say..
your testscript with containing the aforementioned code should be named
"its_me.pl".
mfg, Hartmut
--
---------------------------------------------------
CREAGEN Computerkram Fon: 06424/923826
Hartmut Camphausen Fax: 06424/923827
Kirchstrasse 8 Emil: h.camp@creagen.de
35043 Marburg WWW: http://www.creagen.de/
------------------------------
Date: Fri, 02 Jul 1999 00:38:23 GMT
From: *@dragons.duesouth.net (Matthew Bafford)
Subject: Re: getting script source
Message-Id: <slrn7no144.ha.*@dragons.duesouth.net>
On Thu, 01 Jul 1999 19:07:49 -0400, pop <ngaccess@millions.net> cut a
telephone line, and tapped the following to comp.lang.perl.misc using
only his tongue:
: Is it possible to get a script to return the entire script contents?
There are a lot of ways.
system("cat $0");
is one of the more obvious ones.
: Or IOW, can someone get a script to 'send' itself to them?
Well, I guess
system("cat $0 | mail them\@wherever.com");
would work.
: I know it will if its setup wrong or misconfigured but I am speaking of
: a 'properly configured' working script.
I'm curious as to why you don't just run cat yourself?
% perl foo
<blah>
% cat foo
<contents of foo>
%
: TIA
HTH,
--Matthew
------------------------------
Date: 1 Jul 1999 18:47:00 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: getting script source
Message-Id: <377c0c04@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc, pop <ngaccess@millions.net> writes:
:Is it possible to get a script to return the entire script contents?
open 0 and print <0>;
--tom
--
"What matter wounds to the body of a knight-errant? For each time he falls he
shall rise again, and woe to the wicked!"
- Don Quixote, `Man From La Mancha'
------------------------------
Date: 2 Jul 1999 00:23:35 GMT
From: jzhuang@ringer.cs.utsa.edu (Jun Zhuang)
Subject: Help for Process
Message-Id: <7lh0q7$74d$1@ringer.cs.utsa.edu>
There is getppid function in perl to get parent PID.
If I want to get my PID(but no getpid in perl),
how would I do it?
Thanks in advance.
------------------------------
Date: 2 Jul 1999 03:10:56 GMT
From: redmondm@yahoo.com ()
Subject: Re: Help for Process
Message-Id: <slrn7nobe4.dih.redmondm@kells.kells>
In article <7lh0q7$74d$1@ringer.cs.utsa.edu>, Jun Zhuang wrote:
>There is getppid function in perl to get parent PID.
> If I want to get my PID(but no getpid in perl),
> how would I do it?
>Thanks in advance.
my $pid = $$;
Martin
------------------------------
Date: Thu, 01 Jul 1999 21:51:13 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Help w/perl script
Message-Id: <slrn7nnsbe.65.alastair@calliope.demon.co.uk>
Andy <achau@pacbell.net> wrote:
>Hi,
>I have a webpage with about 100+ thumbnail pics. They run vertically down
>the left column of my framed page.
>I need to randomize how these thumbnails appear.
I'd start by expanding on a better script. In fact, what you need to do is
shuffle an array. The array could contain the filename and url (via a hash) -
see 'perldoc perldsc'. There is a good example of code that does this in the
Perl Cookbook from O'Reilly - it is definitely worth buying.
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 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.
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 V9 Issue 1
***********************************