[16419] in Perl-Users-Digest
Perl-Users Digest, Issue: 3831 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 28 09:05:29 2000
Date: Fri, 28 Jul 2000 06:05:16 -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: <964789516-v9-i3831@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 28 Jul 2000 Volume: 9 Number: 3831
Today's topics:
Re: 401 header with Perl <gellyfish@gellyfish.com>
[GN]DBM_File question <fabascal@gredos.cnb.uam.es>
Re: Advanced Perl Programming -- Dated? <bart.lateur@skynet.be>
Re: Advanced Perl Programming -- Dated? <sb@muccpu1.muc.sdm.de>
An email problem <jamesmckay@MailAndNews.com>
Re: Boost your bottom line <bart.lateur@skynet.be>
Re: Bowling for strings (was: shifting strings ) <david.t.liu@intel.com>
Re: Bowling for strings (was: shifting strings ) (Bill Feidt)
Re: CGI Execution URGENT <gellyfish@gellyfish.com>
Re: CGI Execution URGENT <red_orc@my-deja.com>
Re: Checking for a sub before calling (Anno Siegel)
Re: Critiques, please (Tim Hammerquist)
Re: Do I Need Chomp? <was Critiques, please> <iltzu@sci.invalid>
File IO <keithu@gte.net>
Re: New Site: www.perlmodules.com nobull@mail.com
Re: New Site: www.perlmodules.com (Randal L. Schwartz)
Re: newb Q, Our perl guy left!! <gellyfish@gellyfish.com>
Re: newb Q, Our perl guy left!! <jtoy@tcgfinancial.com>
Re: newb Q, Our perl guy left!! <jtoy@tcgfinancial.com>
Re: newbie question: rearanging data files <berndt.zeitler@tu-berlin.de>
os type <paul.schwann@systemonic.de>
Re: os type (Tim Hammerquist)
Re: os type (Bernard El-Hagin)
OT: Re: Q: Perl & MS Personal Web Srvr (Tim Hammerquist)
Output of simple PDF-Files with PDF-111? sept00@my-deja.com
Problem using swig under HP-UX <frank.winkler@infineon.com>
Re: Q: Perl & MS Personal Web Srvr (Tim Hammerquist)
readdir (Brian)
Re: readdir (Eric Bohlman)
Re: seeing $main::FOO in used module <newt@veko.ne.mediaone.net>
Re: Sending email with attachment sept00@my-deja.com
set multiple hash elements at one time <david.t.liu@intel.com>
Re: set multiple hash elements at one time (Bernard El-Hagin)
Substitute string <Seb.Erlhofer@evc.net>
Substitute string <Seb.Erlhofer@evc.net>
When I use LIKE I get an error in ASP <a.roberts-west@bigfoot.com>
Re: WHOIS not standart query HELP!!! <gellyfish@gellyfish.com>
Re: WHOIS not standart query HELP!!! <carvdawg@patriot.net>
Re: WWWBoard.PL <tfm@sei.cmu.edu>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 28 Jul 2000 11:31:07 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: 401 header with Perl
Message-Id: <%9eg5.225$Jp2.17546@news.dircon.co.uk>
On Thu, 27 Jul 2000 18:11:27 GMT, lpetre@my-deja.com Wrote:
> I'm using Perl 5.6.0 and I'm trying to make a page that prints a 401
> header, so the browser prompts for a username and password, then I want
> my script to validate that information.
>
> I print the correct headers, and the browser asks for the username and
> password, but after that I don't know where in my code, or how exactly
> to validate the user's input. My script seems to
> keep printing the 401 header over and over again.
>
> I'm using the iPlanet 4.1sp1 webserver and Solaris 8.
>
<http://www.htmlhelp.org/faq/cgifaq.3.html#11>
/J\
------------------------------
Date: Fri, 28 Jul 2000 12:58:26 +0200
From: Federico Abascal <fabascal@gredos.cnb.uam.es>
Subject: [GN]DBM_File question
Message-Id: <39816752.89B2B67B@gredos.cnb.uam.es>
Is it faster to create a [GN]DBM_File and add new keys and values one to
one
for example: while(....) { $tied_hash{...} = "..." } (n times)
or to do:
%tied_hash = %mem_hash (once)
Help is welcome,
Thanks in advance,
Federico
------------------------------
Date: Fri, 28 Jul 2000 12:05:10 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Advanced Perl Programming -- Dated?
Message-Id: <6lt2oscppblhkrvaal78i3p72ucko1da93@4ax.com>
Marcel Grunauer wrote:
>a) you would break loads of programs
>c) such a fundamental change might be pretty confusing for existing
>Perl programmers
But they plan on dumping support for typeglobs, and maybe even stashes.
Won't that break a lot of programs, too?
I think my proposal (from the top of my head, really) is pretty much in
line with that.
--
Bart.
------------------------------
Date: 28 Jul 2000 12:17:29 GMT
From: Steffen Beyer <sb@muccpu1.muc.sdm.de>
Subject: Re: Advanced Perl Programming -- Dated?
Message-Id: <8lrtkp$h76$1@solti3.sdm.de>
In article <6lt2oscppblhkrvaal78i3p72ucko1da93@4ax.com>, Bart Lateur <bart.lateur@skynet.be> wrote:
>>a) you would break loads of programs
>>c) such a fundamental change might be pretty confusing for existing
>>Perl programmers
> But they plan on dumping support for typeglobs, and maybe even stashes.
> Won't that break a lot of programs, too?
> I think my proposal (from the top of my head, really) is pretty much in
> line with that.
And just think about it: Without typeglobs, no aliases for subroutines
or variables anymore, no import of symbols in "use Module qw(...)" anymore,
no "use English;" anymore, etc.!
I do hope there will be some substitute in Perl 6 for this aspect of typeglobs.
Regards,
--
Steffen Beyer <sb@engelschall.com>
http://www.engelschall.com/u/sb/whoami/ (Who am I)
http://www.engelschall.com/u/sb/gallery/ (Fotos Brasil, USA, ...)
http://www.engelschall.com/u/sb/download/ (Free Perl and C Software)
------------------------------
Date: Fri, 28 Jul 2000 08:12:47 -0400
From: James <jamesmckay@MailAndNews.com>
Subject: An email problem
Message-Id: <3983EAD1@MailAndNews.com>
Hi All,
I'm trying to implement a simple script to monitor error logs and mail
an administrator if an error occurs. I've looked at several perl modules,
but
I can't seem to find one that does just this - they all seem to be for
running
an actual mail server. Please can someone give me a simple example of how
to
do this??
Thanks in advance.
James
------------------------------
Date: Fri, 28 Jul 2000 12:09:17 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Boost your bottom line
Message-Id: <put2osk47tqgga8f3e5e2nqslptfo345pt@4ax.com>
Uri Guttman wrote:
> m> Turn your computer into a large scale Usenet news posting machine.
> m> Capture a worldwide audience in an instant!
>
>i wonder how the .us military will handle spammers who use or forge
>their addresses. is 20 years of hard labor too much to ask for?
That post has already been cancelled. Somebody must be watching.
--
Bart.
------------------------------
Date: Fri, 28 Jul 2000 03:40:15 -0700
From: "David T. Liu" <david.t.liu@intel.com>
Subject: Re: Bowling for strings (was: shifting strings )
Message-Id: <8lrqsk$a02@news.or.intel.com>
What does "perl bowling" mean?
"Lauren Smith" <lauren_smith13@hotmail.com> wrote in message
news:8lqo9c$tco$1@brokaw.wa.com...
>
> Keith Calvert Ivey <kcivey@cpcug.org> wrote in message
> news:3983d5e2.6182414@news.newsguy.com...
> > "Lauren Smith" <lauren_smith13@hotmail.com> wrote:
> >
> > >$str1 = 'abcd';
> > >$str2 = reverse join '', (map chop, split //, reverse $str1)[1..length
> > >$str1];
> > >
> > >I don't know why it gives me an uninitialized value warning, though.
> >
> > Because the last element of the list has index length($str1) -
> > 1, not length $str1.
>
> Heh heh... I was hoping that comment got buried...
>
> You are totally correct.
>
> Thanks,
>
> Lauren
> --
> print map{y/a-z//d;$x.="+ $_";chr (eval $x)}
>
'a74b43-c2de1-84f33g45hi1jk5-12-m3n13-82o48p21q13-r6-76s40t25uv2wx8-y6z13-81
> ' =~ /(.{3})/g
>
>
------------------------------
Date: Fri, 28 Jul 2000 12:18:55 GMT
From: wfeidt@cpcug.org (Bill Feidt)
Subject: Re: Bowling for strings (was: shifting strings )
Message-Id: <8F7F507EBwfeidthiscom@207.126.101.97>
david.t.liu@intel.com (David T. Liu) wrote in
<8lrqsk$a02@news.or.intel.com>:
>What does "perl bowling" mean?
Perl bowling is analogous to Perl golf. In golf one
want to minimize the score, in bowling one wants to
maximize it.
Bowling seems to occur when a newbie asks a question
so basic as to defy belief. A recent example was,
"Is there a way in Perl to determine the length of a
string". When bowling, responders provide exceedingly
involved and complex solutions to a problem that could
just as easily been resolved by using a simple Perl
function, for example. All in the spirit of TMTOWTDI,
I'm sure.
HTH,
Bill
wfeidt@cpcug.org
------------------------------
Date: Fri, 28 Jul 2000 10:54:54 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: CGI Execution URGENT
Message-Id: <2Edg5.224$Jp2.17319@news.dircon.co.uk>
On Fri, 28 Jul 2000 08:30:39 +0200, Mouse Wrote:
> @ARRAY=`rsh -l guest ${sys} ls -al`;
>
<snip>
> Do you have any thought about why this is not working as it should be ?
>
Probably because you havent supplied the full path to rsh, but as you
dont show us the error message that you get then its anyones guess.
/J\
------------------------------
Date: Fri, 28 Jul 2000 12:50:35 GMT
From: Rodney Engdahl <red_orc@my-deja.com>
Subject: Re: CGI Execution URGENT
Message-Id: <8lrvip$clu$1@nnrp1.deja.com>
In article <3981288F.1594@yahoo.com>,
Mouse <glodalec@yahoo.com> wrote:
> Hi !
>
> I have a small script:
>
> #!/usr/local/bin/perl -w
> use CGI qw/:standard/;
> $sys = param('sys');
> print "Content-type: text/html\n\n";
> print "<HTML><BODY>\n";
> if( $sys )
> {
> @ARRAY=`rsh -l guest ${sys} ls -al`;
> foreach $A (@ARRAY)
> {
> print $A,"<BR>\n";
> }
> }
> print "</BODY></HTML>\n";
>
> If I run it manually from the UNIX shell, I get following result.
when you run it manually, are you running it as the same uid as the
webserver?
>
> # myscript.pl
> (offline mode: enter name=value pairs on standard input)
> sys=machine1
> ^D
> Content-type: text/html
>
> <HTML><BODY>
> file1 file2 file3 file4
> file5 file6 file7 file8
> </BODY></HTML>
> #
> As you can see, "rsh" was executed properly.
> But If I run the same script from Browser
> http://mymachine/cgi-bin/myscript.pl?sys=machine1,
> then "rsh" is ignored (well, it is not executed).
> Mode of myscript.pl is 755 which is to be ok.
is it ignored, or do you get 'permission denied' in the error log?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 28 Jul 2000 11:26:44 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Checking for a sub before calling
Message-Id: <8lrqlk$73k$1@lublin.zrz.tu-berlin.de>
|Odo| <jasonb885@my-deja.com> wrote in comp.lang.perl.misc:
>I have something similar to:
>
>use strict;
>use AutoLoader;
>
>sub parse {
> my ($self,$func,$some_var) = @_;
> my $result = $self->$$func($some_var);
>}
>
>__DATA__
>
>sub foo { return 'stuff'; }
>
>__END__
What are the __DATA__ and __END__ lines doing?
>
>As it stands, if $$func isn't the name of an existing subroutine or
>autoloadable through SelfLoader, Perl exits with an undefined subroutine
>error.
>
>Is there any way to prevent this from being fatal?
Look into perldoc UNIVERSAL and see if the can method does what you
need. Though I must say that the way parse calls a method looks
pretty convoluted.
Anno
------------------------------
Date: Fri, 28 Jul 2000 10:48:56 GMT
From: tim@degree.ath.cx (Tim Hammerquist)
Subject: Re: Critiques, please
Message-Id: <slrn8o2pq9.ma.tim@degree.ath.cx>
On 28 Jul 2000 08:23:43 GMT, Villy Kruse
<vek@pharmnl.ohout.pharmapartners.nl> wrote:
> On Thu, 27 Jul 2000 23:13:28 GMT, Tim Hammerquist <tim@degree.ath.cx> wrote:
>
> >
> >To my (oft-twisted) mind, rewind() makes the most sense when applied to
> >files. Files (like most tapes) have a beginning and an end. Disk-drives
> >have no physical end or beginning; just dimensions.
> >
>
> However, seek also makes sense because you can seek to any file position.
Yeah, I understand seek() as a more universal method. rewind() makes
much less sense when moving the pointer toward the end of the file. =)
> OK, I think there are no good arguments to prefer one word to the other
> when setting the file point er back to the start of the file.
Sure there are! Preferences aren't good or bad; unless they're for
visual basic... =)
--
-Tim Hammerquist <timmy@cpan.org>
The optimist thinks this is the best of all possible worlds.
The pessimist fears it is true.
-- Robert Oppenheimer
------------------------------
Date: 28 Jul 2000 13:04:50 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Do I Need Chomp? <was Critiques, please>
Message-Id: <964789196.18482@itz.pp.sci.fi>
In article <r7k2oskf294sm4jsgmgkssoqrmcgsp3uth@4ax.com>, Bart Lateur wrote:
>I once filed a bug report on ActiveState on a similar case, where a read
>followed by a print in a RW file didn't work. The reply was that the
>docs for the C library did not garantee that it should work, so that it
>wasn't even considered a bug. I needed to do a seek() before switching
>from reading to printing. I bet they'd say the same thing in this case.
Actually, I've never understood why perl should perpetuate such clib
implementation quirks. Surely it would be possible to remember the
last operation performed on a filehandle, and insert no-op seeks as
necessary without the user having to do so explicitly?
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
"The screwdriver *is* the portable method." -- Abigail
Please ignore Godzilla and its pseudonyms - do not feed the troll.
------------------------------
Date: Fri, 28 Jul 2000 12:53:38 GMT
From: Keith Underwood <keithu@gte.net>
Subject: File IO
Message-Id: <39818182.BED9B933@gte.net>
We use a Job Control System that has 'File Events'. Meaning that I can
tell the JCS to monitor a directory for an incoming file. When it
detects a file, the JCS kicks off a process that does whatever we need
to the file. The problem is, I don't want to start processing on the
file until the file is completely been written to. Some of these files
are 100-200mg, and the JCS will detect them once they start to arrive.
Does Perl have a module or function that will check to see if the file
is still being written to, and if so then sleep and check again, and
again until the file is complete, and then the JCS can start the
processing on the file. I can do this in Unix with Korn Shell but I
need to do it in NT.
Keithu
------------------------------
Date: 28 Jul 2000 12:42:39 +0100
From: nobull@mail.com
Subject: Re: New Site: www.perlmodules.com
Message-Id: <u9lmym4h1s.fsf@wcl-l.bham.ac.uk>
"James" <jthomson110@home.com> writes:
> Please note of a new up and coming centralized site for all info
> regarding Perl Modules.
Is there some reason why you think CPAN is failing?
If so, is there some reason why you can't help to improve CPAN rather than
trying to re-invent the wheel.
Since modules are all about code-reuse and not wheel re-inventing it
seems rather incongruous to re-invent the CPAN wheel.
> Any suggestions for what you would like to see on this site would
> be helpful.
I'd like to see an apology for trying to confuse the issue and a
redirect to CPAN.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 28 Jul 2000 06:03:34 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: New Site: www.perlmodules.com
Message-Id: <m1vgxq4dax.fsf@halfdome.holdit.com>
>>>>> "nobull" == nobull <nobull@mail.com> writes:
nobull> I'd like to see an apology for trying to confuse the issue and a
nobull> redirect to CPAN.
I rejected the same post to comp.lang.perl.announce, if it's any
consolation.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Fri, 28 Jul 2000 10:52:27 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: newb Q, Our perl guy left!!
Message-Id: <LBdg5.223$Jp2.17319@news.dircon.co.uk>
On Thu, 27 Jul 2000 18:03:23 -0400, jtoy Wrote:
> Oh and why would I hire someone if I'm only 18 and probably make more than you
> doing programming and network communications?
>
I very much doubt that.
/J\
------------------------------
Date: Fri, 28 Jul 2000 08:47:09 -0400
From: jtoy <jtoy@tcgfinancial.com>
Subject: Re: newb Q, Our perl guy left!!
Message-Id: <398180CD.E639052E@tcgfinancial.com>
Shit, I'm almost gettting sad that you guys are actually disliking me. :( I'm
sorry, but I don't have time to make shit up.
Jonathan Stowe wrote:
> On Thu, 27 Jul 2000 18:03:23 -0400, jtoy Wrote:
> > Oh and why would I hire someone if I'm only 18 and probably make more than you
> > doing programming and network communications?
> >
>
> I very much doubt that.
>
> /J\
--
Jason Toy
toyboy@toy.eyep.net
jtoy@tcgfinancial.com
http://toy.eyep.net
------------------------------
Date: Fri, 28 Jul 2000 08:52:52 -0400
From: jtoy <jtoy@tcgfinancial.com>
Subject: Re: newb Q, Our perl guy left!!
Message-Id: <39818224.695F4C80@tcgfinancial.com>
Really? Sympathy? Yeah, I want to dump the code, but our website for the time
being is not being hosted here because our T1 isn't coming until next month and
as you know most sites only support perl. I am planning on switching it to
python as soon as hosting resumes back at our site. BTW, I don't talk stupid
shit until they asked for it first.
W Kemp wrote:
> jtoy wrote in message <3980B1AB.6DBC99F2@tcgfinancial.com>...
> >Oh and why would I hire someone if I'm only 18 and probably make more than
> you
> >doing programming and network communications?
> >
>
> Oo-oo-oh, get her.
>
> I started off with some sympathy (think about this word - I don't mean it in
> the hankies out sense) for you.
>
> Now, I wonder why that perl guy left.
>
> PS I'd just dump that original code if I were you.
--
Jason Toy
toyboy@toy.eyep.net
jtoy@tcgfinancial.com
http://toy.eyep.net
------------------------------
Date: Fri, 28 Jul 2000 14:15:40 +0200
From: "berndt zeitler" <berndt.zeitler@tu-berlin.de>
Subject: Re: newbie question: rearanging data files
Message-Id: <8lrte5$psa$1@mamenchi.zrz.TU-Berlin.DE>
Thanks for the hints Larry.
I will hopefully find time soon to formulate my question better.
Tschüß :)
Berndt
PS have you been in germany?
Larry Rosler <lr@hpl.hp.com> wrote in message
news:MPG.13ea6790d9e472cf98abfd@nntp.hpl.hp.com...
> In article <8losm9$i57$1@mamenchi.zrz.TU-Berlin.DE> on Thu, 27 Jul 2000
> 10:44:55 +0200, berndt zeitler <berndt.zeitler@tu-berlin.de> says...
> > Hi Perlers,
> > I'm a newbie to Perl as you could see in the subject.
>
> Putting 'newbie' in the Subject causes many potential responders to
> filter out your post.
>
> > I would like to sort a bunch of data files that are similar to the
listing
> > below,
> > but don't realy know where to start. The single ones ( 1 ) are also
> > sometimes ( -1 ).
> > This is what the files look like:
>
> Even with your follow-up attempt to correct for line folding, there is
> still so much here that it hurts the eyes. If you present a datafile
> where each line has fewer elements and fits within 70 or so characters,
> possibly someone (including me) might be inclined to take a further
> look.
>
> > and this is what i want it to look like:
>
> ...
>
> > 4.000 54,5 57,7 54,5 3,3
> > 5.000 53,8 56,8 53,8 3,1
> > A-Net 61,8 65,9 61,8 4,1
> > Lin 65,5 72,1 65,5 6,6
> >
> > The first row is the frequency. In every second row pair there is a "S"
and
> > a 1 (or -1) pair.
>
> Because there is so much impenetrable input, the correlation to your
> desired output isn't clear to me, though undoubtedly it is to you. Cut
> it down!
>
> > I can load the file into an array:
> >
> > $datafile = "file001.txt";
> > open(DATAFILE,"$datafile") || die "can't open $datafile";
>
> The quotes on $datafile are superfluous; the diagnostic should include
> $!.
>
> > @alldata=<DATAFILE>;
>
> This is correct only if you cannot process the file line-by-line.
>
> > and get the frequency:
> >
> > @freq=split(/\s*\"S\s*\"/,@alldata[1]);
>
> Quotes aren't regex metacharacters, so don't escape them. The argument
> should be a scalar, not an array slice. Use the '-w' flag to warn you
> of such things.
>
> And here is where you lose me.
>
> > and i was thinking of putting each row pair:
> >
> > "S" 50.0 "S" 63.0 "S" 80.0 "S" 100 "S" 125 "S" 160 "S"
200
> > "S" 250 "S" 315 "S" 400 "S" 500 "S" 630 "S" 800 "S"
1000
> > "S" 1250 "S" 1600 "S" 2000 "S" 2500 "S" 3150 "S" 4000 "S"
5000
> > 1 45.1 1 47.1 1 48.6 1 61.0 1 51.0 1 49.1 1
57.7
> > 1 51.1 1 49.8 1 48.3 1 48.8 1 42.7 1 42.5 1
41.8
> > 1 45.7 1 48.0 1 48.4 1 51.4 1 54.2 1 54.5 1
53.8
> >
> > into a hash array,
> >
> > %FreqIeq=@alldata[1,2];
> > %FreqLeq=@alldata[7,8];
> > %FreqLw=@alldata[10,11];
> > %FreqLk=@alldata[16,17];
>
> Now array slices might make sense, but I'm not able easily to correlate
> them to your mass of data.
>
> > print"$FreqIeq{@freq}";
> >
> > but this doesn't seem to work like this.
> >
> > do i have to transpose it and use qw() too?
>
> I doubt about the transpose, but who knows? qw() is a word-quoting
> mechanism, which is irrelevant here.
>
> > please help me out on this, or tell me where i can find some more
> > information and what functions i should look at.
>
> Help us to help you by simplifying the input and clarifying the problem
> description.
>
> > thanks a lot in advance.
> > ciao for now,
>
> Tschüß! (I hope I spelled that right. :-)
>
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Laboratories
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com
------------------------------
Date: Fri, 28 Jul 2000 14:29:50 +0200
From: Paul Schwann <paul.schwann@systemonic.de>
Subject: os type
Message-Id: <39817CBE.327BF9B3@systemonic.de>
Hi folks,
is there a way to determine the os or at least the platform type within
a perl script? (like os == "WINDOWS", os == "UNIX", os == "SOLARIS"
etc.)
Paul
------------------------------
Date: Fri, 28 Jul 2000 12:50:33 GMT
From: tim@degree.ath.cx (Tim Hammerquist)
Subject: Re: os type
Message-Id: <slrn8o30ua.2lu.tim@degree.ath.cx>
On Fri, 28 Jul 2000 14:29:50 +0200, Paul Schwann
<paul.schwann@systemonic.de> wrote:
> is there a way to determine the os or at least the platform type within
> a perl script? (like os == "WINDOWS", os == "UNIX", os == "SOLARIS"
> etc.)
Try the $^O variable. (That's the letter 'oh'.)
It may not be the exact format you want, or even consistent among
builds. (ActiveState and MKS builds return differing strings for
Win32 os's.) However, it should be sufficently conclusive.
HTH,
--
-Tim Hammerquist <timmy@cpan.org>
Programmers are achievement oriented; give them an impossible task,
and they'll do their best to give you what they think you would have
asked for if you had a clue as to what was possible.
-- Peter Coffee, PC Week
------------------------------
Date: Fri, 28 Jul 2000 13:04:17 GMT
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: os type
Message-Id: <slrn8o30tl.61h.bernard.el-hagin@gdndev25.lido-tech>
On Fri, 28 Jul 2000 14:29:50 +0200, Paul Schwann
<paul.schwann@systemonic.de> wrote:
>Hi folks,
>
>is there a way to determine the os or at least the platform type within
>a perl script? (like os == "WINDOWS", os == "UNIX", os == "SOLARIS"
>etc.)
perldoc perlvar
Bernard
--
perl -le 'open(JustAnotherPerlHacker,"")or$_="B$!e$!r$!n$!a$!r$!d$!";
print split/No such file or directory/;'
------------------------------
Date: Fri, 28 Jul 2000 10:55:13 GMT
From: tim@degree.ath.cx (Tim Hammerquist)
Subject: OT: Re: Q: Perl & MS Personal Web Srvr
Message-Id: <slrn8o2q63.ma.tim@degree.ath.cx>
On Thu, 27 Jul 2000 19:28:20 -0700, Dan Burch <dburch@teleport.com> wrote:
> "Daniel M. Farrell" wrote:
> >
> > Hey ..
> >
> > Re: Running Perl in Web like environment on
> > stand alone Win 95 PC.
>
> Not really a perl question, but...Get Apache(for free at
> http://www.apache.org/) and you can run it in a more web like
> enviroment.
Oh come now! It's so much more ON-topic than these damn "Is PHP better
than Perl?" questions, and variations thereof! =)
--
-Tim Hammerquist <timmy@cpan.org>
Nearly all men can stand adversity, but if you
want to test a man's character, give him power.
-- Abraham Lincoln
------------------------------
Date: Fri, 28 Jul 2000 10:19:43 GMT
From: sept00@my-deja.com
Subject: Output of simple PDF-Files with PDF-111?
Message-Id: <8lrmns$6km$1@nnrp1.deja.com>
I am working on a system that writes invoices as PDF_documents and
sends them off as emails. For the creation of the files I use PDF-
Create version 0.01 by Fabio Tassin (I think that's his name). But
there are problems when the invoices get longer than 1 page, I think
this is a bug in his module.
Since all of this is taking place on a remote web server without
pdflib, I don't know which module to use. The PDF-111 module isn't that
well documented, so I was wondering if anybody could help me out by
writing a short snippet of sample code to
1. create a new PDF-document
2. output Text and simple lines to it
3. inserting a new page and text on it
4. creating the index for the document
5. closing and saving it.
If this is to much, please point me in the direction where I could find
sample source code like this if you know of one.
Thank you very, very, very much!
Tom
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 28 Jul 2000 13:16:44 +0200
From: Frank Winkler <frank.winkler@infineon.com>
Subject: Problem using swig under HP-UX
Message-Id: <39816B9C.BAC0C151@infineon.com>
Hello,
I got a problem using swig under HPUX.
I hope this is the right news-group, i not, plc, let me know it
TNX.
The problem occurs when i compile the example_wrap.c-file:
%>aCC -c -I/$PERLINC example_wrap.c
Error 172: "example_wrap.c", line 292 # Undeclared variable 'sv_undef'.
} else if (sv == &sv_undef) { /* Check for undef */
^^^^^^^^
Error 203: "example_wrap.c", line 411 # Cannot assign 'int
(*)(interpreter *,sv *,magic *)' with 'int (*)(sv *,magic *)'.
mg->mg_virtual->svt_get = get;
^^^
Error 203: "example_wrap.c", line 412 # Cannot assign 'int
(*)(interpreter *,sv *,magic *)' with 'int (*)(sv *,magic *)'.
mg->mg_virtual->svt_set = set;
^^^
Error 497: "example_wrap.c", line 536 # There can be only one function
'boot_example' with "C" linkage; previous
declaration was at ["example_wrap.c", line 426].
XS(boot_example) {
^^
Error 172: "example_wrap.c", line 560 # Undeclared variable 'sv_yes'.
ST(0) = &sv_yes;
The OS is HP-UX A 9000 / 871 B.10.20
Perl is v5.6.0 for PA-RISC2.0-multi
Is such a problem known for the OS ?
------------------------------
Date: Fri, 28 Jul 2000 11:10:54 GMT
From: tim@degree.ath.cx (Tim Hammerquist)
Subject: Re: Q: Perl & MS Personal Web Srvr
Message-Id: <slrn8o2r3c.ma.tim@degree.ath.cx>
On Thu, 27 Jul 2000 17:49:50 -0600, Daniel M. Farrell
<dfarrell@informix.com> wrote:
> I have Microsoft Peronal Web Server (PWS)
> installed on my Win 95 PC. PWS came with
> Microsoft Front Page version 3.0.2.926. Personal
> Web Server seems to work fine. I have HTML
> forms and graphics being served.
>
> Question: Is it possible to execute Perl CGI scripts
> in this type of environment ? Is anyone else doing
> this ?
Yes and no. Personal Web Server 4+ _can_ execute CGI and ASP
applications, as well as server-side includes. I doubt the
version that came with MicroSloth FrumpCage can do this, tho.
Unless you upgrade to Win98 Second Edition (whose install disk contains
a PWS version that _will_ do what you want), you might just have to
search the Microsoft site. *gasp!* Not _anyone's_ idea of a good time,
but if you need to develop ASP pages in JScript and VBScript like I did,
it's the only way.
If you are successful up to this point, you can still look forward to
asking questions on countless mailing lists and newsgroups that have
been asked thousands of times before and probably getting flamed for
your trouble.
OR!
Do as suggested and get Apache, preferably with mod_perl linked
statically. [ Yes, this _is_ available for Win32 as well (I used it),
but I'm not sure where. Sorry. :( ] The possibilities are endless after
that.
--
-Tim Hammerquist <timmy@cpan.org>
Familiarity breeds contempt -- and children.
-- Mark Twain
------------------------------
Date: Wed, 26 Jul 2000 22:29:48 GMT
From: bpontz@e-dialog.com (Brian)
Subject: readdir
Message-Id: <397f648d.689612600@news1.channel1.com>
I have dir that has over 43,000 files in it. Yes I know that this is
bad. I'm trying to write a script that "archives" them if they are
over so many days old. Now the problem I'm at now is that I dont know
how to "process" each one with out reading them all into a
array(memory) with readdir. Does anyone know how to do this? Would the
below way be a good way or are all the file names still put in memory?
#!/usr/bin/perl
use strict;
opendir(DIR, "/my/path") || die "Couldnt open dir: $!\n";
foreach my $file (readdir(DIR)) {
# archive them
}
close(DIR);
Thanks
Brian
------------------------------
Date: 28 Jul 2000 12:36:20 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: readdir
Message-Id: <8lruo4$cid$1@slb7.atl.mindspring.net>
Brian (bpontz@e-dialog.com) wrote:
: I have dir that has over 43,000 files in it. Yes I know that this is
: bad. I'm trying to write a script that "archives" them if they are
: over so many days old. Now the problem I'm at now is that I dont know
: how to "process" each one with out reading them all into a
: array(memory) with readdir. Does anyone know how to do this? Would the
: below way be a good way or are all the file names still put in memory?
:
: #!/usr/bin/perl
:
: use strict;
:
: opendir(DIR, "/my/path") || die "Couldnt open dir: $!\n";
:
: foreach my $file (readdir(DIR)) {
This puts readdir() in a list context, so it reads all the filenames into
memory (an anonymous temporary list) and then loops over them. If you
replace it with:
while (defined(my $file=readdir(DIR))) {
you'll be calling readdir() in a scalar context, so it will read only one
name at a time. You need the "defined" test because "0" is a legal file
name, and you don't want to abort the loop prematurely if you encounter it.
: # archive them
: }
:
: close(DIR);
------------------------------
Date: Fri, 28 Jul 2000 12:29:27 GMT
From: <newt@veko.ne.mediaone.net>
Subject: Re: seeing $main::FOO in used module
Message-Id: <H0fg5.51236$Q8.409037@typhoon.ne.mediaone.net>
Ilmari Karonen <iltzu@sci.invalid> wrote:
> In article <rgMf5.50354$Q8.388049@typhoon.ne.mediaone.net>, newt@veko.ne.mediaone.net wrote:
>>--------foo.pl-------
>>#!/usr/bin/perl
>>$VAL = "HI";
>>use bar;
>>---------------------
> "use" is a compile-time directive. It is executed first, no matter
> where you put it.
Thanks a million! I tried perlmod docs and 'perltoot' but couldn't
find anything that really pertained to this case. I guess I should
have known, but ... thanks!
------------------------------
Date: Fri, 28 Jul 2000 10:28:03 GMT
From: sept00@my-deja.com
Subject: Re: Sending email with attachment
Message-Id: <8lrn7g$70a$1@nnrp1.deja.com>
Let me try answering this with a short code snippet using MIME::Lite.
I'm not that much of an expert, so please correct me if I'm wrong:
use MIME::Lite;
my $msg = MIME::Lite->new(
From => $from_address,
To => $to_address,
Subject => $subject,
Type => 'TEXT',
Data => $body
);
$msg->attach(
Type => $attachment_type,
Path => $attachment_path,
);
$msg->send();
That's what works for my and it is doing VERY well. No need to reads
RFCs.
Take it easy and take long breaks,
Tom
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 28 Jul 2000 03:39:43 -0700
From: "David T. Liu" <david.t.liu@intel.com>
Subject: set multiple hash elements at one time
Message-Id: <8lrntf$97j@news.or.intel.com>
I remember reading somewhere a one-liner for setting a list of hash
elements. For example:
@keys = (1,2,3);
@values = (a,b,c);
$hash{@keys} = @values;
-->
Yields %hash = {1 => a, 2 => b, 3 => c}
Of course, this doesn't actually work but does anybody know of a way to do
what I am trying to accomplish here?
Thanks.
David
------------------------------
Date: Fri, 28 Jul 2000 11:37:49 GMT
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: set multiple hash elements at one time
Message-Id: <slrn8o2rri.61h.bernard.el-hagin@gdndev25.lido-tech>
On Fri, 28 Jul 2000 03:39:43 -0700, David T. Liu <david.t.liu@intel.com> wrote:
>I remember reading somewhere a one-liner for setting a list of hash
>elements. For example:
>
>@keys = (1,2,3);
>@values = (a,b,c);
>
>$hash{@keys} = @values;
>-->
>Yields %hash = {1 => a, 2 => b, 3 => c}
>
>
>Of course, this doesn't actually work but does anybody know of a way to do
>what I am trying to accomplish here?
Do you mean something like this:
__________________
#!/usr/bin/perl -w
use strict;
my %hash;
my @keys = qw/1 2 3/;
my @values = qw/a b c/;
@hash{@keys} = @values;
print %hash;
__________________
Bernard
--
perl -le 'open(JustAnotherPerlHacker,"")or$_="B$!e$!r$!n$!a$!r$!d$!";
print split/No such file or directory/;'
------------------------------
Date: Fri, 28 Jul 2000 12:40:14 +0200
From: Sebastian Erlhofer <Seb.Erlhofer@evc.net>
Subject: Substitute string
Message-Id: <6ko2os8843ppvb24u50u6n654ebk3b53g9@4ax.com>
Hi
Can someone give me the code for this:
Convert "../../mine.zip" -> "../mine.zip"
It should also convert "../../../../../../../../../../mine.zip" to
"../mine.zip"
Tnx
Seb
------------------------------
Date: Fri, 28 Jul 2000 13:10:50 +0200
From: Sebastian Erlhofer <Seb.Erlhofer@evc.net>
Subject: Substitute string
Message-Id: <7hq2os8ko86n04fhk625goj7nq9kheuira@4ax.com>
$To =~ s/\.\.\/..\///g;
This is it...
I found out myself :)
>Hi
>
>Can someone give me the code for this:
>
>Convert "../../mine.zip" -> "../mine.zip"
>It should also convert "../../../../../../../../../../mine.zip" to
>"../mine.zip"
------------------------------
Date: Fri, 28 Jul 2000 13:46:18 -0000
From: "Anthony Roberts-West" <a.roberts-west@bigfoot.com>
Subject: When I use LIKE I get an error in ASP
Message-Id: <398180a5@eeyore.callnetuk.com>
I am currently learning how to use ASP and Access.
A problem I cannot seem to solve.
I am using Access and ASP pages that use parameter queries to access a
database from a website.
The problem I am having is when ASP receives input from an HTML form. The
form works OK, but when ASP tries to query the database, it seems that my
syntax for the LIKE command is not right and it cannot query the database.
What am I doing wrong? I have followed what it says in the book and am
still stuck. It works ok in access as a parameter query but not in ASP.
Hope someone can help
Anthony.
a.roberts-west@bigfoot.com
The HTML form page looks like this.
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type"
CONTENT="text/html;charset=windows-1252">
<TITLE>Houses with matching features</TITLE>
<BODY>
<FORM METHOD="GET" ACTION="matchingfeatures.asp">
[Enter Details (*within asterisks*)] <INPUT TYPE="Text" NAME="[Enter Details
(*within asterisks*)]"><P>
<INPUT TYPE="Submit" VALUE="Run Query">
</FORM>
</BODY>
</HTML>
The asp database page looks like this.
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type"
CONTENT="text/html;charset=windows-1252">
<TITLE>Houseswithmatchingfeatures</TITLE>
</HEAD>
<BODY>
<%
Param = Request.QueryString("Param")
Data = Request.QueryString("Data")
%>
<%
If IsObject(Session("DSNAnthony_conn")) Then
Set conn = Session("DSNAnthony_conn")
Else
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "DSNAnthony","",""
Set Session("DSNAnthony_conn") = conn
End If
%>
<%
sql = "SELECT Properties.[Property ID], Properties.MarketingComment,
Properties.Price FROM Properties WHERE ((Properties.MarketingComment)
Like " & Request.QueryString("[Enter Details (*within asterisks*)]") &
") "
If cstr(Param) <> "" And cstr(Data) <> "" Then
sql = sql & " And [" & cstr(Param) & "] = " & cstr(Data)
End If
Response.Write sql
' Set rs = Server.CreateObject("ADODB.Recordset")
' rs.Open sql, conn, 3, 3
%>
<TABLE BORDER=1 BGCOLOR=#ffffff CELLSPACING=0><FONT FACE="Arial" COLOR
#000000><CAPTION><B>Houseswithmatchingfeatures</B></CAPTION>
<THEAD>
<TR>
<TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT SIZE=2 FACE="Arial"
COLOR=#000000>Property ID</FONT></TH>
<TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT SIZE=2 FACE="Arial"
COLOR=#000000>MarketingComment</FONT></TH>
<TH BGCOLOR=#c0c0c0 BORDERCOLOR=#000000 ><FONT SIZE=2 FACE="Arial"
COLOR=#000000>Price</FONT></TH>
</TR>
</THEAD>
<TBODY>
<%
On Error Resume Next
rs.MoveFirst
do while Not rs.eof
%>
<TR VALIGN=TOP>
<TD BORDERCOLOR=#c0c0c0 ><FONT SIZE=2 FACE="Arial"
COLOR=#000000><%=Server.HTMLEncode(rs.Fields("Property
ID").Value)%><BR></FONT></TD>
<TD BORDERCOLOR=#c0c0c0 ><FONT SIZE=2 FACE="Arial"
COLOR=#000000><%=Server.HTMLEncode(rs.Fields("MarketingComment").Value)%><BR
></FONT></TD>
<TD BORDERCOLOR=#c0c0c0 ALIGN=RIGHT><FONT SIZE=2 FACE="Arial"
COLOR=#000000><%=Server.HTMLEncode(rs.Fields("Price").Value)%><BR></FONT></T
D>
</TR>
<%
rs.MoveNext
loop%>
</TBODY>
<TFOOT></TFOOT>
</TABLE>
</BODY>
</HTML>
It appears to be the sql = "SELECT statement that has a problem where the
LIKE keyword is used.
------------------------------
Date: Fri, 28 Jul 2000 10:19:22 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: WHOIS not standart query HELP!!!
Message-Id: <K6dg5.220$Jp2.17313@news.dircon.co.uk>
On Fri, 28 Jul 2000 01:31:03 GMT, ilbot@my-deja.com Wrote:
> NO, i'm trying to build my own WHOIS page and it works but it returns
> some info only in case i supply $CheckingName as a DOMAIN NAME
> BUT i need to get the list of domain mnames that are belong to some
> person so what kind of query should i send to whois server?
>
> i just can't find the documentation about whois server's query format
There isnt one or rather it depends on the server.
<ftp://ftp.isi.edu/in-notes/rfc954.txt>
/J\
------------------------------
Date: Fri, 28 Jul 2000 07:07:27 -0400
From: H C <carvdawg@patriot.net>
Subject: Re: WHOIS not standart query HELP!!!
Message-Id: <3981696F.84C0D9EC@patriot.net>
Jon's right..there isn't one. That's why allwhois.com uses a big text box
for it's replies,
and not specific fields.
Jonathan Stowe wrote:
> On Fri, 28 Jul 2000 01:31:03 GMT, ilbot@my-deja.com Wrote:
> > NO, i'm trying to build my own WHOIS page and it works but it returns
> > some info only in case i supply $CheckingName as a DOMAIN NAME
> > BUT i need to get the list of domain mnames that are belong to some
> > person so what kind of query should i send to whois server?
> >
> > i just can't find the documentation about whois server's query format
>
> There isnt one or rather it depends on the server.
>
> <ftp://ftp.isi.edu/in-notes/rfc954.txt>
>
> /J\
------------------------------
Date: Fri, 28 Jul 2000 07:46:05 -0400
From: Ted Marz <tfm@sei.cmu.edu>
Subject: Re: WWWBoard.PL
Message-Id: <3981727D.840859FE@sei.cmu.edu>
Neil (and others),
with all of your comments undoubtably being true (I have looked at the
code as well, and don't like it particularly),
what would be people's recommendations for the best (or at least good),
Free (or cheap, like, under $100) message board processing script (or
collection of scripts)?
Ted Marz
------------------------------
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 3831
**************************************