[10060] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3653 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 7 14:07:09 1998

Date: Mon, 7 Sep 98 11:00:23 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 7 Sep 1998     Volume: 8 Number: 3653

Today's topics:
        Beginner in Perl and Tape problem <gilles.bellaches@somepost.fr>
    Re: Beginner in Perl and Tape problem <sneaker@sneex.fccj.org>
        Berkeley DB_File <roberto.dipaolo@credit-suisse.ch>
        changing the default shell for system and exec commands <aori@iil.intel.com>
        flock behavior <samwang@freewwweb.com>
        Generate HTML (again) <voz@home.se>
    Re: Help with a bug in a soft (Stefan Berglund)
    Re: help with regexp <weav@hursley.ibm.com>
    Re: help with regexp <uri@sysarch.com>
    Re: help with regexp <uri@sysarch.com>
        How do I extract last line from multiline string? <NOSPAM.stephane.barizien@ocegr.fr>
    Re: How do I extract last line from multiline string? (Larry Rosler)
        how to call perl script in Windows 95 cozihome@hotmail.com
    Re: info/texi manual for 5.005_02 (Jan Dubois)
    Re: IO::File Permissions - Revisited <sneaker@sneex.fccj.org>
        Looking for scheduling app back end <dundee@dnai.com>
    Re: LWP:: How to get only <TITLE> from the HEAD? <aas@sn.no>
    Re: My cool DIRTTY PICS page (Nathan V. Patwardhan)
        Newbie:  Searching French Web Pages (Harley Jacoubsen)
    Re: Perl documentation (David Hawker)
    Re: Perl documentation (David Hawker)
    Re: Problem: Opening Word (ack!) doc w/ OLE (Jan Dubois)
    Re: Q: symlink under NT possible? <JKRY3025@comenius.ms.mff.cuni.cz>
    Re: reading a file backward <tchrist@mox.perl.com>
    Re: reading a file backward (Larry Rosler)
    Re: reading a file backward (Larry Rosler)
        Rewind Function...? <kgenus@newbridge.com>
    Re: Rewind Function...? (Larry Rosler)
        setuid CGI <samwang@freewwweb.com>
        shell execution troubles ped2202@my-dejanews.com
    Re: Subtotals on forms <r28629@email.sps.mot.com>
        Total Newbie:  Forms and accented characters (Harley Jacoubsen)
    Re: Using OLE to get Excel VBA using the clipboard (Jan Dubois)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Wed, 02 Sep 1998 15:15:02 +0200
From: Gilles Bellaches <gilles.bellaches@somepost.fr>
Subject: Beginner in Perl and Tape problem
Message-Id: <35ED44D6.BB3B1285@somepost.fr>

Hi everybody,
I just start to learn Perl because i use Tivoli on NT 4.0 SP3 French
(yes, i am)
My problem is this one :
We would like to know if there is a tape in the Tape Device before we
run the backup.
I saw in the "kernel32.dll" there are 2 functions i can use, but i don't
know how to do that ?
Or
This is the wrong way to do, so how could i do that ?

I hope you can help me and hope my English not too bad !!

Thanks for help
Gilles

gilles.bellaches@somepost.fr





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

Date: Mon, 07 Sep 1998 12:04:37 -0400
From: Bill 'Sneex' Jones <sneaker@sneex.fccj.org>
Subject: Re: Beginner in Perl and Tape problem
Message-Id: <35F40415.DEA101BB@sneex.fccj.org>

Gilles Bellaches wrote:
> 
> Hi everybody,
> I just start to learn Perl because i use Tivoli on NT 4.0 SP3 French
> (yes, i am)
> My problem is this one :
> We would like to know if there is a tape in the Tape Device before we
> run the backup.
> I saw in the "kernel32.dll" there are 2 functions i can use, but i don't
> know how to do that ?
> Or
> This is the wrong way to do, so how could i do that ?
> 
> I hope you can help me and hope my English not too bad !!
> 
> Thanks for help
> Gilles
> 
> gilles.bellaches@somepost.fr

Try ERRORLEVEL within a BATCH file, if the tape is there,
do Perlish stuff.

HTH,
-Sneex- 
__________________________________________________________________
Bill Jones | FCCJ Webmaster | http://webmaster.fccj.org/Webmaster
__________________________________________________________________
It is common sense to take a method and try it.  If it fails,
admit it frankly and try another.  But above all, try something.
                -- Franklin D. Roosevelt


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

Date: Mon, 07 Sep 1998 18:15:12 +0100
From: Roberto Di Paolo <roberto.dipaolo@credit-suisse.ch>
Subject: Berkeley DB_File
Message-Id: <35F4149F.C046B687@credit-suisse.ch>

Hi

I am trying to write a Perl script which uses DB_File, the Berkeley
Dababase. Everything is fine, when the data and the sript are located on
the same computer.

I need now to have the data on another machine than the script and I
wunder how to achieve that. I tried with the Intranet address of another
machine, where I have write access but it didn't work.

Do I need a complete different logic or do I just have to adjust some
syntax?

I appreaciate every help very much
Roberto Di Paolo

-------------------
This example shows of what I am talking about: "D:\\data\\data.db" is on
the local machine (Windows NT), other machines will be Windows NT and
also Solaris.

####### open object
my %table;
my $table=tie (%table, "DB_File", "D:\\data\\data.db", O_RDWR, 0644,
$DB_BTREE ) or die "opening DB: $!\n";
#######

$status=$table->seq($key,$value,R_CURSOR); # write data

####### close object
undef $table;
untie %table;
#######




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

Date: Mon, 07 Sep 1998 18:22:12 +0200
From: aori <aori@iil.intel.com>
Subject: changing the default shell for system and exec commands
Message-Id: <35F40834.BBE2A91F@iil.intel.com>

    Hi !
    does anyone know how ??????
    thanks Ori.




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

Date: Mon, 07 Sep 1998 12:16:55 -0500
From: Sam Wang <samwang@freewwweb.com>
Subject: flock behavior
Message-Id: <35F41507.2D94157A@freewwweb.com>

i've looked thru man flock, llama and camel books, man perlfunc, but to
no avail. can any one tell me if, when, flock will automatically
flock(FILE, $LOCK_UN)? ie, i $LOCK_EX a filehandle. but if i don't
$LOCK_UN it'll automatically unlock by the end of the script. now, does
it automatically unlock after the explicit closing of the filehandle,
the implicit closing of the filehandle, or at the end of the script?



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

Date: Mon, 07 Sep 1998 19:02:37 +0200
From: Mattias Dahlberg <voz@home.se>
Subject: Generate HTML (again)
Message-Id: <35F411AD.A5C36AB3@home.se>

Imagine this simple text file "database"

[fromdate],[todate],[category],[event],[time]

ex. 091298,091998,film,Armageddon,0900

Now I would like to generate html pages based on the dates.

One page that shows every entry matching today's date (listed under the
different categories). The other pages should be called according to the
categories and list all matching entries, in dates order.

How do I do this? Are there any ready solutions out there? Is it hard?

Thanks in advance,
Matt


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

Date: 7 Sep 1998 17:01:00 GMT
From: f94stbe+news@dd.chalmers.se (Stefan Berglund)
Subject: Re: Help with a bug in a soft
Message-Id: <6t13gc$rq0$1@eol.dd.chalmers.se>

Plate Forme Jeunes Diplomes <plateforme@wanadoo.fr> wrote:
> $offre=$1 if /\b (Offre\b.*\bX)/;
> $date=$2 if /\b (Date\b.*\b98)/;
> $Ale=$3 if /\b (Ale\b.*\bTD)/;
> $duree=$4 if /\b (Recherche\b.*\bFONT)/;
> $descriptif=$5 if /\b (CENTER\b.*\bFONT)/;
> $lieu=$6 if /\b (Lieu\b.*\bFONT)/;
> $horaires=$7 if /\b (Horaires\b.*\bFONT)/;

Change all $[2-7] to $1
The counter starts from the beginning for each new regexp.

-- 
			/Stefan
			f94stbe+news@dd.chalmers.se

Life - the ultimate practical joke

finger f94stbe.pgp@dd.chalmers.se for public pgp-key


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

Date: Mon, 07 Sep 1998 16:47:09 +0100
From: Nick Weavers <weav@hursley.ibm.com>
Subject: Re: help with regexp
Message-Id: <35F3FFFD.A3ECF4AB@hursley.ibm.com>

This is a multi-part message in MIME format.
--------------73151D9C586A99383143A00E
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

 
--------------73151D9C586A99383143A00E
Content-Type: text/plain; charset=us-ascii; name="perl_question"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="perl_question"

> Can anybody help me?
>
> I the string snippet:
>
> library ibm; use ibm.synthesis_support.all; library ieee; use library ibm; use
> ibm.synthesis_support.all; library ieee; use ieee.std_logic_1164. ieee.std_log
> ic_1164.all; use work.hvt_synth.all; entity eiarb is end eiarb; architecture c
> 6sf of all; use work.hvt_synth.all; entity eiarb is end eiarb; architecture c6s
> f of eiar eiar b is function "="(x : std_logic_vector;y : std_logic_vector ) re
> turn boolean is b is function "="(x : std_logic_vector;y : std_logic_vector ) r
> eturn boolean is be be gin return std_match (x ,y ); end "="; begin new_request
> s_inp<= licreq & micreq gin return std_match (x ,y ); end "="; begin new_reques
> ts_inp<= licreq & micreq & & picreq; new_requests_pulse (2 downto 0 ) <= (new_r
> equests_inp (2 downto 0 ) and picreq; new_requests_pulse (2 downto 0 ) <= (new_
> requests_inp (2 downto 0 ) and no no t new_requests (2 downto 0 )); new_reqs_pu
> lse<=new_requests_pulse; mreqs <= t new_requests (2 downto 0 )); new_reqs_pulse
> <=new_requests_pulse; mreqs <= mreql mreql
>
> I am looking for this bit:
>
> function "="(x : std_logic_vector;y : std_logic_vector ) return boolean is begi
> n return std_match (x ,y ); end "=";
>
> I have tried the following which works:
> 00 #!/perl5
> .. ...
> 01 ($type,$funcname,$rest) = $file_string =~ /
> 02      \b           (?# start at a word boundary)
> 03      (function)   (?# followed by the word "function")
> 04      \s+          (?# followed by one or more spaces)
> 05      (\S+)        (?# followed by the function name which must be remembered)
> 06      \s*          (?# followed by none or more spaces)
> 07      \(
> 08      (.*?         (?# followed by anything)
> 09      \b           (?# followed by a word boundary)
> 10      end          (?# followed by the word "end" preceded by a space)
> 11      \s+          (?# followed by one or more spaces)
> 12      \S+          (?# followed by the function name)
> 13      \s*          (?# followed by one or more spaces)
> 14      \;)          (?# followed by a semicolon)
> 15 /sx;
> 16
> 17
> 18 print $file_string;
> 19 print "\n\n";
> 20 print "$type = $funcname\n";
>
> Which results in:
>
> function = "="
> rest = x : std_logic_vector;y : std_logic_vector ) return boolean is begin retu
> rn std_match (x ,y ); end "=";
>
> But the pattern isn't as strict as I would like since line 12 should really use
> the value that was captured by line 05. However, when I try:
>
> 00 #!/perl5
> .. ...
> 01 ($type,$funcname,$rest) = $file_string =~ /
> 02      \b           (?# start at a word boundary)
> 03      (function)   (?# followed by the word "function")
> 04      \s+          (?# followed by one or more spaces)
> 05      (\S+)        (?# followed by the function name which must be remembered)
> 06      \s*          (?# followed by none or more spaces)
> 07      \(
> 08      (.*?         (?# followed by anything...)
> 09      \b           (?# ...up to the next word boundary)
> 10      end          (?# followed by the word "end")
> 11      \s+          (?# followed by one or more spaces)
> 12      \1           (?# followed by the function name captured in 05)
> 13      \s*          (?# followed by one or more spaces)
> 14      \;)          (?# followed by a semicolon)
> 15 /sx;
> 16
> 17
> 18 print $file_string;
> 19 print "\n\n";
> 20 print "$type = $funcname\n";
>
> Gives:
>
>  =
>  rest =
>
> I tried using $1 rather than \1 but to no avail. Can anyone tell my why \1 does
> not work in this expression?
>
> Thanks,
> Nick Weavers.

--------------73151D9C586A99383143A00E--



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

Date: 07 Sep 1998 12:07:03 -0400
From: Uri Guttman <uri@sysarch.com>
To: weav@hursley.ibm.com
Subject: Re: help with regexp
Message-Id: <x7d89729g8.fsf@sysarch.com>

>>>>> "NW" == Nick Weavers <weav@hursley.ibm.com> writes:

  NW> Can anybody help me?

  NW> I the string snippet:

<illegible text snipped>
                                                                                
  NW> Which results in:

<illegible text snipped>

  NW> Thanks, Nick Weavers.

the only ones who could read this have 5 eyes on mounted on independent stalks.

please reformat it so we can read it and you will probably get an
answer.

uri


-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
uri@sysarch.com  ------------------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: 07 Sep 1998 12:46:26 -0400
From: Uri Guttman <uri@sysarch.com>
To: weav@hursley.ibm.com
Subject: Re: help with regexp
Message-Id: <x7af4b27ml.fsf@sysarch.com>

>>>>> "NW" == Nick Weavers <weav@hursley.ibm.com> writes:

  NW> This is a multi-part message in MIME format.
  NW> Content-Type: text/plain; charset=us-ascii

why do you use MIME for plain text? why do you post MIME at all to this
group? next time just send the plain code, formatted so it can be
read. the large string in the beginning is not line wrapped either.

  >> I the string snippet:
  >> f of eiar eiar b is function "="(x : std_logic_vector;y : std_logic_vector ) re


are the "" around = real? you don't match them in the regex.

  >> 00 #!/perl5

you should not use perl5 as the program name. perl4 is dead. there is
only the one true perl.

  >> .. ...
  >> 01 ($type,$funcname,$rest) = $file_string =~ /
  >> 02      \b           (?# start at a word boundary)

/x comments can be plain # comment text.
the form you are using is for inline comments without /x

  >> 03      (function)   (?# followed by the word "function")

this is \1!!! which you don't use so remove the ()

  >> 04      \s+          (?# followed by one or more spaces)
  >> 05      (\S+)        (?# followed by the function name which must be remembered)

this is \2!! (or \1 if you follow my previous comment

  >> 06      \s*          (?# followed by none or more spaces)
  >> 07      \(
  >> 08      (.*?         (?# followed by anything...)
  >> 09      \b           (?# ...up to the next word boundary)
  >> 10      end          (?# followed by the word "end")
  >> 11      \s+          (?# followed by one or more spaces)
  >> 12      \1           (?# followed by the function name captured in 05)

see previous comments

  >> 13      \s*          (?# followed by one or more spaces)
  >> 14      \;)          (?# followed by a semicolon)
  >> 15 /sx;
  >> 16

hth,

uri


-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
uri@sysarch.com  ------------------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Mon, 7 Sep 1998 17:44:50 +0200
From: "Stephane Barizien" <NOSPAM.stephane.barizien@ocegr.fr>
Subject: How do I extract last line from multiline string?
Message-Id: <6t0ut5$kv23@janus.ocegr.fr>

I have a string that contains something like

a\nb\nc\nd\n

(output from Net::Telnet::waitfor, FWIW)

I want to extract the last "line" ("d" in my example) to a var
and keep the rest in the original variable.

I've tried:

chop ($x);
$x =~ s/\n([^\n]+)\\z//m;
$y = $1;

and it doesn't work (don't ask me why \\z and not \z: w/ only one \
I get a match somewhere in my string...)

Any help will be greatly appreciated.

P.S. One nice thing about Perl re's is that you can do ANYthing.
One bad thing is that it can take you an unknown amount of time to find out
HOW.





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

Date: Mon, 7 Sep 1998 09:45:19 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How do I extract last line from multiline string?
Message-Id: <MPG.105dad7a4ee2c8b989831@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <6t0ut5$kv23@janus.ocegr.fr> on Mon, 7 Sep 1998 17:44:50 
+0200, Stephane Barizien <NOSPAM.stephane.barizien@ocegr.fr> says...
> a\nb\nc\nd\n
 ...
> I want to extract the last "line" ("d" in my example) to a var
> and keep the rest in the original variable.
> 
> I've tried:
> 
> chop ($x);
> $x =~ s/\n([^\n]+)\\z//m;
> $y = $1;
> 
> and it doesn't work (don't ask me why \\z and not \z: w/ only one \
> I get a match somewhere in my string...)

$x = "a\nb\nc\nd\n";
$x =~ s/\n([^\n]*)\n$//;   # $x becomes "a\nb\nc"
$y = $1;                   # $y becomes "d"

All you had wrong was that "\\z".  Probably you were thinking of "\Z", 
but even that is unnecessary -- "\n$" works fine.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Mon, 07 Sep 1998 17:06:06 GMT
From: cozihome@hotmail.com
Subject: how to call perl script in Windows 95
Message-Id: <6t13pv$aqn$1@nnrp1.dejanews.com>

I am unix programmer. i lookin at a easy way to call
perl engine script which asks some questions using Visual basic
or html. is there a easy way or FAQ. thanks in advance.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Mon, 07 Sep 1998 19:37:30 +0200
From: jan.dubois@ibm.net (Jan Dubois)
Subject: Re: info/texi manual for 5.005_02
Message-Id: <35f415fc.1336481@news2.ibm.net>

[mailed & posted]

"B. K. Oxley (binkley) at Work" <binkley@eps.inso.com> wrote:

>Does anyone have info files, or texi sources, for 5.005_02?  I can only
>find POD, HTML and text files for the documentation, and I'd like to get
>at it from Emacs.  (Yes, I know about the slightly out-of-date info
>files for 5.004_04).

That's the best there is at the moment. But I have received word from
Krishna Shamu Sethuraman (the "author" of the aforementioned .info files)
that he'll create another set for 5.005 whenever he gets the time (which
might take a while (e.g. months). So you can either live with the current
version and wait or create your own set (using his pod2info.pl script). It
will probably also require some more tinkering by hand though.

-Jan



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

Date: Mon, 07 Sep 1998 11:52:17 -0400
From: Bill 'Sneex' Jones <sneaker@sneex.fccj.org>
Subject: Re: IO::File Permissions - Revisited
Message-Id: <35F40131.AE769C27@sneex.fccj.org>

Ronald J Kimball wrote:
> 
> Lack Mr G M <gml4410@ggr.co.uk> wrote:
> >
> 
> That was a good call on why IO::File wasn't working as Sneex expected!
> 

Actually, no, I had tried several incantations of this witchcraft,
both including 0600 and "0600", I apologize for the mis-post.

I can get around the problem by specifically calling chmod,
which incidentally, does not think of the a passed parameter
as octal if passwd via $scalar or shifted off ARGV

But I digress, I was speaking originally of IO::File

Hmmm, not a big deal, just a 'gotcha...'
-Sneex- :] 
__________________________________________________________________
Bill Jones | FCCJ Webmaster | http://webmaster.fccj.org/Webmaster
__________________________________________________________________
It is common sense to take a method and try it.  If it fails,
admit it frankly and try another.  But above all, try something.
                -- Franklin D. Roosevelt


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

Date: 7 Sep 1998 16:25:01 GMT
From: "Sean Scannell" <dundee@dnai.com>
Subject: Looking for scheduling app back end
Message-Id: <01bdda73$260507c0$8aecb5cf@fritz.ccnet.com>

I've been asked to build an application to enable company employees to
dynamically sign up for conference rooms through a web browser.  Currently,
changes are made by an administrator using MS Schedule + , then static HTML
is posted to the internal site.

I've considered DBI with mySQL, or plain flat files, using DateManip.  But
I am wondering if there's a scheduling/ calendar back end for Linux or
Solaris out there that would be better.  

Or maybe I'll find that MS Schedule + is a wonderful example of open
architecture with a newsgroup full of happy DBI-using advocates.

  


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

Date: 07 Sep 1998 17:59:55 +0200
From: Gisle Aas <aas@sn.no>
Subject: Re: LWP:: How to get only <TITLE> from the HEAD?
Message-Id: <m3n28b7w1w.fsf@furu.g.aas.no>

Marta Sochorova <sochorov@vse.cz> writes:

>    I use LWP::UserAgent to GET a http document, but it takes too long.
> If I use HEAD, I get some information (server, last modified, ...), but not
> <TITLE> and <META.....>.
> 
> Can I get <TITLE> without waiting for the whole document?

Yes.  As you found out HEAD does not work, because the server will not
send any part of the document.

You have two options.  The simplest one is to set the $ua->max_size to
some value that is big enough to include the <HEAD> and small enough
that you accept to to wait for it to be transfered.  Demonstrated by
the following code:

   my $page = shift || die;

   use LWP;
   $ua = LWP::UserAgent->new;
   $ua->max_size(1024);       # hope <title> is within first 1024 bytes

   $res = $ua->request(HTTP::Request->new(GET => $page));
   print "Title: ", $res->title, "\n";

The second and safer option is to use the HTML::HeadParser directly
and feed it with data until it has seen the whole <HEAD> section.
Something like this should do the job:

   my $page = shift || die;

   use LWP;
   $ua = LWP::UserAgent->new;
   $ua->parse_head(0);

   use HTML::HeadParser;
   $p = HTML::HeadParser->new;

   $res = $ua->request(HTTP::Request->new(GET => $page),
                       sub {
                           my $data = shift;
                           die "Done" unless $p->parse($data);
                       });

   print "Title: ", $p->header("Title"), "\n";
   #print $res->as_string;

-- 
Gisle Aas


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

Date: Mon, 07 Sep 1998 16:22:58 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: My cool DIRTTY PICS page
Message-Id: <CLTI1.230$k6.2772375@news.shore.net>

278345@msn.com wrote:
: Check out my new home page with free xxx pics.

DIRTTY?  Maybe this is some kind of new I/O or maybe it's something
that has to do with your browser, but either way it doesn't have
anything to do with Perl!  Hope this helps!

--
Nate Patwardhan|root@localhost
"Fortunately, I prefer to believe that we're all really just trapped in a
P.K. Dick book laced with Lovecraft, and this awful Terror Out of Cambridge
shall by the light of day evaporate, leaving nothing but good intentions in
its stead." Tom Christiansen in <6k02ha$hq6$3@csnews.cs.colorado.edu>


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

Date: Mon, 07 Sep 1998 13:03:39 -0400
From: harley@dreamribbon.com (Harley Jacoubsen)
Subject: Newbie:  Searching French Web Pages
Message-Id: <harley-0709981303390001@ppp-5200-0117.tor.total.net>

Hi!

I am using the "Intermediate Search" Perl search script from Fluid
Dynamics (http://www.xav.com) (a script based on the Simple Search Perl
script from Matt's Perl Archive, http://www.worldwidemart.com) to search a
site with French web pages.  My problem is thus:

If I search for words like say "icole" or "modhle" I won't get any hits,
because all instances of these words in the web pages are actually
"&eacute;cole" and "mod&egrave;le".

Would the solution to this problem be to tell the script something like:

"if I find 
i
in the word(s) submitted for searching I will change each to 
&eacute;

if I find 
h
in the word(s) submitted for searching I will change each to 
&egrave;

etc.

before I search the HTML files"

 ... or is there a more simple solution to this problem?

(Yes, I know that with the aforementioned script I can enter words that
have accented characters "non-HTML-ized" in the meta name=keywords tag,
but that doesn't really solve the problem of full text searching the
required pages.)

Thanks in advance for any response!

Regards!

Harley
harley@dreamribbon.com
http://www.dreamribbon.com

PS. Please cc your reply to my personal email address, as I do not
frequent this newsgroup often.  Thanks!


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

Date: Mon, 07 Sep 1998 17:26:28 GMT
From: dhawker@removethis.bigfoot.com (David Hawker)
Subject: Re: Perl documentation
Message-Id: <35fc06a8.1051528@news.cableol.net>

Sorry this took a long time to get posted...

On Mon, 24 Aug 1998 22:56:36 +0900, no.unsoliciteds@dead.end.com felt the
need to post:

>David Hawker wrote:
>
>> Well if you can say you've had no spam from doing this, I will take your
>> advice.
>
>I don't know about Tom, but on the past occasions I posted to a NG and I
>DIDN'T munge my addresses I got deluged spam trying to sell me stuff,

Me too. So I re-corrupted it.

>resulting in me having to change email addresses to get away from it and
>whoever else went to look at Deja News to get suckers to mass mail from.

Huh?! Sorry, this last sentence doesn't seem to make sense. There are too
many things you could mean, and not enough commas :)

>Whether or not this means I won't get help with any queries I post is

I know someone who won't help you: Tom Christiansen.

>secondary to not having to hook up to my mail account by telnet and delete all
>the spam before down loading my real mail.

I'm thinking of making a CGI service to do this with a nice web-type
interface instead of the text-based jargon you have to deal with using
telnet. Perhaps you'd be interested in helping test it etc.

--
dhawker@bigfoot.com | ICQ 7222349
http://dhawker.home.ml.org


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

Date: Mon, 07 Sep 1998 17:26:33 GMT
From: dhawker@removethis.bigfoot.com (David Hawker)
Subject: Re: Perl documentation
Message-Id: <35fb05d5.840679@news.cableol.net>

On 29 Aug 1998 19:27:00 GMT, cberry@cinenet.net (Craig Berry) felt the need
to post:

>Bart Lateur (bart.mediamind@tornado.be) wrote:

I never got your post :(

>: Craig Berry wrote:
>: 
>: >So you don't know the difference between statements and functions?
>: 
>: Ouch. Perl doesn't MAKE much distinction between expressions and
>: statements, or between functions and procedures. For example:
>
>Well, no, actually there's a big difference; it's just that an expression
>(evaluated for its side effects, typically) is the simplest kind of
>statement.  My point was that foreach is a more complex kind of statement,
>not a kind of function (and thus a building block of an expression).
>
>: I think a simple TOC, with ALL Perl keywords/operators, and the POD
>: file(s) where they are documented, would help less experienced greppers.
>
>That much is probably true.  Of course, the index of the Camel book is one
>such (though admittedly you have to pay for it).

Everything in the Camel book is probably available on the Internet
somewhere or other.

Your idea for a complete TOC listing is a good one.

--
dhawker@bigfoot.com | ICQ 7222349
http://dhawker.home.ml.org


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

Date: Mon, 07 Sep 1998 19:37:31 +0200
From: jan.dubois@ibm.net (Jan Dubois)
Subject: Re: Problem: Opening Word (ack!) doc w/ OLE
Message-Id: <35f5176b.1703659@news2.ibm.net>

[mailed & posted]

scott@softbase.com wrote:

>Charles Sherman (euschsh@am1.ericsson.se) wrote:
>> 	$wd->Documents->Open('FileName:="C:\DOCS\MYDOC.DOC"'); 
>
>Perl's Win32::OLE does *not* support positional parameters
>like VB does. You *can't* use the := syntax. You must
>list the parameters in order.

I'm sorry Scott, but that is just plain wrong (I know because I implemented
this myself): You can use a reference to a hash as the last parameter to any
OLE method call to provide named parameters in addition to the positional
ones in front of it. Please check the included PODs! You might also want to
check into Win32::OLE::Const, which allows you to use all the named
constants from the type libraries too. It was the old ActiveState OLE module
that didn't have all this. But the 5.005 ActivePerl builds now ship with
Win32::OLE, so it should be generally available now.

-Jan


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

Date: Mon, 07 Sep 1998 19:41:37 -0700
From: Jan Krynicky <JKRY3025@comenius.ms.mff.cuni.cz>
Subject: Re: Q: symlink under NT possible?
Message-Id: <35F49961.5A52@comenius.ms.mff.cuni.cz>

Bernhard Ehrminger wrote:
> 
> Hi,
> I would like to know if symlink works under NT?
> IF not: are there other options for creating links
> in an automatic manner under NT (no its not a joke)?
> 
> cheers Bernhard

Symlinks NO. Hardlinks YES. The ResKit contains ln.exe that allows you
to create them.
I've also get a snipet of C code which I will (as the time permits)
rewrite to perl
(using Win32::API module) and add to my Win32::FileOp.

Till then use the ln.exe

Bye, Jenda
http://jenda.krynicky.cz/


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

Date: 7 Sep 1998 16:19:54 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: reading a file backward
Message-Id: <6t113a$4qi$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    lr@hpl.hp.com (Larry Rosler) writes:
:file instead of an array of line offsets, or am I hallucinating?  How is 
:this approach different from indexing a database file to provide speedy 
:random access, except that here the index is created on the fly in 
:memory?

Did you measure this?

# Test1 -- use the store and backup way
    @lines = <>;
    for ($i = $#lines; $i >= 0; $i--) {
	print $lines[$i];
    } 

# Test2 -- use the offset and seek way
    $FILE = shift;
    open FILE or die $!;
    for ($addr = 0; <FILE>; $addr = tell) {
	$offset[$.] = $addr;
    } 
    for ($i = $#offset; $i > 0; $i--) {
	seek(FILE, $offset[$i], 0) or die $!;
	print scalar <FILE>;
    } 


Here are the results:

    % time perl test1 /etc/termcap > /dev/null
    0.260u 0.030s 

    % time perl test2 /etc/termcap > /dev/null
    0.540u 0.070s

And now for perspective:

    % time perl -e 'print reverse <>' /etc/termcap > /dev/null
    0.210u 0.030s 

Your approach is slower, Larry. :-)

--tom
-- 
 "Unix has its weak points, but its file system is not one of them." -Chris Torek


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

Date: Mon, 7 Sep 1998 10:21:41 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: reading a file backward
Message-Id: <MPG.105db5fef3b17845989833@nntp.hpl.hp.com>

In article <x7n28d2689.fsf@sysarch.com> on 06 Sep 1998 00:52:06 -0400, 
Uri Guttman <uri@sysarch.com> says...
 ...
:> larry,
:> 
:> you keep inspiring me to come up with better solutions! keeps me on my
:> toes!
:> 
Glad to be of service, sir!

:> your method is good but why read the file twice? why not just scan 
from
:> the end of the file. here is some very loose pseudo code of the 
proposed
:> algorithm.

Mark-Jason Dominus suggested that this morning.  This is from my response 

to Jonathan Stowe:

/J\> I think this approach must be a candidate for MJD's
/J\> IO::Handle::Backwards Idea. ...
 ...
LR> In fact, MJD mentioned it to me, and offered ideas about how to do 
LR> the whole job reading the file once only.  I will pursue it as time 
LR> permits.

I had only written a few lines of pseudo-code description of this 
algorithm, with less detail than you have shown.

:> on start:
:> seek to end of file
:> seek back 1 block size

Could do in one seek:  seek IN, -$BLOCK, 2;

:> read in 1 block into buffer
:> 
:> LINELOOP:
:> scan buffer backwards for previous \n (rindex or regex to match last 
line)
:> if we have a line return line
:> 
:> if we are at seek position 0, return undef
:> seek back a block, read it in, prepend to buffer
:> 
:> next LINELOOP
:> 
:> 
:> this is fast, not too hard to code and efficient. it reads only a 
buffer
:> at a time and can work with any size file.
:> 
:> an optimization would be to read in blocks on file system block
:> boundaries. the last fragment block would be read in and then previous
:> blocks on their boundaries. also it could use sysopen and sysread
:> unless portability and other issues like handling exceptions are an
:> issue (see camel p. 229-230, sysread).
:> 
:> also as each block is read in, a list of lines positions could be
:> maintained which makes the calls to readline go faster. i don't know 
if
:> this would have any effect on the speed of reading the whole file in
:> backwards. 
:> 
:> 
:> does anyone want to work with me on it to make a module out of it? i
:> need more moral support than coding help, but i am willing to share 
the
:> profits and glory! i do like the name IO::Handle::Backwards.
:> it would only support <> or readline or readlines. maybe eof needs to 
be
:> supported too.

Having never written a module, I would enjoy looking over your shoulder 
and cheering or carping as appropriate.  Anyway, I started this whole 
thing by challenging the 'received wisdom' that one had to read the whole 
file into memory.  So I should help wrap it up.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Mon, 7 Sep 1998 10:29:03 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: reading a file backward
Message-Id: <MPG.105db7bd7d1d645989834@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <6t113a$4qi$1@csnews.cs.colorado.edu> on 7 Sep 1998 16:19:54 
GMT, Tom Christiansen <tchrist@mox.perl.com> says...
> In comp.lang.perl.misc, 
>     lr@hpl.hp.com (Larry Rosler) writes:
> :file instead of an array of line offsets, or am I hallucinating?  How is 
> :this approach different from indexing a database file to provide speedy 
> :random access, except that here the index is created on the fly in 
> :memory?
> 
> Did you measure this?
> 
> # Test1 -- use the store and backup way
 ...
> 
> # Test2 -- use the offset and seek way
 ... 
> Your approach is slower, Larry. :-)

Indeed.  At least both algorithms are O(n), so what's a mere factor of 2 
:-).

But subsequent discussion has induced Uri Guttman to implement a read-
once-block-by-block-from-the-end algorithm which *will* perform 
competitively.  (Looking over this thread, I found that our newsfeed 
rejected my previous post because of 'too much quoted content included'.  
I have just munged and resubmitted it.  I think it will clarify things 
somewhat.)

What I posted originally was a simple existence proof that contradicted 
Jonathan Stowe's assertion, which I then quoted from the Bighorn Sheep 
(that won't go over as well as the Llama or the Camel, I fear), anyway 
The Perl Cookbook, Recipe 8.4, p. 282:  "You *must* read the lines into 
memory, then process them in reverse order.  Needless to say, this 
requires at least as much available memory as the size of the file."  
[Emphasis added.]

I was focusing on the 'must', not on efficiency, though that came later 
the same day 'with a little help from my friends' (particularly Mark-
Jason Dominus).

Maybe one should grep for every 'must-do-this-or-that' and add 
'efficiently', because in the Turing sense such bald statements are 
almost certainly wrong.  :-)

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Mon, 7 Sep 1998 12:39:18 -0400
From: "Kevin Genus" <kgenus@newbridge.com>
Subject: Rewind Function...?
Message-Id: <6t11po$ab9@hernnews.us.newbridge.com>

Does there exist a rewind function, such as C/C++, so searching through a
file does not 'close' the file, or reach the end of the file?  Thanks for
any help.

-Kevin
mailto:kgenus@newbridge.com




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

Date: Mon, 7 Sep 1998 10:12:28 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Rewind Function...?
Message-Id: <MPG.105db3d3bec9176c989832@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <6t11po$ab9@hernnews.us.newbridge.com> on Mon, 7 Sep 1998 
12:39:18 -0400, Kevin Genus <kgenus@newbridge.com> says...
> Does there exist a rewind function, such as C/C++, so searching through a
> file does not 'close' the file, or reach the end of the file?  Thanks for
> any help.

In C, the 'rewind' function is implemented (and documented?) as a seek to 
offset 0 from the beginning of the file.  So how about `perldoc -f seek`?

That should help.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Mon, 07 Sep 1998 12:19:10 -0500
From: Sam Wang <samwang@freewwweb.com>
Subject: setuid CGI
Message-Id: <35F4158E.D2758F1C@freewwweb.com>

let me get this straight, i can run the cgi script under me (the owner),
if i set setuid to my ui, right? ok. great. but how do i find out my id?

and i can set id, with setuid "UID", right?



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

Date: Mon, 07 Sep 1998 16:20:28 GMT
From: ped2202@my-dejanews.com
Subject: shell execution troubles
Message-Id: <6t114b$6hm$1@nnrp1.dejanews.com>

I have a somewhat annoying problem with executing shell commands from within a
perl script.

A standard shell cmd might look like this:
qx/sleep 10/; or system("sleep 10");
and this works just as it should. The script forks out a process that could
look like something like this:

myuser    1323 10149  0.1 19:15:39 ttyp4        0:00.01 sleep 10
myuser   10149 32029  0.0 19:18:07 ttyp4        0:00.01 perl -w foo.pl

and will return to the perl script nicely.


The problem crops up when you try something like this:

qx/su - newuser -c sleep 10/;

Here, perl obviously checks for several commands and to be sure everything
works allright it adds a 'sh -c' (eg. fork a new shell and execute whatever
is after the '-c' flag)

the processes that comes out of this would look like this:

newuser   2598   842  0.1 19:18:07 ttyp4        0:00.02 -ksh -c sleep 10 (ksh)
myuser     842 32029  0.0 19:18:07 ttyp4        0:00.01 perl -w foo.pl

And this is where the new process never returns to the original perl script.
Strange. Hmm, well there's another way as well that produces yet another
result:


If you would do this instead:

qx/su - newuser -c 'sleep 10'/; (which is the way it

you would get an extra process that might be of some explanation:

newuser    3476 30427  0.2 19:22:57 ttyp4        0:00.02 -ksh -c sleep 5 (ksh)
myuser    30427  2848  0.1 19:22:57 ttyp4        0:00.01 sh -c su - newuser -c
'sleep 5'
myuser     2848 32029  0.0 19:22:57 ttyp4        0:00.01 perl -w foo.pl

basically, here you get two '-c' (:command) flags to execute.

Any help will be greatly appreciated.

Best regards,
//peter.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Mon, 07 Sep 1998 10:56:16 -0500
From: Tk Soh <r28629@email.sps.mot.com>
Subject: Re: Subtotals on forms
Message-Id: <35F40220.CBC9D5B@email.sps.mot.com>

Alan Melton wrote:

> I would like to print out a subtotal on $voll if the skunum
> is the same.
>
>     # Split the line on the pipe symbol.
>     ($dayy,$monthh,$yearr,$skunum,$voll,$costone,$costtot,$descc) =
> split (/\,/);


Try use a hash to keep the sub-totals, or also the 'sub-vol' if you want
to. Something like this:

	$subtotals{$skunum} = $costtot;
	$subvoll{$skunum} = $costvoll;


-TK


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

Date: Mon, 07 Sep 1998 13:02:24 -0400
From: harley@dreamribbon.com (Harley Jacoubsen)
Subject: Total Newbie:  Forms and accented characters
Message-Id: <harley-0709981302240001@ppp-5200-0117.tor.total.net>

Hi!

I have a question in regards to submitting words with accented characters
in forms, and the resulting output.  The following problem happens when
the popular FormMail.pl script from Matt's Perl Archive
(http://www.worldwidemart.com) and the Subscribe Me mail list script from
the CGI Script Center (http://cgi.elitehost.com) are used to process the
form content.

The problems is thus:  when words with accented characters are used (such
as some French words), the email message resulting from the form
substitutes those accented characters with weird characters.  For
example:  "` l'icole ga-va" becomes "} l'Hcole Aa-va" in the resulting
email

I think the problem could be one of the following three things:

1)  When the script says "print MAIL" it should be specifying the
character set or something (like ISO-LATIN blah, blah)

2)  The web server's SENDMAIL program is not configured to handle accented
characters.

3)  The computer/browser that receives  the email results from the form
does not have the correct "character set" setting, or some similar
misconfiguration.

Are any of the three above assumptions correct, or am I way off?

Thanks in advance for any response!

Regards!

Harley
harley@dreamribbon.com
http://www.dreamribbon.com

PS. Please cc your reply to my personal email address, as I do not
frequent this newsgroup often.  Thanks!


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

Date: Mon, 07 Sep 1998 19:52:41 +0200
From: jan.dubois@ibm.net (Jan Dubois)
Subject: Re: Using OLE to get Excel VBA using the clipboard
Message-Id: <35f719f3.2351511@news2.ibm.net>

scott@softbase.com wrote:

>Lynn Wilson (lynn@swcp.com) wrote:
>> I am trying to extract the embedded VBA code that is found in
>> Excel modules.
>
>WOW! It never ceases to amaze me some of the strange, off the wall
>things people want to do with programs like Excel.
>
>First of all, frankly I doubt anyone in the universe but you has ever
>tried to do this, and the odds of finding any help are astronomical.

Well, "Against all odds...", I've done something "remotely" similar.

>This is not something that you'd do everyday.
>
>I've never done it, but I know the Visual Basic Editor has an Export...
>menu item. If you knew how to program the VBE, you could call that.
>Problem is, that's one aspect of VBA which I have never seen discussed
>anywhere. The editor *is* programmable, it's just that I've
>never seen any examples of how it could be done. The Office 97
>Visual Basic Programmer's Guide mentions a VBE object model. That
>might be a starting place.
>
>The obvious problem with Excel and Perl is the Excel object model is a
>disaster area. In the online help, the "Modules()" collection of the
>Workbook does not appear (and I wonder if you're using some really old
>Excel).

There is a way to get there by pressing Effwun at the correct time in
the VB editor. I did this once or twice by accident, but it always
took me 5 minutes of searching to willfully reproduce this (you are
in a maze of twisting little hyperlinks...).

Anyways, during the PRK for Win32 time I wrote a test program for the
PerlCOM object that adds Altavista Babelfish access to MS Word through
the VBE object. The program (in Perl) writes a program (in VB) to the
NORMAL.DOT document template. At runtime, this VB program instantiates
a PerlCOM object and creates another Perl program on the fly, sends it
to the PerlCOM object and executes it. I don't have the PRK installed
on my machine right now, so I cannot check if the code still works
(Altavista might have changed their web page once again for one thing),
but the principles of using the VBE object from Perl will still be valid.
Excel and Word use the same VBE object (speaking of Office 97 SR 1 here,
otherwise there will be dragons).

Without further comments I'm appending the original program as posted
to the PRK beta list.

-Jan

***Warning*** Long lines below might be wrapped by your mailer!

Oh, and the code won't work without the commercial PerlCOM object, found
in the O'Reilly Perl Resource Kit for Win32!


#!perl -w
#
# Babelfish for Microsoft Word (using PerlCOM by ActiveState)
# Written by Jan Dubois (jan.dubois@ibm.net)
#
# DISCLAIMER: This is experimental code that might destroy your global
# NORMAL.DOT document template. Please make a backup copy of it before
# using this program.
#
# I also have no idea if using the altavista babelfish in this fashion
# is considered "fair use". Consult an intellectual property lawyer before
# using something like the code below in a production environment.
#
# This program installs a "babelfish" module and several menu entries in
# the NORMAL.DOT template. The menu entries will replace the active text
# selection with a translation by the babelfish engine of altavista. You
# only to run this program once:
#     perl -w babelfish.pl
#
# You should be able to uninstall the macros and menu entries by invoking:
#     perl -w babelfish.pl -uninstall
#
# This Perl program starts Word and then writes a Visual Basic module into
# the NORMAL.DOT template. This Visual Basic module again contains code to
# dynamically create a Perl program on the fly to talk to AltaVista. So this
# is a-program-in-a-program-in-a-program. :-)
#
# Note: The regular expression to extract the translated text from the AltaVista
# page must be updated whenever the layout of the babelfish page changes.
#

use strict;
use Getopt::Long;
use Win32::OLE qw(in with);
use Win32::OLE::Const 'Microsoft Office';
use Win32::OLE::Const 'Microsoft Visual Basic for Applications Extensibility';

my $Babelfish = 'Babelfish';

my $Uninstall;
GetOptions(Uninstall => \$Uninstall);

my $Word = Win32::OLE->new('Word.Application', 'Quit');

# Uninstall menu entries and code module from NORMAL.DOT
if (1) {
    local $Win32::OLE::Warn = 0;

    # Remove menu entry
    my $Control = $Word->CommandBars('Tools')->Controls($Babelfish);
    $Control->Delete if defined $Control;

    # Remove code module
    my $Components = $Word->NormalTemplate->VBProject->VBComponents;
    my $Component = $Components->Item($Babelfish);
    $Components->Remove($Component) if defined $Component;
}
exit if $Uninstall;

# Save names of all existing components
my $Components = $Word->NormalTemplate->VBProject->VBComponents;
my %Components = map { $_->{Name} => 1 } in $Components;
# Create new code component; unfortunately Add() doesn't return the object
$Components->Add(vbext_ct_StdModule);
# Find new component in collection. This is probably the last element,
# but the documentation doesn't guarantee it.
my $CodeModule;
foreach my $Component (in $Components) {
    unless ($Components{$Component->Name}) {
	$Component->{Name} = $Babelfish;
	$CodeModule = $Component->CodeModule;
	last;
    }
}
undef $Components;
die "Couldn't rename new module to '$Babelfish'" unless defined $CodeModule;

# Create main VisualBasic "Babelfish" function
$CodeModule->AddFromString(<<'EndOfSub');
Sub Babelfish(LanguagePair As String)
    If Selection.Start = Selection.End Then
        MsgBox "No text selected for translation!", vbOKOnly, "Word - Babelfish"
        Exit Sub
    End If

    Dim PerlCOM
    Set PerlCOM = CreateObject("PerlCOM.Script")

    PerlCOM.EvalScript _
"   use LWP::UserAgent;                                                                          " & _
"   use HTTP::Request;                                                                           " & _
"   use HTTP::Headers;                                                                           " & _
"   sub Babelfish {                                                                              " & _
"       my ($Text,$LanguagePair) = @_;                                                           " & _
"       $Text = qq{doit=done&languagepair=$LanguagePair&urltext=$Text};                          " & _
"       my $URL = 'http://babelfish.altavista.digital.com/cgi-bin/translate?';                   " & _
"       my $Header = HTTP::Headers->new(['Accept' => 'text/html'],                               " & _
"                                       ['Content-type' => 'application/x-www-form-urlencoded'], " & _
"                                       ['Content-length' => length($Text)]);                    " & _
"       my $Request = HTTP::Request->new('POST', $URL, $Header, $Text);                          " & _
"       $_ = LWP::UserAgent->new->request($Request)->content;                                    " & _
"       m|/gifs/clear.gif.+?arial, helvetica.>(.+?)<br>|s;                                       " & _
"       return $1;                                                                               " & _
"   }"

    NewText = PerlCOM.Babelfish(Selection.Text,LanguagePair)
    Set PerlCOM = Nothing

    Selection.Delete
    Selection.InsertAfter NewText
End Sub
EndOfSub

# Create main "Babelfish" entry in the "Tools" menu
my $Menu = $Word->CommandBars('Tools')->Controls->Add({Type => msoControlPopup, Before => 1});
$Menu->{Caption} = $Babelfish;

# Create a submenu entry and a VB function for each possible translation
my %Language = (en => 'English', fr => 'French',     de => 'German', 
		it => 'Italian', pt => 'Portuguese', es => 'Spanish');
foreach my $Direction (qw(to from)) {
    foreach my $Language (qw(fr de it pt es)) {
	my ($From,$To) = $Direction eq 'to' ? ('en', $Language) : ($Language, 'en');
	my $Caption = "$Language{$From} to $Language{$To}";
	my $LanguagePair = "${From}_$To";

	# Create Visual Basic function for this translation
	$CodeModule->AddFromString(<<"EndOfSub");
Sub $LanguagePair()
    Babelfish("$LanguagePair")
End Sub
EndOfSub

	# Add submenu item for this language pair
	with($Menu->CommandBar->Controls->Add({Type => msoControlButton}),
	     Caption => $Caption, OnAction => "$Babelfish.$LanguagePair");
    }
}
undef $CodeModule;



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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 3653
**************************************

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