[13054] in Perl-Users-Digest
Perl-Users Digest, Issue: 464 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 11 16:07:17 1999
Date: Wed, 11 Aug 1999 13:05:17 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 11 Aug 1999 Volume: 9 Number: 464
Today's topics:
Re: array and file processing <hgonzalez@mindspring.com>
Re: array and file processing (Alan Curry)
Re: Browser detection - write different html <flavell@mail.cern.ch>
cgi ==> top sites thingy.. arpith@hotmail.com
Re: CGI timeout problem (Steve Linberg)
Re: CGI timeout problem <makkulka@cisco.REMOVETHIS.com>
Re: CGI timeout problem (Steve Linberg)
Re: CHMOD function <aqumsieh@matrox.com>
Re: Comm package <Monty.Scroggins@mci.com>
Comma seperated numbers <paulm@dirigo.com>
Re: Flocking, whassat? <flexit@flexit.eurobell.co.uk>
Re: Getting perl to accept a flat table file <cassell@mail.cor.epa.gov>
Re: hash in record <aqumsieh@matrox.com>
Re: Help - Split Function Blowing My Mind Away!! <aqumsieh@matrox.com>
Re: How to create unix install executables? <rootbeer@redcat.com>
Re: How to share constants across modules? <rootbeer@redcat.com>
Re: Illegal division by zero when testing for a directo <rootbeer@redcat.com>
Re: Improving speed of a sub <aqumsieh@matrox.com>
Re: is our reese the author of mysql book? <toby@hercules.cas.utk.edu>
Re: Japanese Girl Needs Help. <makarand_kulkarni@my-deja.com>
JavaScript recieving variables from Perl <david@math.edu>
Re: Looking for a good Perl Book <aqumsieh@matrox.com>
Re: Newbie has <FILE> Problem - please help <rootbeer@redcat.com>
Re: Newbie help with typeglobs <rootbeer@redcat.com>
Newbie: Looking for help/info on Sockets with Win32 (Chris)
Newbie: MailTo Script Problem? <firebrand@mail.usa.com>
Newbie: Sockets on Win32 (Chris)
perl modules in C++ <r47652@email.sps.mot.com>
Re: perl on linux <aqumsieh@matrox.com>
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 11 Aug 1999 14:08:19 -0400
From: Hector Gonzalez <hgonzalez@mindspring.com>
To: Uri Guttman <uri@sysarch.com>
Subject: Re: array and file processing
Message-Id: <37B1BC12.1648672@mindspring.com>
Hi,
I am very sorry. We will work on fixing the formatting.
Uri Guttman wrote:
> hey, questionexchange,
>
> any chance you could use a proper newsreader and not mangle the quoted
> text? it is impossible to read the code when you wrap it to hell. so
> stop hiding behind your website and just read and post here directly.
>
> 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
> "F**king Windows 98", said the general in South Park before shooting Bill.
--
QuestionExchange, the Knowledge Marketplace.
http://www.questionexchange.com
------------------------------
Date: Wed, 11 Aug 1999 18:28:05 GMT
From: pacman@defiant.cqc.com (Alan Curry)
Subject: Re: array and file processing
Message-Id: <Vgjs3.3852$DY2.185962@typ11>
In article <37B1BC12.1648672@mindspring.com>,
Hector Gonzalez <hgonzalez@mindspring.com> wrote:
>I am very sorry. We will work on fixing the formatting.
Did you ever think of using a test group for testing, instead of inflicting
an untested product on real groups?
--
Alan Curry |Declaration of | _../\. ./\.._ ____. ____.
pacman@cqc.com|bigotries (should| [ | | ] / _> / _>
--------------+save some time): | \__/ \__/ \___: \___:
Linux,vim,trn,GPL,zsh,qmail,^H | "Screw you guys, I'm going home" -- Cartman
------------------------------
Date: Wed, 11 Aug 1999 20:52:39 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Browser detection - write different html
Message-Id: <Pine.HPP.3.95a.990811202629.21073M-100000@hpplus03.cern.ch>
On Wed, 11 Aug 1999, Frank Krul wrote:
> First of all let me apologize for most of these respondents.
Troll.
> Truly this newsgroup does have a few helpful souls.
Indeed it does, and I believe I know them when I see them.
Their help isn't always palatable, nor does it always confirm the
prejudices of the questioner. It is, however, the product of their
experience and expertise, and always has the capacity to be helpful to
those who are willing to receive it. I can confidently say that I have
often benefited from it (in many cases by reading their answer to some
ungrateful slob who promptly flames them for it), and now and again
when I see something that I believe I understand, I try to repay that by
stepping in myself.
> #1: Even though some people say otherwise, since 94 my stats from a number of
> different servers have never had problem identifying the HTTP_USER_AGENT
> environment variable from any client.
I'm glad to hear that you get such good results. Can you read Chinese?
Some of the user agent strings in my server logs appear to be in
Chinese, but I can't read that. Another entry says NOYDB: are you
familair with that client? Another popular one that turns up quite
often claims to run under the CP/M 8-bit operating system.
> Any browser that does not follow the
> HTTP1.0 or 1.1 protocol and identify itself is non-standardized,
When did you last read those documents?
rfc2616 says, inter alia:
User agents SHOULD include this field with requests.
I'm sure you're familiar with RFC terminology and well able to
interpret the meaning of that.
> and I've never see one.
You've led a sheltered life, it seems.
Now, pray tell the assembled usenauts how your server will handle
the large number of occasions when clients get the page from their
local proxy cache server - without any reference to your server?
> #2 Do this is in Javascript. It's easy, your server is less utilized
> allowing it to dessiminate pages instead of making decisions for those
> who don't know what browser they have.
Now this could be the basis of a viable solution, if your basic content
works on clients that have javascript turned off (as recommended in the
security advice from the vendors) or filtered out at the corporate
firewall, but applies optional enhancements on those browsers that have
it enabled.
> #3 This is a perl newsgroup, go here:
> http://developer.netscape.com
> to get the code and get lost. ;)
If you're interested in building pages for the WWW, then the vendor's
own advice, with its unstated mixture of techniques, some of which are
portable and some designed to lock users into their particular brand of
software, is probably the last place you should go.
If you wanted to make it clear that this was off-topic for perl, you
should have done so, by not offering a comprehensive answer here.
I apologise to the residents, but I felt compelled to respond in kind.
--
"I have no problem with cute and clever. In fact I actually _like_ cute
and clever. I don't think it's clever to be cute in such a way as to
make the pages less useful. But then I'm not a graphic designer."
- Calum I Mac Leod on c.i.w.a.site-design
------------------------------
Date: Wed, 11 Aug 1999 18:23:08 GMT
From: arpith@hotmail.com
Subject: cgi ==> top sites thingy..
Message-Id: <7osf1u$k83$1@nnrp1.deja.com>
Hi,
My top sites perl script.. well I want it to automatically create the
HTML of top sites once a day. So the first person on the particular
day.. will have to wait as the script sorts the ranks of all sites
(that could be anywhere from 200-1000 sites??) and then print the HTML
file (for the first 200 sites) along with detailed desc. on the site
(which is accesed from individual files). This could take a LOONNGG
time.. I dunno... but I REALLY want to know if this is a good design for
the top sites...
Also, what happens if the CGI script is stopped midway ? all is lost? Do
I have to wait for the next user to comeby ? or will the script finish
writing the HTML file before shutting down ?
any help will be appreciated thanks,
Arpith.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 11 Aug 1999 14:30:21 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: CGI timeout problem
Message-Id: <linberg-1108991430220001@ltl1.literacy.upenn.edu>
In article <37B1B053.6FE6BA38@cat.com>, "Duane G. Meyer" <diggem@cat.com> wrote:
> I did a 'little' bit of searching and couldn't seem to come up with any
> info about this.
This is not a good way to start a post to this newsgroup. Your next step
should probably be to do a 'lot' of searching, not give up. In the time
it took you to write this post and wait for answers, you would almost
certainly have found the answers you need with some focused searching.
> I have a CGI script
...written in Perl, presumably?
> which is used to migrate files from one server to
> another. It basically writes out a simple shell script with the commands
> needed to get the files where they are going. My problem is when I have
> a LARGE number of files, the browser wants to think the connection is
> dead and gives up.
The browser is probably correct. The connection probably really is dead.
How is your server configured?
> What I want to do is, while this shell process is
> running, print something to the brower every so often to keep it
> 'entertained'. What's a good way to accomplish this? Fork off a process?
It sounds like you need to learn more about HTTP connections. They aren't
live channels. And anyway, why do you need to "entertain" the browser?
Why not just have your code create a page that contains the status of the
operation, so the user can quickly check it at any point without tying up
resources?
> Mebbe I should read up on forking, but that just sounds a little messy.
It can be messy, but that's no reason not to read up on it.
> Anyway, while I read a little more, if anybody has a ready answer, I
> would appreciate some help.
I'd suggest posting your question in comp.infosystems.www.authoring.cgi,
comp.infosystems.www.servers.unix (or whatever your flavor is), or both.
Your problem doesn't seem to be Perl-related.
Good luck!
--
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
Be kind. Remember, everyone you meet is fighting a hard battle.
print 'Just Another Perl ' . $perl_hierarchy[(USER+EXPERT)/2];
------------------------------
Date: Wed, 11 Aug 1999 12:03:57 -0700
From: Makarand Kulkarni <makkulka@cisco.REMOVETHIS.com>
Subject: Re: CGI timeout problem
Message-Id: <37B1C91D.926C5544@cisco.REMOVETHIS.com>
[
Duane G. Meyer wrote:
>What I want to do is, while this shell process is
> running, print something to the brower every so often to keep it
> 'entertained'. What's a good way to accomplish this?
]
Keeping the browser entertained is a good idea but why use
dummy data if you can capture the progress reporting messages
of the shell script itself and redirect to the browser. You
will have to write to write your shell script such that it
will print out something to stdout every now and then keeping
the user informed of what is happening behind the scenes..
eg. Copied/Migrated dir1 to dir2 ..
eg. Error migrating dir3..
Your CGI script can capture these messages for display on browser
with code like this (uses CGI.pm and captures STDOUT from standard ls
command )-
use CGI;
$page = new CGI || die "...";
print $page->header ;
print $page->start_html ();
open (PR, "ls -ltr | " ) or die " Cannot open...". $! ;
while (<PR>)
{
print $_, "<BR>" ;
}
print $page->end_html ();
------------------------------
Date: Wed, 11 Aug 1999 15:32:55 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: CGI timeout problem
Message-Id: <linberg-1108991532550001@ltl1.literacy.upenn.edu>
In article <linberg-1108991430220001@ltl1.literacy.upenn.edu>,
linberg@literacy.upenn.edu (Steve Linberg) wrote:
> In article <37B1B053.6FE6BA38@cat.com>, "Duane G. Meyer"
<diggem@cat.com> wrote:
>
> > What I want to do is, while this shell process is
> > running, print something to the brower every so often to keep it
> > 'entertained'. What's a good way to accomplish this? Fork off a process?
>
> It sounds like you need to learn more about HTTP connections.
Duane,
Rereading this, it sounds harsher than I intended. I apologize if it
sounded condescending, I didn't mean it that way.
What I *meant* to say is it sounds like you're overcomplicating the task.
Rather than try to force the server and browser to stay connected during a
task of arbitrary duration, tying up a connection and potentially denying
or slowing others, it often makes more sense to have a task in process,
and another task monitoring that process and generating status snapshots
(pages, or whatever) that can be quickly checked by anyone who cares,
rather than trying to make the server track it "live" when there's no real
need. Or have the process generate its own snapshots as it goes, which is
even easier.
Again, apologies if I came off the wrong way. Good luck.
--
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
Be kind. Remember, everyone you meet is fighting a hard battle.
print 'Just Another Perl ' . $perl_hierarchy[(USER+EXPERT)/2];
------------------------------
Date: Wed, 11 Aug 1999 13:45:15 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: CHMOD function
Message-Id: <x3yu2q69pp1.fsf@tigre.matrox.com>
Tom Briles <sariq@texas.net> writes:
> $OrignialLogFile = 'sample.txt';
>
> You recommended:
>
> $orig="sample.txt";
>
> 1) The only difference is single quotes vs. double.
> 2) If one works, both work. Yours is slower because Perl has to look
> for things to interpolate.
I don't think so. I believe that both of them should generate the same
byte code when compiled. So both should have the same speed.
Ala
------------------------------
Date: Wed, 11 Aug 1999 19:53:20 GMT
From: "Monty Scroggins" <Monty.Scroggins@mci.com>
Subject: Re: Comm package
Message-Id: <Qwks3.1374$8X1.122632@PM01NEWS>
> sure you want telnet? rlogin would do? rsh?
Yes I have to telnet. rlogin or rsh wont do.. not that I can see
what difference it would make in respect to the problem.
>
> > have the terminal stay up for an interactive session???
>
> have the terminal stay up? Huh? The terminal always stays up for me.
The terminal wont stay up if the script was called like -
xterm <options> -e script.pl.
I can telnet to a host perfom some command in the script but once the
commands are completed the telnet session is closed and therefore I
lose my termial. I want to have the terminal stay up and remain active
so I can interactively use the terminal connection until I manually exit.
>
> Net::Telnet wasn't really meant to be interactive.
Excuse me?? In the Telnet.pm module, it contains an example of
using the module for an interactive session. This is exactly what I
was doing... but I was getting an odd behavior from the terminal when
it was put in this interacive mode. (via Comm.pl) and therefore the post to
the newsgroup.
------------------------------
Date: Wed, 11 Aug 1999 19:46:56 GMT
From: Stone Cold <paulm@dirigo.com>
Subject: Comma seperated numbers
Message-Id: <7osjve$nr4$1@nnrp1.deja.com>
I have a CGI script outputting various numbers to a web page. The
numbers are coming out as follows: $1720600 (notice there are no
commas).
I've read a little about how to use a commify subroutine, but I'm not
sure how to implement it. My values are a part of an outputted html
table and I'm not sure where to call the subroutine COMMIFY in my
script. Here is the subroutine...think it will work?
sub commify {
my $text = reverse $_[0];
$text =~ s/(\d\d\d)(?=\d)(?!\d*\.)/$1,/g;
return scalar reverse $text;
}
So if I needed to seperate my larger numbers with commas for every 3
numbers from the right, I would call this routine. But where do I call
it? Is it before the print statement? Is it right next to the
variable I have setup to get me the output?
HELP.
Thanks.
--
Paul R. Mesker
System Engineer
Dirigo Inc.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 11 Aug 1999 20:36:26 +0100
From: "Troy Knight" <flexit@flexit.eurobell.co.uk>
Subject: Re: Flocking, whassat?
Message-Id: <7osj54$5g9$1@aub.eurobell.net>
great, thanks... you explain it well there, and the rest I can understand
from the docs...
troy
------------------------------
Date: Wed, 11 Aug 1999 12:51:59 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Getting perl to accept a flat table file
Message-Id: <37B1D45F.1B2F9BFE@mail.cor.epa.gov>
Paul Foran wrote:
>
> Andreas Fehr wrote:
>
> > On Wed, 11 Aug 1999 09:21:20 +0100, Paul Foran <Paul.Foran@analog.com>
> > wrote:
> >
> > >Can somebody tell me how to get perl to accept a comma delimited txt
> > >file and parse it contents.
> >
> > Yes, write some Perl code and run it with the filename as parameter.
> >
> > Andreas
>
> How can I do this exactly???
> paul.
Your best options are Perl modules. Text::CSV and DBD::CSV
will both do the parsing correctly. If you listen to poor
advice and do a naive split(), you'll cut up every character
string which has a ',' embedded in it.
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Wed, 11 Aug 1999 13:31:39 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: hash in record
Message-Id: <x3yvham9qbp.fsf@tigre.matrox.com>
Peter Huesser <huesser@physik.unizh.ch> writes:
> This is a multi-part message in MIME format.
Please don't do that. Usenet is a text-only medium. Configure your
newsbrowser properly please.
> #!/usr/bin/perl
always add a '-w' to the top of the previous line. It would have given
you a warning indicating that something is wrong.
> %some_table = (
> 'gaga' => 1,
> 'baba'=> 2,
> );
>
> print $some_table{'gaga'},"\n";
>
> $rec = (
> total => 10,
> LOOKUP => { %some_table } ,
> );
>
> print $rec->{LOOKUP}{'gaga'},"\n";
>
> I believe this code is similar to the one in "Programming Perl" (page
> 273, second edition), but the last
> print statement does not print anything. Can anybody give me a hint ?
Yes. Pay closer attention to the code on p.273 of the Camel before
posting to usenet.
Your statement:
$rec = (
total => 10,
LOOKUP => { %some_table } ,
);
uses parentheses which construct a list, and assign the last value (an
anonymous copy of the %some_table hash) to $rec.
The code in the Camel looks like:
$rec = {
total => 10,
LOOKUP => { %some_table } ,
};
which uses curly braces to construct an anonymous hash and assign it
to $rec.
> Thank's in advance for any help
Please don't post to usenet before you have checked your code,
re-checked it, and checked it again. After that you should check the
documentation and the FAQs for any relevant info.
Posting to usenet should be the last resort.
HTH,
Ala
------------------------------
Date: Wed, 11 Aug 1999 14:20:02 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Help - Split Function Blowing My Mind Away!!
Message-Id: <x3ypv0u9o32.fsf@tigre.matrox.com>
mkozlows@guy.ssc.wisc.edu (Mike Kozlowski) writes:
> In article <MPG.121a4f373dba2a21989e26@nntp.hpl.hp.com>,
> Larry Rosler <lr@hpl.hp.com> wrote:
> >
> >Use of incorrect context: my $x = @_; my ($y) = @_;
>
> Are you saying that both of those are wrong, or that the first is wrong
> and the second correct?
The first form assigns to $x the number of elements in @_.
The second form assigns to $x the first element of @_.
Ala
------------------------------
Date: Wed, 11 Aug 1999 11:42:57 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: How to create unix install executables?
Message-Id: <Pine.GSO.4.10.9908111141320.7774-100000@user2.teleport.com>
On Tue, 10 Aug 1999, Greg Guerin wrote:
> Is there a package builder that will enable me to install perl scripts
> to work on these machines without having to install Perl itself on
> every machine I was them to run on?
No. But installing Perl is worthwhile in any case. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 11 Aug 1999 12:35:20 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: How to share constants across modules?
Message-Id: <Pine.GSO.4.10.9908111227300.7774-100000@user2.teleport.com>
On Wed, 11 Aug 1999, David Coppit wrote:
> I'd like to say that the constant DEBUG has the same value in this
> module as in the main module. Here's what seems to work for Perl
> 5.00502:
>
> # DEBUG for this package is the same as the main.
> use constant DEBUG => main::DEBUG;
That should work, so long as main::DEBUG is declared before this module is
compiled.
> Unfortunately, some people on different computers/versions are saying that
> their version of perl is translating "main::DEBUG" into "&main::-1".
What error message are they getting? Can they make a small example program
which demonstrates this behavior? Ten lines or so should suffice. Thanks!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 11 Aug 1999 11:48:06 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Illegal division by zero when testing for a directory??
Message-Id: <Pine.GSO.4.10.9908111144290.7774-100000@user2.teleport.com>
On Tue, 10 Aug 1999, Greg Miller wrote:
> Illegal division by zero at runsession.pl line 968, chunk 1.
>
> Hmmm....Here is the line that it choked on:
> ------------------------------------------
>
> if (-d "$LOC_DIR/actual/$PLATFORM/logs")
> {$LOGSDIR="$LOC_DIR/actual/$PLATFORM/logs";}
>
>
> How in the heck could this produce the division by zero?
Probably something got confused about what was code and what was data
(that is, a quoted string). My guess is that you accidentally left out (or
put in) a quote mark or backslash a few lines earlier, or maybe this is
all within an evil eval STRING. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 11 Aug 1999 13:48:28 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Improving speed of a sub
Message-Id: <x3yso5q9pjo.fsf@tigre.matrox.com>
neutron@fc.hp.com (Jack Applin) writes:
> Ala was a bit harsh calling my advice "useless", but they're correct.
Well it *was* useless, wasn't it? ;-)
Ok. Let me restate that. Your advice was not particularly useful in
this case.
:-)
Ala
------------------------------
Date: Wed, 11 Aug 1999 15:36:55 -0400
From: toby <toby@hercules.cas.utk.edu>
Subject: Re: is our reese the author of mysql book?
Message-Id: <37B1D0D7.EF3E6C0E@hercules.cas.utk.edu>
Uri Guttman wrote:
>
> this is another reason why we should build a decent cgi repository. his
> stuff will infect kiddies for years if we don't.
>
> uri
>
>
I have to stop the Matt Wright disease on a regular basis in my job as an
introductory computing consultant. Every semester at UTK, I have students who
come in with formmail.pl or some other Matt Wright script with system() in it.
Usually, it isn't a script that has been rewritten knee-jerk by Wright and I have
to explain that it is insecure at best. He usually hits sendmail with system, and
invariably some more adept students take this as a license to kill with the
function and put a bit of code that e-mails a message back to the person who
filled out the form on their Web site. Thusly,
system("/usr/lib/sendmail -io -t $email_gleaned_from_form < reply.tmp");
Aggghh. I usually convince them of the danger by passing a command into the
e-mail field of the form. But for every 5 people I show this to and make them
read the FAQ section on security, I get one who has '; unalias rm; rm -rf /<path
to users home>/*;' done to them. A decent CGI repository would be a Godsend.
toby
------------------------------
Date: Wed, 11 Aug 1999 18:30:56 GMT
From: Makarand Kulkarni <makarand_kulkarni@my-deja.com>
Subject: Re: Japanese Girl Needs Help.
Message-Id: <7osfh0$km4$1@nnrp1.deja.com>
[In article <o%hs3.10$0K.808@iad-read.news.verio.net>,
"Kaori" <kaori@japanesegirl.com> wrote:
> I am trying to make a PERL script that will
> allow me to access individual images by the user
> making one event (push button) and then have the
> PERL script roam the database and select the correct
> images.
]
Yes, It can be done. Here is an article that will help -
-
A Smart Picture Album
By Randal L. Schwartz
Magazine: WebTechniques.
January 1999.
-
Hope you find it useful and interesting.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 11 Aug 1999 14:27:50 -0500
From: "David Yang" <david@math.edu>
Subject: JavaScript recieving variables from Perl
Message-Id: <37b1c30e.0@news.advancenet.net>
how do I have JavaScript read variables from a Perl file. For example, I
have a database of variables, how can I load those into JavaScript? Load
them without rewriting the page would be the best but if that's not possible
that's ok....
Thanks in advance,
David
------------------------------
Date: Wed, 11 Aug 1999 14:09:06 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Looking for a good Perl Book
Message-Id: <x3yr9la9ola.fsf@tigre.matrox.com>
abigail@delanet.com (Abigail) writes:
> Ala Qumsieh (aqumsieh@matrox.com) wrote on MMCLXX September MCMXCIII in
> <URL:news:x3ywvv37oaq.fsf@tigre.matrox.com>:
> [] Ok. The best book for beginners would be "Learning Perl" (aka the
> [] Llama) written by R. Schwartz and T. Christiansen, published by
> [] O'Reilly.
>
> That's a matter of opinion I do not share. The usefullness of postings
> like this of increase if you indicate why you think it is the best book.
> Presenting opinions as facts isn't very useful.
True. But when I reply to a post, especially one of this nature, I am
implicitly indicating that this is my opinion I am expressing. Perhaps
I should indicate that more clearly. I will remember to do that in the
future.
> [] The best reference on Perl would be "Programming Perl" (aka the Camel)
> [] written by L. Wall, T. Christiansen and R. Shwartz, published by
> [] O'Reilly.
>
> Weird. The most recent version of that book has "5.003" on the cover.
> The current version of Perl is 5.005, and was released a year ago.
> Perl 5.6 might be out before the end of the year. A lot of things have
> changed. While PP contains a lot of information, I hestitate to say it's
> the best reference.
Again, there is an implicit assumption here. No book is ever
up-to-date with it's topic. But the Camel is one of the best
references I found in terms of technicality and presentation of
information. I think it should be the standard by which technical
books are judged. The only thing that beats the Camel in describing
the latest version of Perl is the on-line docs that come with the
latest version of Perl.
> Yeah. You got paid by O'Reilly? ;-)
No. But I think I should after all the publicity I am giving them :-)
Any O'Reilly execs around? ;-)
> [] As for learning Unix, then I say:
> [] 1) get Linux
> [] 2) install it
>
> That's like saying "for learning how to drive a car, get the parts and
> assemble it".
When was the last time you installed Linux? I installed the latest
version of RedHat around a month ago, and it was a breeze. Much faster
and simpler than winblows. It even recognizes ADSL modems with
absolutely no effort on the user's side. That impressed me!
OTOH, assembling a car would take me about as much time as it would
take me to uninstall Internet Explorer ;)
> [] 3) get any unix book from O'Reilly
>
> I'd trade all Unix books from O'Reilly for any book written by Kernighan
> or Pike.
I agree there. But are they geared towards beginners?
> [] 4) Enjoy Your Freedom (tm).
>
> Freedom? You only let me choose from O'Reilly! That's not freedom....
Installing Linux = freedom from MS winblows.
You could choose whatever books you like. You could even be reading
books by G. Reese as far as I am concerned ;)
Oh. Those are from O'Reilly too!
--
Ala
Again, the opinions I expressed were my own. I should've stated that
more clearly.
------------------------------
Date: Wed, 11 Aug 1999 11:58:39 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Newbie has <FILE> Problem - please help
Message-Id: <Pine.GSO.4.10.9908111155040.7774-100000@user2.teleport.com>
On Wed, 4 Aug 1999, Eric Larson wrote:
> When I run the following, most of the time the first $line works like
> it was in list more and reads in the ENTIRE FILE.
Have you done anything with the special $/ variable, by chance? Try
temporarily putting this line before the offending one:
die "Hey!" unless defined($/) and $/ eq "\n";
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 11 Aug 1999 12:11:46 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Newbie help with typeglobs
Message-Id: <Pine.GSO.4.10.9908111209540.7774-100000@user2.teleport.com>
On Wed, 11 Aug 1999 zzspectrez@my-deja.com wrote:
> Subject: Newbie help with typeglobs
The best help you can get about typeglobs is "don't use them". Unless, of
course, you know better than to ask for help. :-)
> Im trying to pass hash to subroutine so that I can modify it
Use a reference; see perlref. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 10 Aug 1999 18:11:04 GMT
From: chrisl@tourneyland.com (Chris)
Subject: Newbie: Looking for help/info on Sockets with Win32
Message-Id: <37b06973.6051240@news.swbell.net>
Hey all,
I'm trying to do some sockets programming with Sockets on Win 98, and
I'm lost. I read the docs on the Socket module, and all it really said
was it's just a translation of socket.h. I remember socket.h when I
did some Winsock programming years ago, but since then all my socket
programming has been in Java, and in Java you don't have to remember
what bind(), select(), etc. are all for. So i've forgotten all that
stuff.
Does anyone know of some "Sockets in Perl for people who don't know
Sockets" material, or even just some sample source code? I'd like a
reminder of what all the functions do, as well as what the Perl
functions return (for example, it looks like gethostbyname() returns
for packed ints; sensible, but I'd like to know that sort of thing).
Thanks a lot,
Chris
------------------------------
Date: Wed, 11 Aug 1999 16:28:05 -0300
From: "Yellow Beetle" <firebrand@mail.usa.com>
Subject: Newbie: MailTo Script Problem?
Message-Id: <7osis7$d50$1@garnet.nbnet.nb.ca>
Hi,
I have a site at:
www.skyfamily.com/firebrand
Now under the "comments" tab you can fill in some
information, and send it using the "submit" button.
The problem I have is that when you hit "submit"
you get a message saying, that this is not encrypted,
and that you will reveal your e-mail address.
Is there any way in Perl that I can have it look
more professional? I really don't like having that pop
up message. Also, my server doesn't support Perl,
and I can't move the page. Can I link this information
toa site that does support Perl?
Thank You, any help is appreciated!
Jimmy
firebrand@mail.usa.com
------------------------------
Date: Wed, 11 Aug 1999 18:20:26 GMT
From: chrisl@tourneyland.com (Chris)
Subject: Newbie: Sockets on Win32
Message-Id: <37b1be3f.6897724@news.swbell.net>
Hey all,
I'm trying to do some sockets programming with Sockets on Win 98, and
I'm lost. I read the docs on the Socket module, and all it really said
was it's just a translation of socket.h. I remember socket.h when I
did some Winsock programming in C years ago, but since then all my
socket programming has been in Java, and in Java you don't have to
remember what bind(), select(), etc. are all for. So i've forgotten
all that stuff.
Does anyone know of some "Sockets in Perl for people who know a little
about Sockets" material, or even just some sample source code? I'd
like a reminder of what all the functions do, as well as what the Perl
functions return (for example, it looks like gethostbyname() returns 4
packed ints, not a string; makes sense, but I'd like to know that sort
of thing).
Thanks a lot,
Chris
------------------------------
Date: Wed, 11 Aug 1999 11:30:39 -0700
From: Ed Carter <r47652@email.sps.mot.com>
Subject: perl modules in C++
Message-Id: <37B1C14F.C6AA9476@email.sps.mot.com>
How do I get the Makefile generated by XS to either generate a .C file
instead of a .c file from my .xs file or invoke g++ instead of gcc?
thanks
------------------------------
Date: Wed, 11 Aug 1999 13:18:10 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: perl on linux
Message-Id: <x3ywvv29qy5.fsf@tigre.matrox.com>
"Trond Michelsen" <mike@crusaders.no> writes:
> or you can do it with perl...
>
> perl -e 'while(<>){s/\cM//g;print}' < oldscript.pl > fixedscript.pl
Haven't heard of the -p and -n flags? or even the -i flag?
% perl -pi -e 's/\cM//g' oldscript.pl > fixedscript.pl
% perldoc perlrun
Ala
------------------------------
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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu.
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 464
*************************************