[24771] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 6924 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Aug 28 06:05:59 2004

Date: Sat, 28 Aug 2004 03:05:05 -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           Sat, 28 Aug 2004     Volume: 10 Number: 6924

Today's topics:
    Re: Execute Windows program from Perl script (??) (Tony McGuire)
    Re: Execute Windows program from Perl script (??) <kalinaubears@iinet.net.au>
    Re: Execute Windows program from Perl script (??) (Tony McGuire)
    Re: Execute Windows program from Perl script (??) <jurgenex@hotmail.com>
    Re: Execute Windows program from Perl script (??) <nobull@mail.com>
    Re: Execute Windows program from Perl script (??) <nobull@mail.com>
        Flat file database that supports mulitiple lines, embed <Darrell_Schmitt@sbcglobal.net>
    Re: help about  Content-encoding: gzip and  proxy <nobull@mail.com>
    Re: help about  Content-encoding: gzip and  proxy <nospam@bigpond.com>
    Re: How do you lock a file BEFORE changes are made? (Jay Tilton)
        How to find out if a string is in uppercase only <leifwessman@hotmail.com>
    Re: How to find out if a string is in uppercase only (Anno Siegel)
    Re: How to find out if a string is in uppercase only <nobull@mail.com>
    Re: How to find out if a string is in uppercase only <tassilo.von.parseval@rwth-aachen.de>
    Re: How to find out if a string is in uppercase only <nobull@mail.com>
    Re: How to find out if a string is in uppercase only (Bart Van der Donck)
    Re: hv_iterinit has side effects - who cares about PL t <tassilo.von.parseval@rwth-aachen.de>
    Re: Larry Wall & Cults <tim@vegeta.ath.cx>
    Re: Reference to functions <matternc@comcast.net>
    Re: subroutines with XML (Sara)
    Re: Xah Lee's Unixism <spam@mouse-potato.com>
    Re: Xah Lee's Unixism <davids@webmaster.com>
    Re: Xah Lee's Unixism <spam@mouse-potato.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 27 Aug 2004 18:29:05 -0700
From: tony@paradoxcommunity.com (Tony McGuire)
Subject: Re: Execute Windows program from Perl script (??)
Message-Id: <f896a829.0408271729.5ec696b0@posting.google.com>

Brian McCauley <nobull@mail.com> wrote
> 
> This is not a question about Perl, it is a question about the host 
> operating system's (in this case Window's) command line interpreter to 
> which system() give you access.

It isn't?  "How do you do XXX in Perl?" isn't appropriate to this
forum?  Do the questions all have to be a technical discussion of a
function, rather than how to get a desired result from a function?


> You enclose it in double quotes.

And that doesn't work.  I tried that, and several variations.  The
best I get is a hung browser and a copy of cmd.exe in task mangler for
each attempt I make.

So, now that I've been chastised for asking the wrong question in the
wrong place, and given an answer that doesn't work, is there anyone
willing to inform me of just which group I CAN ask this on - and not
get put down for not knowing ahead of time what I came here in hopes
of learning?


------------------------------

Date: Sat, 28 Aug 2004 11:57:20 +1000
From: Sisyphus <kalinaubears@iinet.net.au>
Subject: Re: Execute Windows program from Perl script (??)
Message-Id: <412fe7b3$0$22843$5a62ac22@per-qv1-newsreader-01.iinet.net.au>

Tony McGuire wrote:
> Brian McCauley <nobull@mail.com> wrote
> 
>>This is not a question about Perl, it is a question about the host 
>>operating system's (in this case Window's) command line interpreter to 
>>which system() give you access.
> 
> 
> It isn't?  "How do you do XXX in Perl?" isn't appropriate to this
> forum?  Do the questions all have to be a technical discussion of a
> function, rather than how to get a desired result from a function?
> 
> 
> 
>>You enclose it in double quotes.
> 
> 
> And that doesn't work.  I tried that, and several variations.  The
> best I get is a hung browser and a copy of cmd.exe in task mangler for
> each attempt I make.
> 
> So, now that I've been chastised for asking the wrong question in the
> wrong place, and given an answer that doesn't work, is there anyone
> willing to inform me of just which group I CAN ask this on - and not
> get put down for not knowing ahead of time what I came here in hopes
> of learning?

I don't think Brian was chastising you ... he was merely informing you :-)

I assume that he is correct - though I'm not prepared to argue one way 
or the other.

Anyway, I put a simple little executable called 'a.exe' in C:\Program 
Files\Winamp and ran the following perl script:

use warnings;
system("C:\\Program Files\\Winamp\\a.exe");
__END__

That worked fine. Maybe we need to see the actual system command that 
you're running - and also the actual error you get (when using double 
quotes).

Btw, putting perl in a folder whose name includes white space is a bad 
idea. If you have any say in where perl gets put, don't let it be in 
such a folder.

Cheers,
Rob

-- 
To reply by email u have to take out the u in kalinaubears.



------------------------------

Date: 27 Aug 2004 21:07:34 -0700
From: tony@paradoxcommunity.com (Tony McGuire)
Subject: Re: Execute Windows program from Perl script (??)
Message-Id: <f896a829.0408272007.210c251b@posting.google.com>

Sisyphus,

: That worked fine. Maybe we need to see the actual system command that
: you're running - and also the actual error you get (when using double
: quotes).

system( "start", "C:\Program Files\TextPad 4\TextPad.exe");

There is no error.  The web page I post from just sits there as if the perl
were executing.  And when I check the 'server' box I find a cmd.exe in Task
Mangler, one for each time I run the script.

And the only way to remove the 'hidden' copy of cmd.exe (there's no DOS box
up) is to reboot Windows.  When I try to end task on them, I get 'Access
Denied'.


------------------------------

Date: Sat, 28 Aug 2004 05:09:32 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Execute Windows program from Perl script (??)
Message-Id: <gsUXc.218$6q.45@trnddc06>

Tony McGuire wrote:
> Brian McCauley <nobull@mail.com> wrote
>>
>> This is not a question about Perl, it is a question about the host
>> operating system's (in this case Window's) command line interpreter
>> to which system() give you access.
>
> It isn't?  "How do you do XXX in Perl?" isn't appropriate to this
> forum?

To call an external program from Perl you use system() or qx or backticks or 
exec or ...
However, that is not your problem.

> Do the questions all have to be a technical discussion of a
> function, rather than how to get a desired result from a function?

Sure. But your problem is with the OS resp. with how the command interpreter 
of your OS interprets a command line. It is not a Perl problem.

>> You enclose it in double quotes.
>
> And that doesn't work.  I tried that, and several variations.

Could you please show us?

> The
> best I get is a hung browser and a copy of cmd.exe in task mangler for
> each attempt I make.

Browser? Browser? Where do you have a browser?

> So, now that I've been chastised for asking the wrong question in the
> wrong place, and given an answer that doesn't work,

Actually, I presume that you interpreted the answer wrong.
Earlier you wrote:
    Also, the actual program I wish to execute is in
    c:\program files\etc\etc.exe
indicating that the command "c:\progam" wasn't found or something along that 
line.

Well, if you call it like
    system("c:\program files\etc\etc.exe")
then you got a double quoted Perl string but the command itself is by no 
means enclosed in double quotes.
Just check on your command line what happens when you enter
    c:\program files\etc\etc.exe
In other words: the Windows command interpreter (not Perl !!!) requires you 
to enclose the _command_ in double quotes like
    "c:\program files\etc\etc.exe"

And that string *including*those*double*quotes* is the text that you have to 
pass to system() as argument
    system("\"c:\program files\etc\etc.exe\"")
or
    system('"c:\program files\etc\etc.exe"')

>  is there anyone
> willing to inform me of just which group I CAN ask this on - and not
> get put down for not knowing ahead of time what I came here in hopes
> of learning?

Brian did answer your question. You just didn't read his reply carefully 
enough.

jue 




------------------------------

Date: Sat, 28 Aug 2004 09:09:28 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Execute Windows program from Perl script (??)
Message-Id: <cgpejt$nvf$1@slavica.ukpost.com>

Jürgen Exner wrote:

>     system("\"c:\program files\etc\etc.exe\"")

Do not rely on \p and \e not being defined escapes.

system("\"c:\\program files\\etc\\etc.exe\"")

(I assume you, Jürgen, knew that really but it's worth correcting for 
the sake of anyone else reading).



------------------------------

Date: Sat, 28 Aug 2004 09:47:14 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Execute Windows program from Perl script (??)
Message-Id: <cgpgqj$o4o$1@slavica.ukpost.com>


Tony McGuire wrote:

> Sisyphus,
> 
> : That worked fine. Maybe we need to see the actual system command that
> : you're running - and also the actual error you get (when using double
> : quotes).
> 
> system( "start", "C:\Program Files\TextPad 4\TextPad.exe");
> 
> There is no error.

Well not a fatal error, but there is a warning.  So either you forgot to 
enable warings or you frogot to look in the log to see if there were any 
errors.

Right the first thing to note is that there are several different forms 
of system.  From the error you gave in the first post it was evident 
that you were using the single argument form.  The multiple argument 
form is great because it should bypass the host OS CLI but it would seem 
on Windows it doesn't.  For this reason it may be safer to stick with 
the single argument form (or use one of the Win32::* modules to get 
direct access to the lower level Windows API).

When using the single argument from of system() the value of string you 
pass to system() must be exactly what you'd need to type at the command 
prompt.  Note: it is the _value_ of the string I'm talking about here - 
not the representation of that string in Perl source code.  If this 
distinction is lost on you consider:

my $s = "foo\bar";

The representation of this string in Perl source code consists of 9 
characters (the first and last being double quotes).  The double qoutes 
are not however _in_ the string.  The value of the string is the the 6 
characters 'f' 'o' 'o' <backspace> 'a' 'r'.

>  The web page I post from just sits there as if the perl
> were executing. 

Sorry, I hadn't clocked your original question as a stealth CGI 
question.  (Please don't do hat, see the posting guidelines).

 From the name TextPad.exe looks like it may be a GUI interactive 
program.  Since web servers are usually run as background daemons 
("services" in Windows-speak) then any processes started by them will 
not be connected to a display ("worksation" in Windows-speak).  How to 
get a background job to interact with a display is very much OS 
specific.  In windows I've seen how it's done and it's a seriously 
complicated process because you are going completely against the Windows 
secrity model.  The trick I usually use is to kick off a service that 
runs a local system (interact with desktop) which then logs in as a user 
  and then kicks off the job.  This is sloppy and invoves passing login 
credentials around in plaintext.  As I say I've seen more elegant 
solutions but were drifting way OT here - this is all about the Windows 
API - nothing to do with the programming language you happento be using.

> And the only way to remove the 'hidden' copy of cmd.exe (there's no DOS box
> up) is to reboot Windows.  When I try to end task on them, I get 'Access
> Denied'.

Yes, this is a well known bug in Windows.   Actually you can get a 
command line program called 'pskill' that doesn't have this problem. 
(This, of course, has nothing to do with Perl).



------------------------------

Date: Sat, 28 Aug 2004 03:23:56 GMT
From: "Darrell L. Schmitt" <Darrell_Schmitt@sbcglobal.net>
Subject: Flat file database that supports mulitiple lines, embedded commas, etc.
Message-Id: <gVSXc.12585$CW.4362@newssvr27.news.prodigy.com>

I'm looking for a CSV type flat-file database. This is for a text entry
"logbook" that will have 3 major fields. Each field may contain up to 2048
ASCII characters including commas, quotation marks, and newline characters.

Does such a beast already exist? This must be able to run on Perl 5.0 (no
Tk).




------------------------------

Date: Sat, 28 Aug 2004 10:01:30 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: help about  Content-encoding: gzip and  proxy
Message-Id: <cgphla$o70$1@slavica.ukpost.com>



news.hinet.net wrote:

> If i setup proxy in IE. The web page will not show the the gzip contents.
> But if i don't use proxy.The web page is correctly.

Ho, this is a Perl newgroup.  Here we discuss things related to Perl. 
You appear to be talking about a problem with a buggy (unspecified) HTTP 
proxy.



------------------------------

Date: Sat, 28 Aug 2004 19:12:15 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: help about  Content-encoding: gzip and  proxy
Message-Id: <2pb0jjFid9bmU1@uni-berlin.de>

news.hinet.net wrote:

> If i setup proxy in IE. The web page will not show the the gzip contents.
> But if i don't use proxy.The web page is correctly.
> 
> =========================================================
>  print "Content-encoding: gzip\n";
>  open(STDOUT,"| $gzippath -1 -c");
>  print STDOUT $htmlstr;

I might be barking up the wrong tree, but if you are trying to automatically
gzip compress the http stream, you are way off course.


See
http://httpd.apache.org/docs-2.0/mod/mod_deflate.html
http://gregorytoomey.com/index.php?option=content&task=view&id=2&Itemid=2
(section 2.3)

gtoomey


------------------------------

Date: Sat, 28 Aug 2004 01:25:22 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: How do you lock a file BEFORE changes are made?
Message-Id: <412fdce7.447163607@news.erols.com>

jl_post@hotmail.com (J. Romano) wrote:

:    Since flock() calls have become such a hot topic recently, I've
: been wondering how I can lock a file before any changes are made.  Let
: me provide an example:

[snip] 

:    I did find one work-around... instead of opening the file with ">",
: I can open it with "+<", then use flock(), then seek to the beginning
: of the file, like this:
: 
:       open(FILE, "+<file.txt") or warn "Could not open: $!";
:       flock(FILE, LOCK_EX);
:       seek(FILE, 0, 0);   # go to the beginning of the file
:       print FILE "New text lines\n" x 50;
:       truncate(FILE, tell(FILE));   # remove extra old data
:       close(FILE);   # closes the file and releases the lock
: 
: Not only is this approach unfavorable because it uses extra lines of
: code that seem unnecessary, but according to "perldoc -f truncate",
: calling truncate() "produces a fatal error if truncate isn't
: implemented on your system," which makes me think that it's not all
: that portable.

Did you not see the same note attached to "perldoc -f flock"?  It too will
cause a fatal error on a system where it is not implemented.

How much portability do you really need?  Is it worth jumping through hoops
to make your program accommodate every platform that can run Perl?



------------------------------

Date: 27 Aug 2004 23:58:33 -0700
From: "leifwessman@hotmail.com" <leifwessman@hotmail.com>
Subject: How to find out if a string is in uppercase only
Message-Id: <cgpaep$ua6@odbk17.prod.google.com>


Hi!

How do I find out if a string is uppercase only? I've searched cpan for
a suitable module, but found nothing.

This is what I'm looking for:

is_uppercase("UPPERCASE =C5=C4=D6") # TRUE
is_uppercase("UPPERCaSE =C5=C4=D6") # FALSE

Thanks for any input on how to create such a method.
Leif

Note: =C5=C4=D6 is swedish characters.



------------------------------

Date: 28 Aug 2004 07:57:48 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How to find out if a string is in uppercase only
Message-Id: <cgpdts$lu5$1@mamenchi.zrz.TU-Berlin.DE>

leifwessman@hotmail.com <leifwessman@hotmail.com> wrote in comp.lang.perl.misc:
> 
> Hi!
> 
> How do I find out if a string is uppercase only? I've searched cpan for
> a suitable module, but found nothing.
> 
> This is what I'm looking for:
> 
> is_uppercase("UPPERCASE ÅÄÖ") # TRUE
> is_uppercase("UPPERCaSE ÅÄÖ") # FALSE
> 
> Thanks for any input on how to create such a method.
> Leif
> 
> Note: ÅÄÖ is swedish characters.
 
Check if any lower-case characters appear in the string:

    my $lower = join '' => 'a' .. 'z', qw( å ä ö);
    sub is_uppercase {
        return !/[$lower]/ for shift;
    }

If you have a working locale for your character set, you don't have
to set up the alphabet manually:

    sub is_uppercase {
       use Locale;
       return !/[[:lower:]]/ for shift;
   }

Anno


------------------------------

Date: Sat, 28 Aug 2004 09:03:54 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: How to find out if a string is in uppercase only
Message-Id: <cgpe9b$nu6$1@slavica.ukpost.com>



leifwessman@hotmail.com wrote:
> Hi!
> 
> How do I find out if a string is uppercase only?

I assume you really mean no lowercase since you example string also 
contains a space.

> I've searched cpan for
> a suitable module, but found nothing.

No need, it's builtin.

> This is what I'm looking for:
> 
> is_uppercase("UPPERCASE ÅÄÖ") # TRUE
> is_uppercase("UPPERCaSE ÅÄÖ") # FALSE

!/[[:lower:]]/

or

$_ eq uc

> Note: ÅÄÖ is swedish characters.

That should be OK.



------------------------------

Date: Sat, 28 Aug 2004 10:16:23 +0200
From: "Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de>
Subject: Re: How to find out if a string is in uppercase only
Message-Id: <2patapFigtndU1@uni-berlin.de>

Also sprach Brian McCauley:

> leifwessman@hotmail.com wrote:
>> Hi!
>> 
>> How do I find out if a string is uppercase only?
> 
> I assume you really mean no lowercase since you example string also 
> contains a space.
> 
>> I've searched cpan for
>> a suitable module, but found nothing.
> 
> No need, it's builtin.
> 
>> This is what I'm looking for:
>> 
>> is_uppercase("UPPERCASE ÅÄÖ") # TRUE
>> is_uppercase("UPPERCaSE ÅÄÖ") # FALSE
> 
> !/[[:lower:]]/
> 
> or
> 
> $_ eq uc
> 
>> Note: ÅÄÖ is swedish characters.
> 
> That should be OK.

Only when 'use locale' is in effect. Otherwise

    $_ = "ö";
    if ($_ eq uc) {
	...
    }

reports as true.

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


------------------------------

Date: Sat, 28 Aug 2004 09:58:00 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: How to find out if a string is in uppercase only
Message-Id: <cgpheo$o4o$2@slavica.ukpost.com>

Tassilo v. Parseval wrote:

> Also sprach Brian McCauley:
> 
>>leifwessman@hotmail.com wrote:
>>
>>>Note: ÅÄÖ is swedish characters.
>>
>>That should be OK.
> 
> 
> Only when 'use locale' is in effect.

Yeah, sorry I realised that just after I hit send.  But as I said the 
other day - on Usenet there's no need to correct yourself, there are 
thousands of people just waiting to leap at the chace to correct you :-)



------------------------------

Date: 28 Aug 2004 02:50:23 -0700
From: bart@nijlen.com (Bart Van der Donck)
Subject: Re: How to find out if a string is in uppercase only
Message-Id: <b5884818.0408280150.1bb2ff24@posting.google.com>

leifwessman@hotmail.com wrote:

> How do I find out if a string is uppercase only? I've searched cpan for
> a suitable module, but found nothing.
> This is what I'm looking for:
> is uppercase("UPPERCASE    ") # TRUE
> is uppercase("UPPERCaSE    ") # FALSE

I believe this should do the trick:

----------------------------------------------------
#!/usr/bin/perl
$isUppercase="OK";
$string="PUTSOMETESTSTRINGHERE";
@splitit = split //, $string;
for (@splitit) {
$isUppercase = "not OK"
if ($_!~/(A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z)/)
}
print "Upper case: $isUppercase";
----------------------------------------------------

You can extend the (A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z)
part to include the Swedish characters that you want to allow. (or if
you want spaces as in your example, etc)

hope this helps
Bart


------------------------------

Date: Sat, 28 Aug 2004 09:20:54 +0200
From: "Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de>
Subject: Re: hv_iterinit has side effects - who cares about PL theory
Message-Id: <2paq2pFisb1iU1@uni-berlin.de>

Also sprach Ozgun Erdogan:

> As a newbie to Perl programming, I've realized that hv_iterinit has
> side effects. That is, if you want to walk over a hash structure,
> there is no way you can walk over it without changing the internal
> values of the hash itself. And hashes in Perl are primitive data
> types.
> 
> So, if you want to read the values in a hash, there is no way for you
> to do it without modifying other values in the hash itself. From my
> perspective (and from my perspective only), this is some what
> equivalent to:
> 
> $x = 4;
> Print $x;
> (now $x is 10). 
> 
> I know it sounds exaggerated, and probably people discussed for a
> while and thought it'd bite no one to implement it like this, but
> here's where this unexpected behavior hurts:
> 
> Take CPAN module Data::Structure::Util, which detects circular
> references. This is something which I really need, but goes into
> infinite recursion when we have:
> hash1 has a weak reference weak1 to hash2. hash2 has a hard reference
> hard1 pointing back to hash1. The code goes into infinite recursion
> because hv_iterinit would set xhv_riter to 0 for hash1 every time. I
> think this is not a bug in Data::Structure::Util, it's a bug in Perl!

I don't understand this. What would you expect the below code to do?

    my %hash;
    $hash{ key } = \%hash;
    walk(\%hash);

    sub walk {
	my $ref = shift;
	while (my ($k, $v) = each %$ref) {
	    print "$k => ";
	    if (not ref $v) {
		print "$v\n";
	    }
	    else {
		walk($v);
	    }
	}
    }

Clearly, this will end in an infinite recursion. But is this a bug in
perl? One has to keep track of the references to make sure that circular
ones are detected correctly.

> You should be able to walk over a primitive type without changing its
> value, especially in a widely used language as Perl.

You aren't modifying a hash's values when iterating over it. You are
however modifying the internal state of the iterator. There is no other
way to do it in any language.

So the bug is in the module and not in perl. You should report this to
its author.

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


------------------------------

Date: Sat, 28 Aug 2004 02:14:08 -0000
From: Tim Hammerquist <tim@vegeta.ath.cx>
Subject: Re: Larry Wall & Cults
Message-Id: <slrncivqll.j8f.tim@vegeta.saiyix>

John Doherty <jdoherty@nowhere.null.not> wrote:
> Grant Edwards <grante@visi.com> wrote:
> > Of course, but are they consistently indented using tabs or spaces?
>  
> AND HOW MANY SPACES PER TAB STOP?

You just reminded me of the infamous variable naming debate:

  - visualBasicStyle
  - javaStyle
  - perl_style
  - jumbledstyle

/me ducks out as sparks fly.... 

Tim Hammerquist


------------------------------

Date: Sat, 28 Aug 2004 00:40:59 -0400
From: Chris Mattern <matternc@comcast.net>
Subject: Re: Reference to functions
Message-Id: <lqqdnXBl1O1Dka3cRVn-rw@comcast.com>

Brian McCauley wrote:

> [ Your smiley has no nose, how does it smell?... ]

Awful!

-- 
             Christopher Mattern

"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"


------------------------------

Date: 27 Aug 2004 22:13:34 -0700
From: sa_ravenone@yahoo.com (Sara)
Subject: Re: subroutines with XML
Message-Id: <8e3b2dfa.0408272113.7f40448@posting.google.com>

Anno Siegel wrote in message news:
> Sara <sa_ravenone@yahoo.com> wrote in comp.lang.perl.misc:
> > Hi all,
> > Now I want to associate every element of an XML file with a
> > subroutine. I searched CPAN and also read Perl-XML FAQ; XML::Dumper ...
> > ...Is it necessary to have elements of XML declared as part of a data
> > structure in the program to make this association work?
> 
> In one way or another, yes.  You need some string that uniquely identifies
> each XML element (whatever that is).  If they are themselves strings, fine.
> If they are objects, they will stringify to a unique string. If they are
> compounds, use a reference, which will also be unique.  Build a hash ...
> ...Later, given an XML element $element, you can call the code like this:
>     my $result = $table{ $element}->( $arg1, ...);
> Anno

Thanks for that, it was really helpful. I am now more clear about how
to proceed. Actually I am transforming an XML file from a source DTD
to another DTD. I am storing this relation in an XML file, read by
XML::Dumper. The solution provided above solves my problem.

But in case, the source or destination DTD changes (not both at a
time), there shouldn't be any problem recreating the XML file storing
the mapping information. But shouldn't the subroutines be associated
with both DTDs (elements of the DTDs), so that the "link" is still
maintained if one DTD is changed?
Thanks again for all the help.


------------------------------

Date: 28 Aug 2004 03:41:22 +0200
From: Pascal Bourguignon <spam@mouse-potato.com>
Subject: Re: Xah Lee's Unixism
Message-Id: <87hdqorqd9.fsf@thalassa.informatimago.com>

"David Schwartz" <davids@webmaster.com> writes:

> "Pascal Bourguignon" <spam@mouse-potato.com> wrote in message 
> news:878yc0ucyl.fsf@thalassa.informatimago.com...
> 
> > Kenny Tilton <ktilton@nyc.rr.com> writes:
> 
> >> >>What you mean with Unixism?
> >> >     repeated accidents. Such a tool would
> >> >     first chop off the user's brain, molding
> >> >     a mass of brainless imbeciles and
> >> >     microcephalic charlatans the likes of
> >> >     Larry Wall and Linus Torvald jolly
> >> > Server: Apache/2.0.50 (Fedora)
> >> >         ^^^^^^^^^^^^^^^^^^^^^^
> >>
> >> So you like my approach, which is to condemn things they have never used?
> >>
> >> :)
> >
> > No, that of no more using things that you condemn.
> 
>     I don't follow you at all. I think you'll find the most useful, 
> meaningful complaints about, say, a Ford Explorer from the people who drive 
> one every day.

I'd expect to get these complaints indeed from people who drove it,
but I'd be puzzled if they'd continued to drive it every day.

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

Our enemies are innovative and resourceful, and so are we. They never
stop thinking about new ways to harm our country and our people, and
neither do we.


------------------------------

Date: Fri, 27 Aug 2004 21:50:11 -0700
From: "David Schwartz" <davids@webmaster.com>
Subject: Re: Xah Lee's Unixism
Message-Id: <cgp2u4$5nk$1@nntp.webmaster.com>


<ctcgag@hotmail.com> wrote in message 
news:20040827135423.154$1T@newsreader.com...

> "David Schwartz" <davids@webmaster.com> wrote:

>>     I don't follow you at all. I think you'll find the most useful,
>> meaningful complaints about, say, a Ford Explorer from the people who
>> drive one every day.

> And if they continue to drive one everyday, perhaps you would conclude
> that their complaints are insincere.

    That's a load of crap.

    DS




------------------------------

Date: 28 Aug 2004 08:41:30 +0200
From: Pascal Bourguignon <spam@mouse-potato.com>
Subject: Re: Xah Lee's Unixism
Message-Id: <878ybzsr1h.fsf@thalassa.informatimago.com>

rpw3@rpw3.org (Rob Warnock) writes:

> Pascal Bourguignon  <spam@mouse-potato.com> wrote:
> +---------------
> | $ telnet xahlee.org 80;
> | Trying 208.186.130.4...
> | Connected to xahlee.org.
> | Escape character is '^]'.
> | GET / HTTP/1.1
> | 
> | HTTP/1.1 400 Bad Request
> | Date: Fri, 27 Aug 2004 01:35:52 GMT
> | Server: Apache/2.0.50 (Fedora)
> |         ^^^^^^^^^^^^^^^^^^^^^^
> +---------------
> 
> So are you complaining about the fact that his hosting provider
> preloaded RedHat Fedora with Apache 2.0 for him? [A lot of them do,
> these days, 'cuz it's much cheaper than preloading RedHat Enterprise.]
> 
> Or are you complaining about that perfectly correct error message
> which pointed out that you omitted a required HTTP/1.1 header?  ;-}  ;-}

Obviously, I'm complaining the contradiction between his opinion about
unix about what I've underlined.

And I take care to select my hosting providers not using MS-Windows
(since I'm critical about MS-Windows).

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

Our enemies are innovative and resourceful, and so are we. They never
stop thinking about new ways to harm our country and our people, and
neither do we.


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 V10 Issue 6924
***************************************


home help back first fref pref prev next nref lref last post