[15926] in Perl-Users-Digest
Perl-Users Digest, Issue: 3339 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 13 06:05:30 2000
Date: Tue, 13 Jun 2000 03:05:14 -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: <960890714-v9-i3339@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 13 Jun 2000 Volume: 9 Number: 3339
Today's topics:
Re: "list slice" vs "array slice" [was: Dummy Variable <gellyfish@gellyfish.com>
Re: ANSI Perl: No Way !!! (Bart Lateur)
Attempting to parse malformed XML <capps@solareclipse.net>
Re: Beginner's mySQL Tutorial? <robert@chalmers.com.au>
Re: Beginner's mySQL Tutorial? <gellyfish@gellyfish.com>
Re: Build error in module IO <jeff.gerken@wichita.boeing.com>
Re: cgi.pm if statements and redirect problems colincode@my-deja.com
Re: CPAN, Windows and AS Perl v5.6 <richly@samart.co.th>
Re: Creating a new folder and file. <blah@nospam.com>
Re: Creating new folder and file and can't use mkdir() (Bart Lateur)
Re: Help wtih Regular Expression <gellyfish@gellyfish.com>
Re: Help! (Perl) How to retrieve from delimited ASCII f <towsar@ihug.co.nz>
How to check browser for Javascript enable? <someguy@nospamland.com>
Re: Larry Rosler interview on perl.com! (Eric Bohlman)
Re: Mail via perl <somewhere@planet.earth>
Need SMTP-Sender for pre-formatted messages (Marc Haber)
Re: NEWBIE cgi question please help! <gellyfish@gellyfish.com>
Passing variables between subroutines havamarie@my-deja.com
Re: Passing variables between subroutines <derek@ooc.com.au>
Re: Passing variables between subroutines nobull@mail.com
Re: Perl + web history (was: Re: ANSI Perl: No Way !!!) (Bart Lateur)
Re: Perl and ASP ? how to... nobull@mail.com
Re: Perl Bus Error alanrkiernan@my-deja.com
Re: Perl is FAST!!! (and study doesn't help in this cir <phill@modulus.com.au>
Re: Perl on IIS? <gellyfish@gellyfish.com>
Re: Perl script to create users, directories, permissio <gellyfish@gellyfish.com>
Re: perl <gellyfish@gellyfish.com>
Re: ppm will not work. I get this error message. (Bart Lateur)
Re: regular expression help (matching exactly n times) (Bart Lateur)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 13 Jun 2000 08:42:24 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: "list slice" vs "array slice" [was: Dummy Variable avoidance]
Message-Id: <8i4ol0$lic$1@orpheus.gellyfish.com>
On Mon, 12 Jun 2000 05:08:17 GMT jason wrote:
>
> (@arrayName)[]
>
> so .. is that then a "list slice" ? .. or an "array slice" ?
>
A list slice where the list happens to be initialized from an array.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: Tue, 13 Jun 2000 09:41:43 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: ANSI Perl: No Way !!!
Message-Id: <394cff1e.3374042@news.skynet.be>
Elaine Ashton wrote:
>>> I couldn't find a date for ASP but considering
>>> how late in the game MS 'discovered' the Internet,
>>> I'd guess it would have debuted ~96.
>> Nonetheless, these are all now historical events
>> holding no more value than amusing conjecture.
>
>Interesting viewpoint/conjecture. I would bet MS bought
>the technology rather than developed it as they have
>much of their products in the last few years though
>I'm not expert on MS.
They bought it. They actually bought the right to use the source of the
original Mozilla browser, which Marc Andreessen (sp?), founder of
Netscape, had helped developed. If they hadn't, it would have taken them
at least a year longer to catch up.
And I distinctly remember having seen Bill Gates in an interview on TV,
proclaiming that "Internet will never catch on." That must have been
around 1997 (maybe 1996). Bill Gates tried to set up his own world wide
network at the time (was that MSN? I think so). The U-turn came quite a
bit later.
Bill Gates said similar things about Linux, last year or so.
--
Bart.
------------------------------
Date: Tue, 13 Jun 2000 01:50:12 -0700
From: Charles Capps <capps@solareclipse.net>
Subject: Attempting to parse malformed XML
Message-Id: <3945F5C4.750FC54@solareclipse.net>
I've been given the job of taking exported data from a certain extremely
brain-damaged and poorly designed application and rewriting it into a format
that an in-house application can read.
The only form of exported data is XML. The XML that it produces has
*CERTAIN* tag elements unquoted. Example:
<message body="Laa dee daa" number=000001 author="Lame dude">
Unfortunately, nothing will parse it. Expat (XML::Parser, etc) chokes and
dies when it comes across the unquoted elements.
I'm very reluctant to attempt to write my own parsing routine. I'm currently
using a series of regexes to split apart the tag, but it's difficult, tedious
work due to the randomness of the element locations, values, and lengths, as
well as tags.
Does anyone have any recommendations, pointers, hints, URLs, or
perldoc/manpages? ;)
(Sigh, why can't this be like LAST week's XML project! That was easy once I
found the documentation. Blech!)
--
Charles Capps
------------------------------
Date: Tue, 13 Jun 2000 18:18:39 +1000
From: "Robert Chalmers" <robert@chalmers.com.au>
Subject: Re: Beginner's mySQL Tutorial?
Message-Id: <x6m15.3$624.282@nsw.nnrp.telstra.net>
I guess this whole thread means that you cant simply use Perl to talk to
MySql - you have to use something like the DBI thing?
bob
"Mark-Jason Dominus" <mjd@plover.com> wrote in message
news:39452500.4786$2fb@news.op.net...
> In article <8i2ojk$c9m$1@news.online.de>,
> Raphael Pirker <raphaelp@nr1webresource.com> wrote:
> >Hi,
> >
> >i'm looking for a tutorial that will teach me how to search data in an
mySQL
> >database, implement them into my scripts and read all the data into
> >variables. Any links?
>
> You might want to look at:
>
> http://www.perl.com/pub/1999/10/DBI.html
------------------------------
Date: 13 Jun 2000 08:24:09 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Beginner's mySQL Tutorial?
Message-Id: <8i4nip$lh5$1@orpheus.gellyfish.com>
On Mon, 12 Jun 2000 17:04:45 +0200 Marco Natoni wrote:
> brian d foy wrote:
>>>> Thanks! But is there a Tutorial on Modules or something like
>>>> that? My Perl knowledge is *very* limited... :-)
>>> Of course: the DBI module is well-documented. However, a
>>> minimal knowledge of what DDL and DQL are is required.
>> i have no idea what DDL or DQL are, but i can use the DBI
>> module quite effectively nonetheless.
>
> Data (Definition|Query) Language. I wonder that you can take real
> advantage in using DBI module if you do not know them... ;)
>
Beats me bucko ... I've been messing up databases for a living for quite
a while now and I dont know anything about them. SQL of course ...
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: Tue, 13 Jun 2000 07:54:07 GMT
From: Jeff Gerken <jeff.gerken@wichita.boeing.com>
Subject: Re: Build error in module IO
Message-Id: <3945E89F.58A723C7@wichita.boeing.com>
But his original error (about sv_undef) is exactly the same error I ran
into
trying to build Tk (posted in this newsgroup earlier today). Any help
in
locating this perplexing problem would be very helpful.
Chris, just fyi, there are several additional modules that used to have
to be
installed by hand that are now included with the 5.6 distribution.
Dan Sugalski wrote:
>
> Christopher Hahn <chahn@eleganceintime.com> wrote:
>
> > I decided to use this occasion to upgrade from
> > 5.00503 to 5.6 with threads.
>
> > The build went fine, but I find that rebuilding all
> > the modules that I had added to my system in the
> > past has run into problems.
>
> > For the module IO-1.20
>
> Why are you rebuilding IO? It's one of the standard modules. You already
> have it. (And version 1.20, FWIW, since that's what ships with perl 5.6.0)
>
> Dan
------------------------------
Date: Tue, 13 Jun 2000 07:14:36 GMT
From: colincode@my-deja.com
Subject: Re: cgi.pm if statements and redirect problems
Message-Id: <8i4n0l$ehd$1@nnrp1.deja.com>
No need to print header try this:
print "location:http://www.insuremybiz.com/confirmation.htm";
Colin Faulkingham
In article <39454B2C.E0CBDEB2@uptimeresources.net>,
Chris Sorensen <csorensen@uptimeresources.net> wrote:
> Thanks - I saw that but when I try to redirect without printing a
header .. it
> doesn't work ... I'm not sure why
>
> newsposter@cthulhu.demon.nl wrote:
>
> > Chris Sorensen <csorensen@uptimeresources.net> wrote:
> > > well .. the following script seems to work fine .. except for one
little
> > > thing ... when it tries to redirect it send the user to
> > > "http://www.insuremybiz.com/cgi-bin/confirmation.htm" rather than
> > > "http://www.insuremybiz.com/confirmation.htm"
> >
> > > any idea why ?
> >
> > If you get behaviour you don't understand, consult the
documentation,
> > it might give you some clues.
> >
> > perldoc CGI
> >
> > The redirect() function redirects the browser to a different
> > URL. If you use redirection like this, you should not print
> > out a header as well.
> >
> > Erik
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 13 Jun 2000 16:41:48 +0700
From: Robert White <richly@samart.co.th>
Subject: Re: CPAN, Windows and AS Perl v5.6
Message-Id: <4subkso3vrfb8frvink6v1rmo5u9qbhejb@4ax.com>
On Tue, 13 Jun 2000 01:48:44 GMT, doran@NOSPAMaltx.net (Doran) wrote:
>I have ActiveState perl v5.6 (build613) on my Win98 machine.
>I'd *really* like to use the CPAN module to retrieve and install
>modules when they're not available via PPM.
>Bad command or file name
Might be looking for make when what you should be running (on
Win32) is nmake
http://support.microsoft.com/download/support/mslfiles/NMAKE15.EXE
change the name to make.exe and see what happens.
Rob
http://bangkokwizard.com/
When I was your age, we coded in 1's and 0's
and sometimes didn't even have 1's
------------------------------
Date: Tue, 13 Jun 2000 11:12:22 +0200
From: Marco Natoni <blah@nospam.com>
Subject: Re: Creating a new folder and file.
Message-Id: <3945FAF6.431477A2@nospam.com>
Ferk,
Ferk Da Jerk wrote:
> When I use:
> open (TEST, ">test/test.log");
> print TEST ("Test");
> close (TEST)
> it does not work. There folder "test" is not made yet. So I want
> it to create a folder called "test" and put a file called
> "test.log" inside of that folder. But my problem is it won't
> create the folder. Does anyone know how to create a folder or
> if there is something I'm doing wrong?
$ perldoc -f mkdir
Best regards,
Marco
------------------------------
Date: Tue, 13 Jun 2000 08:44:41 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Creating new folder and file and can't use mkdir()
Message-Id: <3945f423.563365@news.skynet.be>
Ferk Da Jerk wrote:
> I
>also can't use mkdir(), because it brings up an error.
What error? We can only guess now!
Despite the developments of the current thread, I still think Tina could
be right. If you're not using Perl 5.6, you NEED two arguments for
mkdir().
--
Bart.
------------------------------
Date: 13 Jun 2000 09:17:05 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Help wtih Regular Expression
Message-Id: <8i4qm1$llq$1@orpheus.gellyfish.com>
On Mon, 12 Jun 2000 06:38:35 GMT kittycspot@my-deja.com wrote:
> OK heres the deal...
>
> lets say ive got the string "<!--ThisStays-->"
> i need to replace the beginning part of the HTML comment (<!--) and the
> ending (-->) with different strings (lets say we make it into a named
> anchor tag) so it looks like <A NAME="ThisStays">
>
#!/usr/bin/perl -w
use strict;
use HTML::Parser;
my $parser = HTML::Parser->new(api_version => 3,
default_h => [ sub { print shift; },"text"],
comment_h => [ \&fixer, "tokens" ] );
$parser->parse_file(shift);
sub fixer
{
my $stuff = shift;
print qq%<A NAME="$stuff->[0]">%;
}
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: Tue, 13 Jun 2000 19:16:27 +1200
From: Ant <towsar@ihug.co.nz>
Subject: Re: Help! (Perl) How to retrieve from delimited ASCII file
Message-Id: <3945DFCB.71DA957B@ihug.co.nz>
Thanks just another Larry. Good work. I'll be looking at all this code
tonight and be very interested in what I can get out of it. Thanks, it's
encouraging to know that people give their time has given me a good buzz. -
Anthony
Larry Rosler wrote:
> [Followups set.]
>
> In article <394560c3@news.victoria.tc.ca> on 12 Jun 2000 15:14:27 -0800,
>
> Malcolm Dew-Jones <yf110@vtn1.victoria.tc.ca> says...
> + Ant (towsar@ihug.co.nz) wrote:
> + : Can some one help me please? I know how to open and append to a txt
> + : file but I need fairly simple code to read and write a line of
> + : dlimited text to a file and to change a string between two
> + : deliminations.
>
> ...
>
> + An example that adds the area code (123) to each phone number in a
> + simple flat file database, consisting of
> +
> + name:phone number: address
> +
> + The delimiter in my example is a colon (:) just for the sake of
> + argument, and MYFILE and NEW_FILE are file handle to files (they need
> + to be open already, I don't show that).
> +
> + an example datafile might look like
> +
> + Frank:123-5789:18 first street, pleasantville
> + Sally:456-5243:#1 7th ave, uglywhere
> +
> +
> + # this is untested perl code
> +
> + # the names of the fields
> + my @field_names = qw{ NAME NUMBER ADDRESS };
> +
> + # read each line of input into $_
> + while(<MYFILE>)
> + { # some variables we will use within this loop
> + my (%field_data,$new_line);
> +
> + # remove a line ending (assume it was a line feed)
> + chomp;
>
> Why bother? You put it back on again later.
>
> + # split into fields accessible by name
> + @field_data{ @field_names } = split /:/ ;
> +
> + # modify the one field we want to modify.
> + # Concatenate the new area code (123) with the current
> + # value, and save in the same variable.
> +
> + $field_data{'NUMBER'} = '(123) '.$field_data{'NUMBER'};
> +
> + # join line back together, and add the line delimiter
> + $line = join(':',@field_data{ @field_names } ) . "\n";
> +
> + # save line in a new file
> + print NEW_FILE , $line ;
> + }
>
> TIMTOWTDI.
>
> perl -pe "s/:/:(123) /" infile >outfile
>
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Laboratories
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com
------------------------------
Date: Tue, 13 Jun 2000 16:40:23 +0800
From: "Tony" <someguy@nospamland.com>
Subject: How to check browser for Javascript enable?
Message-Id: <3945f31d@news02.imsbiz.com>
Is there a way that Perl can somehow check if the user has Javascript
enabled on their browser?
The reason I want to do this is so that I can do data validation using
client-side Javascript only, without having to worrying about the users
entering funky data. Yes, I know the safest thing to do is to use
server-side validation, but I don't want my users to wait for the round-trip
response. I know Javascript can be used to check if the browser is
Javascript-enabled, but that doesn't really help me much.
I have noticed that Netscape.com can tell if the user has Javascript
enabled, does anyone know how they do that?
------------------------------
Date: 13 Jun 2000 08:30:15 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Larry Rosler interview on perl.com!
Message-Id: <8i4ren$pp1$2@slb0.atl.mindspring.net>
David H. Adler (dha@panix.com) wrote:
: On Mon, 12 Jun 2000 04:20:46 +0930, Henry <htp@mac.com> wrote:
: >By the number and flavour of support questions that come my way.
: >Specifically, the frequency of painful questions such as "What's a
: >POD?", "Where do I type 'perldoc xxx'?" and "Where the $#@! is the
: >manual for this thing?"
:
: I'm sorry, but I cannot in any way find the last two of those even
: vaguely a problem with perl. That's a problem with users being so
: unfamiliar with their operating system and the tools thereof that they
: will not be able to do very much in attempting to program under it.
: Quite frankly, if the line about the perlpod manpage would have a
: "(POD)" following it, I'd even say that about the first.
Yes. The problem here is that for some reason, a lot of people want to
approach Perl as if it were an application rather than a development
tool. Many of these people are completely unfamiliar with programming,
let alone the interface to their operating system. What they need is
tutorial material on general concepts which are in no way Perl-specific,
and it makes no sense to expect Perl's documentation to provide that. No
other programming language is held to such a standard. The documentation
for a tool normally assumes that its readers are familiar with the domain
in which the tool is used and just need information about the specific
ways the tool maps to the domain. The manual for a power saw isn't
expected to teach the user carpentry.
: I certainly have no problem with someone coming up with *clear*
: documentation, but if we're talking about people who can't (or, more
: likely, *won't*) even try to tie their own shoes, as it were, I don't
: think we need to do that sort of incredibly low-level hand-holding.
I suspect it's actually a case of people not even knowing they need to
tie their own shoes; I think in many cases you've got people who were
hired to do graphic design or copywriting based on their expertise in
those domains and then suddenly found their job descriptions expanded to
include programming on the edict of some PHB who seems to think that
programming is just a matter of using certain tools as appliances.
------------------------------
Date: Tue, 13 Jun 2000 09:11:02 +0200
From: "Dimitri Gunsing" <somewhere@planet.earth>
Subject: Re: Mail via perl
Message-Id: <8i4mps$2ir$1@list.pbnec.nl>
You can use Mail::Sender, very easy and supports attachments...
Eli Mansour <elynt@exchange.ml.com> wrote in message
news:39455EF2.53FA77D9@exchange.ml.com...
> Does anybody have an example of sending attachments via Perl.
>
> I don't mind using any mail package from CPAN. Just don't
> see any code to just attach files and send them via email.
>
> Thanks,
>
> Eli
>
------------------------------
Date: Tue, 13 Jun 2000 09:40:06 GMT
From: usenet-9947@marc-haber.de (Marc Haber)
Subject: Need SMTP-Sender for pre-formatted messages
Message-Id: <394600c3@news.ivm.net>
Hi,
I am currently searching for a Perl module that can send E-Mail to a
(not necessarily local) SMTP server without touching message headers.
It can (and should!) happily insert its own Received:-Header, but
otherwise leave all message-headers intact. It should basically do the
same thing like /usr/lib/sendmail does when a message is piped to it -
but not require a full-fledged MTA locally. If a message can't be sent
right away, there is not need to queue it, just return an error and be
done with it.
I have taken a look at CPAN, but have only found modules that seem to
be geared to accept locally generated e-mails like status messages
while generating their own set of headers. I don't need that and don't
want that.
Any hints would be greatly appreciated, thanks.
Greetings
Marc
--
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber | " Questions are the | Mailadresse im Header
Karlsruhe, Germany | Beginning of Wisdom " | Fon: *49 721 966 32 15
Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fax: *49 721 966 31 29
------------------------------
Date: 13 Jun 2000 09:26:14 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: NEWBIE cgi question please help!
Message-Id: <8i4r76$lmf$1@orpheus.gellyfish.com>
On Mon, 12 Jun 2000 00:27:25 -0700 Trevor wrote:
> This may not be the right place for this question but i'm hoping at least
> one of you people out there can help me out. I don't know Perl so i've been
> told you can use C with CGI so i wrote a simple counter file in C. I Then
> uploaded the C file to my cgi-bin. The counter.c file is chmod 755 and
> data.txt (the file it keeps count in is 666)
>
You forgot the :
#!/usr/bin/cc
in the first line of the program.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: Mon, 12 Jun 2000 22:22:56 GMT
From: havamarie@my-deja.com
Subject: Passing variables between subroutines
Message-Id: <8i3ns1$11j$1@nnrp2.deja.com>
Perl friends,
I've got a script with several subroutines. The first subroutine evaluates
the value of a variable it was sent ($ARGV[0]). The rest of the subroutines
need to be made aware of that variable.
for example (in perl-english)
$ARGV[0] = "Jane"; (sent from another script)
subroutine 1: $myName = $ARGV[0];
now, I want to pass $myName (Jane) to the next two subroutines.
This seems so simple but I'm stumped! Your help is appreciated.
Hava
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 13 Jun 2000 18:33:36 +1000
From: Derek Thomson <derek@ooc.com.au>
Subject: Re: Passing variables between subroutines
Message-Id: <3945F1E0.CF7C51AA@ooc.com.au>
This is a multi-part message in MIME format.
--------------2ACE08370C972C89792D18D8
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
havamarie@my-deja.com wrote:
>
> Perl friends,
>
> I've got a script with several subroutines. The first subroutine evaluates
> the value of a variable it was sent ($ARGV[0]). The rest of the subroutines
> need to be made aware of that variable.
>
> for example (in perl-english)
>
> $ARGV[0] = "Jane"; (sent from another script)
>
> subroutine 1: $myName = $ARGV[0];
>
> now, I want to pass $myName (Jane) to the next two subroutines.
>
> This seems so simple but I'm stumped! Your help is appreciated.
I'm a bit confused by the flow of your psuedo-code (ie did you really want to
set $ARGV[0], or access it in sub 1?), so I'll answer your question generically.
Subroutine arguments are accessed in the subroutine via the array "@_".
See the attached example, and then see "perldoc perlsub".
Regards,
Derek.
--------------2ACE08370C972C89792D18D8
Content-Type: text/plain; charset=us-ascii;
name="subs"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="subs"
#!/usr/bin/perl -w
use strict;
my $name = (shift or "me!");
my $number = 13;
sub1($name, $number);
sub2($name, 0);
sub sub1
{
my ($name, $number) = @_;
print "$name $number\n";
}
sub sub2
{
my ($name, $number) = @_;
print "$name $number\n";
}
--------------2ACE08370C972C89792D18D8--
------------------------------
Date: 13 Jun 2000 07:53:12 +0100
From: nobull@mail.com
Subject: Re: Passing variables between subroutines
Message-Id: <u9d7lmklh3.fsf@wcl-l.bham.ac.uk>
havamarie@my-deja.com writes:
> I've got a script with several subroutines. The first subroutine evaluates
> the value of a variable it was sent ($ARGV[0]). The rest of the subroutines
> need to be made aware of that variable.
Use a global variable (one declared with "use vars") or a file-scoped
lexical variable (one declared with "my" defore any of the subroutine
declarations). In 5.6 there's also "our". Consider also passing
formal arguments to subroutines (see "perldoc perlsub").
my $myName;
sub sub1 {
$myName = $ARGV[0];
}
sub sub2 {
# Do something with $myName
}
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Tue, 13 Jun 2000 09:19:40 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Perl + web history (was: Re: ANSI Perl: No Way !!!)
Message-Id: <394afaa6.2230394@news.skynet.be>
Neil Kandalgaonkar wrote:
>httpd.pl, by Marc VanHeyningen project abandoned(?) March 1993
><http://www.cs.indiana.edu/perl-server/intro.html>
>
>A complete HTTP/1.0-compliant and extensible web server, written
>in perl and extensible by adding perl code. A templating system
>would have been trivial to hack if anyone had wanted it at the time.
That is easy to say. Yes, adding a template system in Perl is pretty
easy. But did anybody even *think* of it at that time?
A small gap in your history:
1995: Rasmus Lerdorf created a Perl CGI script which inserted a tag into
the HTML code of his page, and collected the information on the
visitors. He called the logging code PHP-Tools for "Personal Home Page,"
because for him, the use was for his personal home page. A few inquires
came in asking how they could get the tools, and Lerdorf decided to give
it away.
[Source: PHP Hall of Fame, on <www.zend.com>]
That was the birth of PHP: originally written in Perl, and pretty much a
starting point of the whole inverted approach, script inside data. ASP
is built on the same idea, two years later.
--
Bart.
------------------------------
Date: 13 Jun 2000 07:45:53 +0100
From: nobull@mail.com
Subject: Re: Perl and ASP ? how to...
Message-Id: <u9em62kliq.fsf@wcl-l.bham.ac.uk>
Tom Phoenix <rootbeer@redcat.com> writes:
> On Mon, 12 Jun 2000, Nikolai Onken wrote:
>
> > Now my problem is that the alladpages are in asp - so is there a way
> > that I automaticaly log into the account and read the sites (stats)
> > content into an array ?
>
> Might be. Perhaps you need to check the docs, FAQs, and newsgroups about
> ASP to learn more.
Bogus! ASP is a red herring. ASP is something that's generating HTML
at the far end of a HTTPS connection. All the OP needs is something
to handle the near end of an HTTPS connection (i.e. the LWP modules)
and something to parse HTML (i.e. the HTML modules).
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Tue, 13 Jun 2000 08:14:24 GMT
From: alanrkiernan@my-deja.com
Subject: Re: Perl Bus Error
Message-Id: <8i4qgp$hge$1@nnrp1.deja.com>
In article <Pine.GSO.4.10.10006120840450.10286-
100000@user2.teleport.com>,
Tom Phoenix <rootbeer@redcat.com> wrote:
> On Mon, 12 Jun 2000 alanrkiernan@my-deja.com wrote:
>
> > I'm making a system call as part of a script which is running an
> > application which takes its comand options from a file and redirects
> > the results to another file.
> >
> > if(system("application < command_arguement_file > results_file")==0)
> > {
> > }
> >
> > This ALWAYS causes a Bus error..
>
> Always? Did all of the tests in 'make test' work when you installed
perl?
> You should probably re-build perl and ensure that the tests pass
before
> doing 'make install'. Cheers!
>
> --
> Tom Phoenix Perl Training and Hacking Esperanto
> Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
>
I'll get our systems people to do that, many thanks,
Alan
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 13 Jun 2000 18:04:30 +1000
From: Peter Hill <phill@modulus.com.au>
Subject: Re: Perl is FAST!!! (and study doesn't help in this circumstance...)
Message-Id: <3945EB0E.8AA@modulus.com.au>
Uri Guttman wrote:
>
> >>>>> "PH" == Peter Hill <phill@modulus.com.au> writes:
>
> PH> While you're implementing Uri's improvements, you might also want to
> PH> have a look at "study", which only yields improvement when you apply
> PH> many regexes to a string.
>
> study is not what is once was. the newer regex stuff works very fast
> without study. and the docs say this:
>
> Takes extra time to study SCALAR (C<$_> if unspecified) in
> anticipation of doing many pattern matches on the string before
> it is next modified.
>
> note the last word. so study wouldn't help much here as all the ops
> were s/// which modifies the text, of course. and doing a study between
> each s/// will almost surely lose.
>
Good point - I should have rtfm more carefully. That leaves a very
limited set of circumstances under which 'study' will yield results,
i.e. a large number of non-modifying regexen on a fixed target.
--
Peter Hill,
Modulus Pty. Ltd.,
http://www.modulus.com.au/
------------------------------
Date: 13 Jun 2000 08:45:46 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl on IIS?
Message-Id: <8i4ora$lin$1@orpheus.gellyfish.com>
On Mon, 12 Jun 2000 00:10:55 +0200 Raphael Pirker wrote:
> Hi,
>
> Is there any way I can install Perl on IIS? How?
>
You can install Perl on the machine on which you are running IIS. The
documentation of Activeperl contains information on configuring various
HTTP servers to run CGI programs written in Perl.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 13 Jun 2000 08:51:30 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl script to create users, directories, permissions for WinNT4
Message-Id: <8i4p62$lj4$1@orpheus.gellyfish.com>
On Mon, 12 Jun 2000 16:33:32 +1000 Ryan King wrote:
> Please excuse my ignorance (major newbie here!) but has anyone done
> something like this? Is it possible?
>
> I am trying to find out if it will be possible to create an online form that
> will pass the necessary info to Win NT4 Server to create new users/groups,
> and create directories and set permissions etc. This would make my life a
> lot easier if this is possible.
>
I believe that NT4 comes with a web administration facility already - I
would ask in comp.infosystems.www.servers.ms-windows ...
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 13 Jun 2000 08:17:45 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: perl
Message-Id: <8i4n6p$lgo$1@orpheus.gellyfish.com>
On Mon, 12 Jun 2000 05:42:17 GMT jason wrote:
> John writes ..
>>At the dos prompt I write
>>
>>c:\>perl relaycheck.txt
>>and i get....
>>Can't locate Net/Smtp.pm in @INC <@INC contains: C:/Perl/lib
>>C:/Perl/site/lib .> at c:\windows\desktop\k.pl.txt line 4.
>>BEGIN failed--compilation aborted at c:\windows\desktop\k.pl.txt line 4.
>>
>>I intstalled ActivePerl and libnet....
>
> at a command prompt type
>
> dir /b C:\Perl\lib\Net\Smtp.pm
> dir /b C:\Perl\site\lib\Net\Smtp.pm
>
> if both of them return "File Not Found" then your libnet installation
> either didn't work - or is so old as to not include Net::Smtp (I don't
> know how old that would have to be - or whether there was such a thing
> as libnet without Net::Smtp
>
> good news is that there's an easy solution to both .. with ActivePerl
> comes the PPM (Perl Package Manager) .. with an open internet connection
> - at a command prompt type
>
> ppm install libnet
>
> if properly configured - ppm will locate, download and install libnet
> for you .. if not properly configured - consult your documentation
>
That is why it fails to compile, it may also fail to run on Windows
because it uses fork which is only available from the most recent
ActivePerl.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: Tue, 13 Jun 2000 08:53:11 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: ppm will not work. I get this error message.
Message-Id: <3947f632.1090645@news.skynet.be>
unknown wrote:
>Can't locate HTML/HeadParser.pm in @INC (@INC contains: C:/Perl/lib
>/lib .) at C:/Perl/site/lib/LWP/Protocol.pm line 47.
>Compilation failed in require at C:/Perl/site/lib/LWP/UserAgent.pm
>BEGIN failed--compilation aborted at C:/Perl/site/lib/LWP/UserAgent
I don't know why "c:/Perl/site/lib" isn't in your @INC. But that is the
reason why it fails.
>My system is win2000.
A clue?
--
Bart.
------------------------------
Date: Tue, 13 Jun 2000 08:50:45 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: regular expression help (matching exactly n times)
Message-Id: <3946f4a5.693208@news.skynet.be>
Howard Jow wrote:
>$string = "abddba";
>
>if($string =~ m/([\w]{5}?)/) { # match exactly 5 characters (non-greedy)
Eh... that is nonsense. If you match exactly 5 characters, "greedy" or
"non-greedy" are meaningless terms. Of course, if you try to match 5 to
7 characters, then greediness comes into play.
> print "we matched exactly 5 characters\n";
>}
>else {
> print "we matched less than 5 characters or more than 5
>characters\n";
>}
>
>It keeps printing "we matched exactly 5 characters". What am I doing
>wrong?
Forgetting to anchor it? You're asking "Try to match a substring of
exactly 5 word characters". Sure, "abddb" is such a string. Try printing
out $1 if you don't believe me.
In Perl (and grep, and ...), regexes try to extract substring matches.
Add "^" at the front and "$" at the back of the regex. That will DWIM,
i.e. the interesting bits on the text line (excluding any trailing
newline) must match your regex.
/^\w{5}$/
--
Bart.
------------------------------
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 3339
**************************************