[16683] in Perl-Users-Digest
Perl-Users Digest, Issue: 4095 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 22 14:10:40 2000
Date: Tue, 22 Aug 2000 11:10:28 -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: <966967827-v9-i4095@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 22 Aug 2000 Volume: 9 Number: 4095
Today's topics:
Re: how can I use perl to get a website? nobull@mail.com
How to hide running perl window in Activeperl? roh_youngjin@hotmail.com
Re: How to hide running perl window in Activeperl? frederic_grondin@my-deja.com
HTTP redirection problem asmussen@home.com
Re: Image size ? (Martien Verbruggen)
Re: Image size ? (Mike Stok)
Re: IO::Select doesn't return the handle for STDIN? nobull@mail.com
Re: London =?iso-8859-1?Q?=A330=2D35K?= Perl Programmer <russ_jones@rac.ray.com>
Re: London =?iso-8859-1?Q?=A330=2D35K?= Perl Programmer <care227@attglobal.net>
Lotsa difiiculties - need help with my Perl !! reg_exp@my-deja.com
MSExcel as data for perl/cgi script <peterbe@home.com>
Re: newbie question about "uninitialized variables" (Jon S.)
Re: newbie question about "uninitialized variables" (Jon S.)
Re: newbie question about "uninitialized variables" nobull@mail.com
Re: newbie question about "uninitialized variables" <abe@ztreet.demon.nl>
Re: Newbie: Help with Fork on NT box (Jonny)
Re: Newbie: Help with Fork on NT box (Jonny)
Re: Newbie: Help with Fork on NT box (Jonny)
Perl and XML on Windows?? smithj@allnightprod.com
Re: Perl and XML on Windows?? (Marcel Grunauer)
Re: Perl and XML on Windows?? <lauren_smith13@hotmail.com>
perl modem dialing script <zgsmz@my-deja.com>
Re: regexing html-like tags <nobody@newsfeeds.com>
Re: regexing html-like tags <elijah@workspot.net>
Relocating Perl installation after make- shuld I worry? gottfried_leibniz@my-deja.com
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 22 Aug 2000 18:14:57 +0100
From: nobull@mail.com
Subject: Re: how can I use perl to get a website?
Message-Id: <u9r97hjjzi.fsf@wcl-l.bham.ac.uk>
Please qoute only relevant parts of the post you are replying to and
qoute them _before_ your reply. If you can't play nice, then please
go play elsewhere.
"Wang FeiYun" <feiyun-arthur.wang@nokia.com> writes upside down:
> "Joachim Pimiskern" <Joachim.Pimiskern@de.bosch.com> wrote in message
> news:39A22F0B.7838CB7D@de.bosch.com...
> > Wang FeiYun schrieb:
> > > I heard that need the module "LWP:"
True.
> > > What 's that ,
That is the module that you need. Go get it from CPAN.
> > > how to use?
Read the extensive documentation that comes with it, in particular
"perdoc lwpcook".
> > LWP is not necessary, IO::Socket is sufficient:
Strictly true - but not very helpful. Actually IO::Socket is not
necessary, the builtin functions are sufficient.
> I tried it, there is a error:
Don't try it to do it by hand. Use LWP.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Tue, 22 Aug 2000 15:58:40 GMT
From: roh_youngjin@hotmail.com
Subject: How to hide running perl window in Activeperl?
Message-Id: <8nu7v3$mp8$1@nnrp1.deja.com>
Hello experts!
I am using Activeperl 616.
When I launch my perl program from explorer, normally a window pops
up. I can minimize the window. But how can I hide the windows?
Hiding the window and putting it as Task-icon would be the best
solution.
Thanks in advance!
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 22 Aug 2000 17:34:51 GMT
From: frederic_grondin@my-deja.com
Subject: Re: How to hide running perl window in Activeperl?
Message-Id: <8nudjq$u2v$1@nnrp1.deja.com>
In article <8nu7v3$mp8$1@nnrp1.deja.com>,
roh_youngjin@hotmail.com wrote:
> Hello experts!
>
> I am using Activeperl 616.
> When I launch my perl program from explorer, normally a window pops
> up. I can minimize the window. But how can I hide the windows?
> Hiding the window and putting it as Task-icon would be the best
> solution.
>
> Thanks in advance!
>
Hi,
Isn't there a wperl binary in your distribution ?
If so, it's a windowless perl.
If not, other solutions are given in :
http://jenda.mccann.cz/perl/GUIscripts.html
Regrads, F.Grondin.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 22 Aug 2000 17:35:52 GMT
From: asmussen@home.com
Subject: HTTP redirection problem
Message-Id: <8nudln$u54$1@nnrp1.deja.com>
We are trying to move a bunch of perl code from an older version of
Apache to a newer box running Stronghold 3.0 (A commercial version of
Apache). On the way HTTP redirection broke, and I'm not sure if it's a
difference in the perl setup on the new box or if it's in Apache. The
code basically does something like this:
$main::r->print("Location: $NewServer\n\n");
This code worked fine on the old servers, even though it does not print
a Status: 302 Found message. I assume that either some included perl
module was handling the Status message, or Apache itself was supplying
the 302 Found message on its own. Unfortunately the perl code in
question is too large to easily debug. I was hoping that if it is a perl
problem, somebody here might have an idea of what is going on. It may
just be that all of the 'Location:' redirect statements need to be
changed to include the Status: 302 Found message, but that still
wouldn't explain why it was working under the previous Apache and Perl
implementation. Any ideas would be greatly appreciated.
Shawn Asmussen
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 23 Aug 2000 01:09:00 +1000
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Image size ?
Message-Id: <slrn8q55sc.5ap.mgjv@martien.heliotrope.home>
[comp.lang.perl removed. It is long dead, inform your news admin]
On Tue, 22 Aug 2000 16:13:45 +0200,
NDQ <NDQ@iris.ltas.ulg.ac.be> wrote:
> Hi,
> How to obtain the sizes of image (GIF, JPG, PNG) with Perl ?
You get the Image::Size module, which reads all three of those formats.
Get it from http://www.cpan.org/, use the CPAN module thusly:
# perl -MCPAN -e shell
cpan>
or use ppm if on Win32.
Martien
--
Martien Verbruggen |
Interactive Media Division | You can't have everything, where
Commercial Dynamics Pty. Ltd. | would you put it?
NSW, Australia |
------------------------------
Date: Tue, 22 Aug 2000 15:57:35 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Image size ?
Message-Id: <Ppxo5.14602$K5.219608@typhoon.austin.rr.com>
In article <39A28A99.12D36083@iris.ltas.ulg.ac.be>,
NDQ <daiquy.nguyen@ulg.ac.be> wrote:
>How to obtain the sizes of image (GIF, JPG, PNG) with Perl ?
>Thanks,
Have you thought about installing the Image::Size module from CPAN, you can
read about it at
http://www.cpan.org/modules/by-module/Image/Image-Size-2.903.readme
and
perldoc CPAN
is one way to find out about downloading & installing modules from CPAN.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ |
GPG PGP Key 1024D/059913DA | Fingerprint 0570 71CD 6790 7C28 3D60
stok@colltech.com (CT - work) | 75D2 9EC4 C1C0 0599 13DA
------------------------------
Date: 22 Aug 2000 17:48:55 +0100
From: nobull@mail.com
Subject: Re: IO::Select doesn't return the handle for STDIN?
Message-Id: <u9u2cdjl6w.fsf@wcl-l.bham.ac.uk>
Peter Gunreben <pgunreben@lucent.com> writes:
> I'm trying to apply the IO::Select for a socket and STDIN.
> The IO::Select works fine for sockets, but I couldn't get
> it working on STDIN.
> (I have perl Ver 5.6.0 on WinNT)
I've never used 5.6 on WinNT but AFAIK WinNT's underlying
implementation of select() works only for sockets.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Tue, 22 Aug 2000 10:27:11 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: London =?iso-8859-1?Q?=A330=2D35K?= Perl Programmers Required
Message-Id: <39A29BCF.13546270@rac.ray.com>
Dale Emmons wrote:
>
> Well, let's see... 35k pounds is like $20-25 dollars per hour. I don't think
> anyone in this newsgroup, except maybe yourself, would even piss for that
> little.
>
As of 11:22 EDT today, 35k pounds is $52,192.07 US dollars, assuming
2080 hours in a year, it's $25.09. Since I only piss for two or three
hours a day, I'd starve on that. Of course, in reality, I'll piss for
free. At my age, it's just about the only pleasure I have remaining to
me.
--
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747
Quae narravi, nullo modo negabo. - Catullus
------------------------------
Date: Tue, 22 Aug 2000 11:40:32 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: London =?iso-8859-1?Q?=A330=2D35K?= Perl Programmers Required
Message-Id: <39A29EF0.D5ADF52E@attglobal.net>
Russ Jones wrote:
>
> Dale Emmons wrote:
> >
> > Well, let's see... 35k pounds is like $20-25 dollars per hour. I don't think
> > anyone in this newsgroup, except maybe yourself, would even piss for that
> > little.
> >
>
> As of 11:22 EDT today, 35k pounds is $52,192.07 US dollars, assuming
> 2080 hours in a year, it's $25.09. Since I only piss for two or three
> hours a day, I'd starve on that. Of course, in reality, I'll piss for
> free. At my age, it's just about the only pleasure I have remaining to
> me.
I almost fell out of my chair laughing. You trying to make me
break a limb too?
------------------------------
Date: Tue, 22 Aug 2000 16:46:30 GMT
From: reg_exp@my-deja.com
Subject: Lotsa difiiculties - need help with my Perl !!
Message-Id: <8nuaov$qa8$1@nnrp1.deja.com>
hi,
i have a problem that i would like to solve using perl. i have a few
questions, relating to how i can go about solving my problem, and also
as to how i can actually implement a soltuib (i'm having some
difficulties, which i'll explain).
Problem:
I have many 10-15 Mb files with a structure like :
[IN_START]
.
.
[IN_INDEX]
.
.
[START]
.
.
[IN_DATA]
.
.
[IN_END]
[IN_START]
.
[IN_DATA]
.
[IN_END]
.
.
[IN_END]
[IN_START]
[START]
The tag [START] is the one that actually breaks up the structure into
records, with each record having multiple
[IN_START]..[IN_DATA]..[IN_END] tags.
What I need to do is:
1) First break up the file into many records with the lines between two
[START] tags making a record.
2) Within this record, extract only the lines between the [IN_DATA] and
[IN_END] and store these in arrays.
3) Process each array - within each array, I need to further break the
array down into records seperated by a [NUGGET] tag.
Difficulties & Questions:
1) Do I read the whole file into an array and process it ? This seems
to be a slow way, since the file is huge.
2) If I do something like this, I get an error: (this was just a test
script)
open(F,$_) or die "Unable to open file : $!";
$/="[START]";
@file = <F>;
close F;
print $file[1];
print "End of record\n";
@nuggs = split $file[1], /\[NUGGET\]/;
foreach (@nuggs) {
print "Nugget Begin\n";
print $_;
print "Nugget End\n";
}
when i run this, i get the error :
"regexp too big at splitter line 39."
why do i get this error ??
3) is there any easy way of breaking up the whole file into "nuggets",
since the file is so huge ?
thanks is advance,
any tips as to how to process huge files, and how i can do this "perl
style" rather than "c style" (open file, read each line, process each
line...) will be helpful,
- reg_exp
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 22 Aug 2000 16:38:10 GMT
From: "Peter B. Ensch" <peterbe@home.com>
Subject: MSExcel as data for perl/cgi script
Message-Id: <39A2AC71.45AEFA40@home.com>
I have a project where I need to write a perl CGI script that
reads from and and outputs data contained in an Excel spreadsheet.
I've done this before using a .csv file, but this time the sp/sheet
contains hyperlinks and cell-background coloring - neither of
which is dumped to CSV, and both need to be reproduced in my output.
I don't think I can use the Win32::OLE module because the cgi
script needs to run on a UNIX server.
Any ideas? I'm thinking of using for my raw input, the HTML that
Excel can generate (Save As HTML). This would be a lot tougher
to parse, but would at least contain the data, hyperlinks, and
coloring I need.
TIA,
Peter
--
Peter B. Ensch
peterbe@home.com
pensch@dal.asp.ti.com
Linux ~ Where do you want to go tomorrow?
------------------------------
Date: Tue, 22 Aug 2000 15:10:25 GMT
From: jonceramic@nospammiesno.earthlink.net (Jon S.)
Subject: Re: newbie question about "uninitialized variables"
Message-Id: <39a297d0.6800584@news.earthlink.net>
On 21 Aug 2000 21:54:39 GMT, Tina Mueller <tina@streetmail.com> wrote:
>hi,
>Jon S. <jonceramic@nospammiesno.earthlink.net> wrote:
>
>> I've been declaring my "my" variables at the start of my scripts with
>> a my($foo1, $foo2); declaration.
>
>> The problem I just saw on a script was that, if I never gave the
>> variables a value, but used them in an if statement condition, I was
>> getting a "use of unitialized variable" error.
>
>well, I guess you are testing something
>like
>if ($var1 == 23) {dosomething()}
>else {...}
>
>you should better use defined() if
>you're not sure if the variable's defined or not.
>a variable can be
>- undefined
>- defined, but false (like 0, '', etc.)
>- defined and true
>
>so do
>if (defined($var) && $var==23) {}
>
>tina
Thanks Tina!
Jon
------------------------------
Date: Tue, 22 Aug 2000 15:26:39 GMT
From: jonceramic@nospammiesno.earthlink.net (Jon S.)
Subject: Re: newbie question about "uninitialized variables"
Message-Id: <39a297e2.6817880@news.earthlink.net>
On Mon, 21 Aug 2000 16:11:46 -0700, Larry Rosler <lr@hpl.hp.com>
wrote:
>[Who knows how many potential readers won't see your post, because of
>the 'newbie' in its Subject.]
Hmmm, I'd almost rather have it that way now that you mention it.
They have that killed for a reason, and I'd rather not bug them or
incite flames. Thanks for the heads-up.
>In article <39a19a64.28263165@news.earthlink.net> on Mon, 21 Aug 2000
>21:39:28 GMT, Jon S. <jonceramic@nospammiesno.earthlink.net> says...
>> I've been declaring my "my" variables at the start of my scripts with
>> a my($foo1, $foo2); declaration.
>
>Many people prefer to declare them where they are first needed.
I've chosen to put them "up top" because I loose track of what
variables I have without it. It's a newbie crutch for now.
>> I've gotten around this using
>> $foo1='';
>> $foo2='';
>
> my ($foo1, $foo2) = ("") x 2;
That will help. Is there any way to do a '("") x all'?
>> Also, other than having -w generate the error (I assume it's -w and
>> not use strict;), is there any real danger to using uninitialized
>> variables?
>
>The danger is that the suppression of warnings might hide other errors.
Oh, I wasn't thinking of turning off the warnings. Using -w and use
strict; has been so immensely helpful that it isn't even funny.
Especially once I groked how to interpret the cryptic messages.
Is there a way to make these warnings show up "pretty" in my returned
html? I've got CGI::Carp going with fatalstoBrowser and a few warn
and die statements, but I'd like to have my warnings go to the browser
also. Right now, they get placed oddly in the output. (Like, in
between words no where near the error in the script.) The only way to
find them is to scan the output on either my telnet prompt or returned
source, and I miss them half the time. Plus, with my forms heavy
pages, entering 20 variables on the command line is a pain.
>> (These variables are used as true/false holders, but I
>> only have code to set them to false (i.e. "no"). If they don't equal
>> "no" later on, I assume they're "yes"s.)
>
>It would be more usual to leave the false variables alone and assign
>values to the true ones. Then oue could test simply by:
>
> if ($foo) { ... }
>
>which would draw no warning if false (uninitialized), because in a
>simple Boolean test undef (uninitialized) is an acceptable 'false'
>value.
Okay, that makes sense. When I first wrote the scripts, I used unless
statements and assigned the variable to false value. I think I'll
redo those.
Thanks Larry. I really appreciate all of the advice you give on these
groups.
Jon
------------------------------
Date: 22 Aug 2000 17:38:19 +0100
From: nobull@mail.com
Subject: Re: newbie question about "uninitialized variables"
Message-Id: <u9wvh9jm9x.fsf@wcl-l.bham.ac.uk>
jonceramic@nospammiesno.earthlink.net (Jon S.) writes:
> On Mon, 21 Aug 2000 16:11:46 -0700, Larry Rosler <lr@hpl.hp.com>
> wrote:
>
> >In article <39a19a64.28263165@news.earthlink.net> on Mon, 21 Aug 2000
> >21:39:28 GMT, Jon S. <jonceramic@nospammiesno.earthlink.net> says...
> >> I've been declaring my "my" variables at the start of my scripts with
> >> a my($foo1, $foo2); declaration.
> >
> >Many people prefer to declare them where they are first needed.
>
> I've chosen to put them "up top"
Nothing wrong with declaring your variable at the beginning of the
enclosing scope (like in C) rather than all over the place (like in
C++), except it's unfashionable :-)
However, decaring all your variables uncessarily at the outermost
lexical scope nulifies much of the beniefit of using lexical varaibles
in the first place.
Note: It can even make sense to use a "bare BLOCK" to create an extra
level of lexical scoping just to limit the scope of your variables.
This applies equally in Perl, C, C++, M and several other languages,
but not Pascal which always annoys me when I use Delphi.
If a large number your variables really _are_ needed at the outermost
lexical scope then maybe your design needs some re-thinking. Maybe
you have several separate variables that should really be rolled into
some structure (hash, array, object...).
> because I loose track of what variables I have without it.
Eventually as your script grows even with all the variables declared
up top you'll loose track anyhow.
By limiting the scope of variables you make it _safe_ to loose track of
what variables you have.
> It's a newbie crutch for now.
Better to avoid bad habits from the outset.
> > my ($foo1, $foo2) = ("") x 2;
>
> That will help. Is there any way to do a '("") x all'?
No but it doesn't matter if the number is a bit too big so if you know
you've got 10-12 variables on the LHS you can safely put ('') x 15 on
the RHS.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Tue, 22 Aug 2000 19:07:31 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: newbie question about "uninitialized variables"
Message-Id: <msb5qscajfehkh4v6qsm6cqmn13n2bssoq@4ax.com>
On Tue, 22 Aug 2000 15:26:39 GMT, jonceramic@nospammiesno.earthlink.net
(Jon S.) wrote:
...
> Is there a way to make these warnings show up "pretty" in my returned
> html? I've got CGI::Carp going with fatalstoBrowser and a few warn
> and die statements, but I'd like to have my warnings go to the browser
> also. Right now, they get placed oddly in the output. (Like, in
> between words no where near the error in the script.) The only way to
> find them is to scan the output on either my telnet prompt or returned
> source, and I miss them half the time. Plus, with my forms heavy
> pages, entering 20 variables on the command line is a pain.
Have a look at the CGI::Carp documentation. There is a subsection
"Changing the default message" in the section "MAKING PERL ERRORS APPEAR
IN THE BROWSER WINDOW".
The problem will be, that your script can die() in the middle of some
HTML code that could already have been outputed but wasn't finished
logically.
--
Good luck,
Abe
------------------------------
Date: 22 Aug 2000 16:19:43 GMT
From: jonnydeja@my-deja.com (Jonny)
Subject: Re: Newbie: Help with Fork on NT box
Message-Id: <8nu96v$qgr$1@news.cadence.com>
A big thanks and many beers for you. That was my problem.
JD
>Turn on autoflush.
>$| = 1;
>--
------------------------------
Date: 22 Aug 2000 16:18:37 GMT
From: jonnydeja@my-deja.com (Jonny)
Subject: Re: Newbie: Help with Fork on NT box
Message-Id: <8nu94t$l72$2@news.cadence.com>
A big thanks and many beers for you. That was my problem.
JD
>
>Turn on autoflush.
>$| = 1;
>--
>Regards,
>Dick
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.
------------------------------
Date: 22 Aug 2000 16:18:54 GMT
From: jonnydeja@my-deja.com (Jonny)
Subject: Re: Newbie: Help with Fork on NT box
Message-Id: <8nu95e$qf5$1@news.cadence.com>
A big thanks and many beers for you. That was my problem.
JD
>Turn on autoflush.
>$| = 1;
>--
------------------------------
Date: Tue, 22 Aug 2000 16:34:46 GMT
From: smithj@allnightprod.com
Subject: Perl and XML on Windows??
Message-Id: <8nua34$pes$1@nnrp1.deja.com>
I been doing some XML and Java on windows and Unix and now my boss
would like me to do some perl and xml on windows.
Can someone please tell me how to get started
please email me at smithj@allnightprod.com
Thanks
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 22 Aug 2000 17:06:00 GMT
From: marcel@codewerk.com (Marcel Grunauer)
Subject: Re: Perl and XML on Windows??
Message-Id: <slrn8q5cm6.e21.marcel@gandalf.local>
On Tue, 22 Aug 2000 16:34:46 GMT, smithj@allnightprod.com
<smithj@allnightprod.com> wrote:
>I been doing some XML and Java on windows and Unix and now my boss
>would like me to do some perl and xml on windows.
>
>Can someone please tell me how to get started
Look at the XML::* modules on CPAN, first and foremost at XML::Parser.
Then there are a few articles on XML.com, perlmonth.com etc. Here's a
list of useful URLs:
XML.com - Processing XML with Perl
http://www.xml.com/pub/2000/04/05/feature/index.html?wwwrrr_rss
XML.com - Using The Perl XML::Parser Module
http://www.xml.com/xml/pub/98/09/xml-perl.html/
Creating High Performance Web Applications using Perl, Display Templates,
XML, and Database Content
http://www.binevolve.com/press/pressdocs/perl-paper/html/perl.html
XML.com - Processing XML with Perl
http://www.xml.com/pub/2000/04/05/feature/index.html
Perl XML FAQ 1.1
http://www.perlxml.com/faq/perl-xml-faq.html
XML.com - Using The Perl XML::Parser Module
http://www.xml.com/xml/pub/98/09/xml-perl.html
PerlMonth - XML::Parser Part 1
http://www.perlmonth.com/columns/perl_xml/perl_xml.html?issue=4
PerlMonth - XM::Parser Part 2
http://www.perlmonth.com/columns/perl_xml/perl_xml.html?issue=5
PerlMonth - XML::DOM
http://www.perlmonth.com/columns/perl_xml/perl_xml.html?issue=6
Ways to Rome
http://xmltwig.cx/perl_survey/perl_survey.html
http://www.perlxml.com/
XML::Parser
http://wwwx.netheaven.com/~coopercc/xmlparser/intro.html
XML::XSLT Homepage
http://www.sci.kun.nl/sigma/Persoonlijk/egonw/xslt/
XML::XSLT - A perl module for processing XSLT
http://theoryx5.uwinnipeg.ca/CPAN/data/XML-XSLT/XSLT.html
Also look at AxKit (www.axkit.org) and Sablotron (www.gingerall.com)
> please email me at smithj@allnightprod.com
Post here, read here.
--
Marcel Gr\"unauer - Codewerk plc . . . . . . . . . . . <http://www.codewerk.com>
Perl Consulting, Programming, Training, Code review . . . <marcel@codewerk.com>
mod_perl, XML solutions - email for consultancy availability
sub AUTOLOAD{($_=$AUTOLOAD)=~s;^.*::;;;y;_; ;;print} Just_Another_Perl_Hacker();
------------------------------
Date: Tue, 22 Aug 2000 10:15:05 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: Perl and XML on Windows??
Message-Id: <8nucas$9l2$1@brokaw.wa.com>
<smithj@allnightprod.com> wrote in message
news:8nua34$pes$1@nnrp1.deja.com...
> I been doing some XML and Java on windows and Unix and now my boss
> would like me to do some perl and xml on windows.
>
> Can someone please tell me how to get started
>
http://search.cpan.org/search?mode=module&query=xml
That should give you tons to chew on.
Lauren
------------------------------
Date: Tue, 22 Aug 2000 17:20:56 GMT
From: ivan <zgsmz@my-deja.com>
Subject: perl modem dialing script
Message-Id: <8nucov$t09$1@nnrp1.deja.com>
Hi, I made a small perl script to dial a modem off of my com port.
OS: linux RH6.2. Modem: USR 56K faxmodem. /dev/modem -> /dev/ttyS0
Script does not work but it does 'appear' to be close. By that I
mean the modem led's light up but there is no dial tone or sounds
indicating dialing and the modem does appear to be getting the
strings I send it as evidenced by printing the sysreads of the modem.
/dev/ttyS0 is owned by uucp:tty and is chmod 777. I can use the cu
cmd to connect to the modem and enter the same strings from the
script successfully (it dials). script behaves the same as root or any
normal user. similarly, miniterm works fine with the modem.
What I've tried with no success in the script:
1) sprinkled it with sleep statements of 1-5 seconds in strategic areas.
2) tried various different modem init strings
3) tried all permutations of \r\n, \r, \n, etc as line terminators.
4) called setserial with various baud rates before writing.
5) tried 'print' instead of 'syswrite'
Here's the script:
#!/usr/bin/perl
open MODEM , "+>/dev/ttyS0" || die "Can't open comm port";
#system "setserial /dev/ttyS0 spd_vhi";
$init = "at&c1&d2q1s0=0&w\r";
syswrite(MODEM, $init, length($init));
sysread(MODEM, $in, 30); print "modem sez: $in \n";
$numberw = "ATDT5551212\r";
syswrite(MODEM, $numberw, length($numberw));
sysread(MODEM, $in, 30); print "modem sez: $in \n";
close MODEM;
The output from running it is:
modem sez: at&c1&d2q1s0=0&w
modem sez: ATDT5551212
any ideas? I can't believe this is so difficult.
I have read the docs to: cu, uucp, setserial and found no hints.
Research on deja points out this red herring link:
http://www.4guysfromrolla.com/linux/100398-2.shtml
The script found at that link does not work. It shows the
same non-working behavior that my script above shows.
Maybe I'm missing something obvious to everyone else...?
thanks, -zgsmz
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 22 Aug 2000 10:25:35 -0700
From: Anonymous <nobody@newsfeeds.com>
Subject: Re: regexing html-like tags
Message-Id: <39A2B78F.940DB1D@la.znet.com>
Nick Condon wrote:
> Godzilla! wrote:
> > Someone (Larry Rosler I think) wrote:
> > > Godzilla! wrote:
> > > > Someone wrote:
> > > > > Someone else wrote:
> > (snippage)
> > > Surely you know that a hash can hold only one datum per key.
> > > If there will be several data per key, a different data
> > > structure is appropriate. The needs of the application
> > > determine the correct design.
> > Precisely. This is why your code fails. I am curious
> > why you would post bad code, knowing it is bad code.
> Yes, Larry, you'll put Kira out of a job :-)
Just in the nick of time, Nick. At age forty-one,
I am retired and living most comfortably, short
of having to whack a student or two with my
kitchen spatula when I guest lecture at my
university, to keep her or his attention.
A job or losing a job, is not one of my concerns.
Anonymous Godzilla!
--
Supernews should be named Suckernews.
--
--------== Posted Anonymously via Newsfeeds.Com ==-------
Featuring the worlds only Anonymous Usenet Server
-----------== http://www.newsfeeds.com ==----------
------------------------------
Date: 22 Aug 2000 17:52:44 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: Re: regexing html-like tags
Message-Id: <eli$0008221313@qz.little-neck.ny.us>
In comp.lang.perl.misc, Blair Heuer <blair@geo-NOSPAM-soft.org> wrote:
> What I currently have:
> $template =~ s/\[(\w+)\s+([\w+=\w+\s*]+)\]/replace('tag',$1,$2)/ges;
> # replace takes the values and returns what should be displayed for that
> tag
> # I use [] tags rather than the regular <> to help differentiate
> And in replace() I have:
> ...
> my %attr;
> my @attr = split( /\s+/, $_[2] );
> foreach my $each (@attr) {
> my @temp = split( /=/, $each );
> $attr{ $temp[0] } = $temp[1];
> }
> ...
>
> Now, that works as long as the tags are simple, like:
> [out name=author]
> or
> [out name=subject limit=20]
>
> But, I would really like to figure out a way to be able to parse tags like:
> [out name=status img="online.gif" alt="This is the status"]
> or
> [out name=message value="This has non alpha-numeric values! ::Gasp::"]
> You get the point.
Well, there is more than one way to do this, obviously. I've
written a perl script that does some similar parsing. I use
two character end values that I can guarantee won't be inside
the tags, except for one deep variable substutitions. My code
does not go through the attributes and find them all, though.
Rather the functions that deal with each command ("out" is the
command here) check for each attribute they need.
Below is some code from it you can use or just study.
My tags look like:
<?include file="foo.part" ?>
<?set name="variable" value='Whee! This is "fun"!'?>
<?pv variable ?
<?include file="<?pv rootdir ?>/inc.part" ?>
And the main parsing looks a bit like:
while(defined($line = <IN>)) {
$dot++;
if ($line =~ /<\?/) {
# Processing a command {
my $where = "$file:$dot";
my $once = $indent; # indent is set in &include()
# print var must be very tightly binding
$line =~ s/<\? \s* pv \s+ (\w+) [\s;]* \?>/
&subst($where, $1)
/xeg;
if ($line !~ /<\?/) {
# $depends is set if we are just finding the files a given
# input depends upon.
print OUT $once.$line unless $depends;
$line = '';
}
while (length($line)) {
if ($line =~ s/(.+?)<\?//) {
print OUT $once.$1 unless $depends;
$once = '';
}
if ($line =~ s/^<\?\s*([^?>\s]+)\s*((?:[^?]+|\?[^>?])*)\?>//) {
my $command = $1;
my $args = defined($2)? $2 : '';
if ($command eq 'include') {
if ($trace and ! $depends) {
print OUT "\n$trace include $where with args '$args' {{ \n";
}
$return ||= &include($where, $args);
if ($trace and ! $depends) {
print OUT "\n$trace }} include $args\n";
}
} elsif ($command eq 'set') {
if ($trace and ! $depends) {
print OUT "\n$trace set: $args\n";
}
&setvar($where, $args);
} else {
print STDERR "$0: unknown command '$command' at $where\n";
$return = 1;
}
} else {
print STDERR "$0: command not understood at $where\n";
print STDERR "$0: line is $line";
$return = 1;
}
if ($line =~ s/((?:[^<]+|<[^?])+)//s) {
print OUT $1 unless $depends;
}
} # while $line
# } end processing a command
} else {
print OUT $once.$line unless $depends;
}
} # while IN
And here is the function to handle including files:
sub include ($$) {
my $where = shift;
my $args = shift;
my $file;
my $path;
my $oldindent = $indent;
my $shift = 0;
if (defined($file = &grabattribute($where, $args, 'file', 1))) {
# grabattribute prints a warning if the file is not set (since
# we set the important flag), but does allow it to be set to ''
if (!length($file)) {
print STDERR "$0: no filename found at $where\n";
return 1;
}
} else {
return 1;
}
if (!defined($path = locate($file))) {
print STDERR "$0: $file not found at $where\n";
return 1;
}
if ($depends) {
if (!defined($dep_shown{$path})) {
print OUT "$path\n";
$dep_shown{$path} = 1;
}
}
if (defined($shift = &grabattribute($where, $args, 'shift', 0))) {
if ($shift =~ /\D/) {
print STDERR "$0: shift must be numeric at $where\n";
$shift = 0;
}
} else {
$shift = 0;
}
$indent .= (' ' x $shift);# auto-indent included code
my $rc = &process($path); # &process recursively parses files
$indent = $oldindent;
$rc;
} # end &include
And here's the code for &grabattribute():
# This will find an attribute and get its value. If the attribute
# is important and not found, a warning will be printed. If an
# error is encountered or no attribute found, undef is returned.
sub grabattribute ($$$$) {
my $where = shift;
my $args = shift;
my $name = shift;
my $important = shift;
if ($args =~ /(?:^|\s+)$name=(['"]?)/) {
my $q = $1;
if ($q) {
if ($args =~ /(?:^|\s+)$name=$q([^$q]*)$q/) {
return $1;
} else {
print STDERR "$0: unmatched quote at $where\n";
return undef;
}
} else {
if ($args =~ /(?:^|\s+)$name=(\S*)/) {
return $1;
}
}
}
if ($important) {
print STDERR "$0: no $name attribute found at $where\n";
}
return undef;
} # end &grabattribute
Elijah
------
uses this from a makefile to build apache conf files
------------------------------
Date: Tue, 22 Aug 2000 16:36:39 GMT
From: gottfried_leibniz@my-deja.com
Subject: Relocating Perl installation after make- shuld I worry?
Message-Id: <8nua6k$phr$1@nnrp1.deja.com>
I'd like to include a "private" stripped-down installation of the Perl
interpreter in one of our products. This way we can test and deploy the
app without interactions with any other Perl interpreters and libraries
that my be on the system.
Win32 support is required, so we need to install premade binaries.
(Can't use ActiveState distribution due to Windows Installer and
licensing questions.) Since the exact install path isn't known until
intallation time, the hard-coded paths built in by the Perl makefile
system are a concern. Empirically, everything works OK though.
I unzip the current "stable.zip" download, edit the win32/Makefile to
change install directory and drive and select MSVC6 compiler, then run
nmake, nmake test, and nmake install. After this, I rename the install
directory, and nothing obvious breaks right away.
A cursory look at the usage of the path in config.h seems to show that
the hard-coded path is used mainly for compiling and installing third-
party libraries. (We don't need to support this for our private usage.)
Am I right in assuming everything will be OK? Or should I attempt to
fixup the path in the perl.dll binary at install time?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
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 4095
**************************************