[10933] in Perl-Users-Digest
Perl-Users Digest, Issue: 4534 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jan 2 23:07:18 1999
Date: Sat, 2 Jan 99 20:00:21 -0800
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, 2 Jan 1999 Volume: 8 Number: 4534
Today's topics:
$/ - How To Preserve Formatting After Separating... (UMD Vikram)
Re: $/ - How To Preserve Formatting After Separating... <ebohlman@netcom.com>
Re: Adding a path to the @INC variable <peter@berghold.net>
Re: Any NIS+ Perl Modules? <peter@berghold.net>
Re: Basic Perl DOS/Win95 + WWW + CGI course for Newbies <mike@chessell.demon.co.uk>
Re: Can perl preform an server side post through SSL? <gellyfish@btinternet.com>
Re: Converting globs to regexes (was: wildcard) <rra@stanford.edu>
Create virtual directory <elssa09@erase.callisto.si.usherb.ca>
Re: Dec Alpha Install Problem <infotech@discovernet.net>
Re: dynamic default page and file extenstion <gellyfish@btinternet.com>
Re: EXPERIENCED IN PERL ? <peter@berghold.net>
Finding elements between 2 arrays <design@raincloud-studios.com>
Re: New to perl (Alan Barclay)
Re: New to perl <dgris@moiraine.dimensional.com>
Re: numbers in base 36 (Abigail)
Parsing Lists (The Windwalker)
Re: Parsing Lists <gellyfish@btinternet.com>
Re: Perl Cookbook <design@raincloud-studios.com>
Re: Perl Cookbook <gellyfish@btinternet.com>
Perl equivalent of stringtables (I18n) (Robin D.F. Silk)
Re: Perl equivalent of stringtables (I18n) <ebohlman@netcom.com>
Re: Perl equivalent of stringtables (I18n) <gellyfish@btinternet.com>
Re: Perl upgrade on sunos 4.1.3C (M.J.T. Guy)
Re: Regexp (Abigail)
Re: staircase effect <dchrist@dnai.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 3 Jan 1999 00:02:07 GMT
From: umdvikram@aol.com (UMD Vikram)
Subject: $/ - How To Preserve Formatting After Separating...
Message-Id: <19990102190207.29629.00004767@ng108.aol.com>
I have got the $/ working well, but the only problem is that the formatting
that I had before separating the database is gone.
How do I get those newly split parts to preserve the original formatting.
Code Snippet:
open(INFILE, 'info2.txt');
$/ = "BREAK\n";
while( <INFILE> ){
$TheLine = $_;
print " $TheLine <p><hr noshade size=2 width=600><p>";
}
close(INFILE);
The output has the correct text where it should, but how does one put back, or
not lose the /n?
Output:
Directory Heat ----
--------------------------------------------------------------------------
------------ Title Heat (1995)
ProdCo Warner Bros. Pictures Rating R Time 171 Director Michael Mann Writer
Michael Mann Cast Al Pacino, Robert De
Niro, Val Kilmer, Jon Voigt, Amy Brenneman, Ashley Judd ----
There should be /n's after Heat, the -----, ProdCo, etc....
It's a tab-delimited database.
Thanks,
Vikram
------------------------------
Date: Sun, 3 Jan 1999 00:26:23 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: $/ - How To Preserve Formatting After Separating...
Message-Id: <ebohlmanF4yJvz.1FK@netcom.com>
UMD Vikram <umdvikram@aol.com> wrote:
: The output has the correct text where it should, but how does one put back, or
: not lose the /n?
: Output:
: Directory Heat ----
: --------------------------------------------------------------------------
: ------------ Title Heat (1995)
: ProdCo Warner Bros. Pictures Rating R Time 171 Director Michael Mann Writer
: Michael Mann Cast Al Pacino, Robert De
: Niro, Val Kilmer, Jon Voigt, Amy Brenneman, Ashley Judd ----
: There should be /n's after Heat, the -----, ProdCo, etc....
: It's a tab-delimited database.
You don't have a Perl problem; you have an HTML problem. In HTML,
newlines outside of <PRE> elements are treated as spaces and do not
automatically generate line breaks. In this case, you probably ought to
put a <BR> element in your generated HTML wherever you need an explicit
line break.
------------------------------
Date: Sun, 03 Jan 1999 03:23:36 GMT
From: "Peter L. Berghold" <peter@berghold.net>
Subject: Re: Adding a path to the @INC variable
Message-Id: <368EE2B5.171672E2@berghold.net>
douglas de vine wrote:
> How do I add a path to the @INC variable which contains all the paths to
> look for *pm files?
Having read the answers that other folks gave on how to do this, let me also
add one more method. If you set up something like:
BEGIN {
push(@INC,"/some/path/some/where");
}
that will work as well. I still use that method over the use library
'/some/where/over/the/rainbow' method because everything between BEGIN{ and
} gets executed before the interpreter executes the rest of the code. I use
this especially where I have configuration files changing things around (for
instance, test vs. production paths) and I might not want to hard code in
the path to my libraries.
Just another viewpoint FWIW....
--
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Peter L. Berghold Peter@Berghold.Net
PGP Key ID: 0xA029549E http://www.berghold.net
ICQ# 11455958
------------------------------
Date: Sun, 03 Jan 1999 03:38:10 GMT
From: "Peter L. Berghold" <peter@berghold.net>
Subject: Re: Any NIS+ Perl Modules?
Message-Id: <368EE621.8E5B62B4@berghold.net>
"Paul Virgo.RMS.23/S411.x67878" wrote:
> I would like to write some web-based NIS+ apps in Perl and was wondering
> if there are
> any pre-written NIS+ modules I can download? Thanks in advance.
>
>
Paul,
Check out the CPAN site www.cpan.org. I know that I saw one there, but I'm
not sure how functional it is.. I know it is still in BETA. (or was it
Alpha???)
--
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Peter L. Berghold Peter@Berghold.Net
PGP Key ID: 0xA029549E http://www.berghold.net
ICQ# 11455958
------------------------------
Date: Sat, 2 Jan 1999 21:57:18 +0000
From: Mike Newsome <mike@chessell.demon.co.uk>
Subject: Re: Basic Perl DOS/Win95 + WWW + CGI course for Newbies , Christmas free offer .
Message-Id: <SFlKhMA+Ypj2EwrH@chessell.demon.co.uk>
Count me in also
In article <36817006.E6F@friko.onet.pl>, Expert <expert@friko.onet.pl>
writes
>I would like to give basic Perl course for newbies.
>Integration of CGI Perl scripts with WWW pages.
>Setting up simple WIN95/ web server and setting up web pages + CGI
>programs running on your PC , for testing purposes.
>
>Hope this course to be free, interactive, mayby on shareware basis.
>
>If some of you guys are interested I set up news group to move us
>there.
>regards,
>Jack
--
Mike Newsome Worthing, England
------------------------------
Date: 2 Jan 1999 23:37:39 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Can perl preform an server side post through SSL?
Message-Id: <76mak3$1rt$1@gellyfish.btinternet.com>
On Sat, 2 Jan 1999 16:39:01 -0500 Robby Black wrote:
> I am working on an e-commerce site that must post credit card info through
> https:// to an authorization center for processing. Can a ssi script use
> SSL to post to a remote server?
I think that there is a module available from CPAN that will do this.
I think that it has SSLeay in its name :)
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 02 Jan 1999 14:30:15 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Converting globs to regexes (was: wildcard)
Message-Id: <yllnjle2a0.fsf@windlord.stanford.edu>
Abigail <abigail@fnx.com> writes:
> Russ Allbery (rra@stanford.edu) wrote on MCMXLIX September MCMXCIII:
> ++ # WARNING: Untested code.
> ++ {
> ++ my ($escape, $or, $class);
> ++ sub convert {
> ++ local $_ = shift;
> ++ if ($escape) { $escape = 0; return '\\' . $_ }
> ++ elsif ($_ eq '\\') { $escape = 1; return '' }
> ++ elsif ($_ eq ']') { $class--; return $_ }
> ++ elsif ($class = 2) { $class-- if $_ ne '^'; return $_ }
> ^ Shouldn't that be == ?
Yup. Dominus spotted that too. Hence the untested code warning. :/ I
should wrap it in a module just to make it easier to write a regression
suite.
> I miss the special handling of files starting with a '.'. The shell
> wildcard '*' wouldn't return ".foo", but that's matched by '.*'.
That and * not matching / are things I'd add for a module (as options).
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Fri, 01 Jan 1999 22:22:47 -0500
From: JTJ <elssa09@erase.callisto.si.usherb.ca>
Subject: Create virtual directory
Message-Id: <368D9107.24B3@erase.callisto.si.usherb.ca>
I want to create (using a script) a virtual directory where
/home/mydirectory/something/
can also be read from:
/home/mydirectory/cgi-bin/something/
That way, I can call up the contents of:
http://www.blah.com/cgi-bin/something/
From:
http://www.blah.com/something/
(If anyone has a cgi-bin/cgiwrap, you may understand why I am doing
this. Anyone know of a short cut around that one?)
Thanks
John
------------------------------
Date: 3 Jan 1999 00:37:39 GMT
From: "Rick Spangenberg" <infotech@discovernet.net>
Subject: Re: Dec Alpha Install Problem
Message-Id: <76me4j$ep9$0@206.165.146.42>
All fixed. Downloaded correct perl version and it worked fine.
Sorry for posting.
==================
Rick Spangenberg wrote in message <76lrqa$8nq$0@206.165.146.15>...
>I am trying to install my own copy of Perl5 (perl5_005_53.tar.gz) at my ISP
>web hosted site so I can use DBI and other modules without affecting the
>ISP.
>
>I have been somewhat successfull but have three errors that prevent me
going
>any further. The machine is a Dec Alpha and this may be part of the
>problem. Other than defining the location for my new perl and accepting
all
>defaults, no other options were selected. The machine can handle threads
>but I allowed th default no threads to run as is hoping it would solve the
>problem.
>
>Perl's install is holding me up on a number of other things I have to do
>this weekend. Any help would be greatly appreciated.
>
>========================================
>
>A full log of the configure, make, make test and perl harness run is
>attached for your review. To my knowledge, I have no output from the the
>./myconfig shell script or I don't know where to find it.
>
>I also tried to run perlbug but got the following message:
>
>www19.eni.net> cd /www/itweb/cgi-bin/perl5.005_53
>www19.eni.net> perl -Ilib utils/perlbug
>Perl lib version (5.00553) doesn't match executable version (5.004) at
>lib/Config.pm line 7.
>BEGIN failed--compilation aborted at utils/perlbug line 13.
>www19.eni.net>
>
>I suppose this is because my profile still points to the root perl rather
>than the new install.
>
>Richard L. Spangenberg
>mailto:rls@itweb.com
>
>
>=========================================
>
>
>
>
>
------------------------------
Date: 2 Jan 1999 23:33:54 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: dynamic default page and file extenstion
Message-Id: <76mad3$1rq$1@gellyfish.btinternet.com>
On Sat, 2 Jan 1999 10:55:57 -0800 Wesley Cho wrote:
> Hi there...
>
> I am using Apach webserver, Perl 5 and Msql for database driven web site,
> and have a problem with default page.
>
> I need to create a dynamic default page for a website using perl and CGI.
> When I create a page and named default.cgi, it is not recognized by the ULR
> http://www.mywebsite.com. So what I did was create a page default.htm, and
> inserted a
<snip>
With apache this is perfectly configurable however it must be stressed that
this is a server configuration issue and nothing to do with Perl at all.
I'm sure that some kind but misguided soul will give you some answer but I
think that this question is perfectly answered in the Apache documentation
and if ypu dont find the answer there then I'm sure the nice folks at:
comp.infosystems.www.servers.unix will be most obliging.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 03 Jan 1999 03:26:36 GMT
From: "Peter L. Berghold" <peter@berghold.net>
Subject: Re: EXPERIENCED IN PERL ?
Message-Id: <368EE36B.4436A54E@berghold.net>
GSX wrote:
> I'm presently writing a Perl Coffee Maker. I've got the code to brew a
> great cup of Hazelnut...but I'm having a problem with the code for
> decaf.
>
> Will this make me ineligible for the job?
>
ACH! FOOOEY! No hazelnut. French Roast at double strength dammit! And all
the caffeine!
--
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Peter L. Berghold Peter@Berghold.Net
PGP Key ID: 0xA029549E http://www.berghold.net
ICQ# 11455958
------------------------------
Date: 2 Jan 1999 22:23:01 GMT
From: "Charles R. Thompson" <design@raincloud-studios.com>
Subject: Finding elements between 2 arrays
Message-Id: <76m685$cc2@bgtnsc02.worldnet.att.net>
I have a few arrays which specify fields in a database..
@db_user_definable_field_order=("client_company_name","client_contact","clie
nt_email_address","client_code");
@db=("client_id","client_company_name","client_contact","client_email_addres
s","client_code");
db defines the database fields, and db_user... defines fields a user is
allowed to modify. I have successfully written the modification code, but
know there has got to be an easier way to deal with looking in @db_user for
writeable fields. Within loop #2 of this structure I am looking to see if
the current db field is one that can be written to, if so a flag is set and
the #2 loop is exited.
for ($i=0; $i <= (@db-1); $i++){
$index = @db[$i];
my $can_write = 0;
for ($j=0; $j <= (@db_user_definable_field_order-1); $j++){
if (@db_user_definable_field_order[$j] eq $index){
$can_write = 1;
last;
}
}
if (($can_write) && ($form_data{$index} ne "")){
$new_row .= "$form_data{$index}\|";
}
else{
$new_row .= "$fields[$i]\|";
}
}
Is it possible to get the inner loop into one conditional if statement which
doesn't have to run through @db_user in a loop?
I know I could use a hash with if(exists($HASH{$KEY})) for @db_user, but ALL
of my db procedures are based on the array structure and the script is due
Monday so I'm pretty much stuck with it at this point. All my attempts have
seemed to try to evaluate the value in
$db_user_definable_field_order{$index}instead of just checking to see if it
($index) exists as an element in the array. It works now, but I think
getting around the loop will make a performance difference when modifying a
few hundred records in the database at a time.
Any help would be appreciated.
CT
------------------------------
Date: 3 Jan 1999 00:10:26 GMT
From: gorilla@elaine.drink.com (Alan Barclay)
Subject: Re: New to perl
Message-Id: <915322220.799864@elaine.drink.com>
In article <m3pv8xgwmq.fsf@moiraine.dimensional.com>,
Daniel Grisinger <dgris@moiraine.dimensional.com> wrote:
>0- Distributable applications
>
>My biggest complaint about perl is the difficulty in distributing
>applications written in perl. All I can do is hope that the site
>that wants to use my code has perl installed, that it was installed
>by someone with at least some semblance of clue, and that it has
>the proper versions of the modules that I'm using. Needless to say,
>at least one of these becomes a problem almost every time that I
>move a perl program to a new system.
>
>pl2exe (which, IIRC, is windows-only) is the right idea, but it isn't
>open source and it doesn't work on modern systems.
I'd have to disagree totally here. pl2exe is the wrong idea.
By distributing a perl program, I have one program which can be used on
any system which supports perl. If the downloader wants to make changes,
then she's got the enviroment to make any changes she wants.
Compare that to compiled to binary languages like C & C++. You need a
different compiled version for every version of every OS you want to
support. On some OS's, you have to compile multiple versions depending
on the enviroment. Yet after all that work, then the user gets a single
unchangable program. If there is a bug, the user upgrades or changes their
OS, or for some other reason changes their enviroment, then the user
has to either go and download again, or they're stuck with the version
they've got. Downloading the source isn't always so easy either, many
program archive sites don't keep an extensive collection of old versions,
so you might find that you've got to download a later version, perhaps
loosing some features you want, in order to make changes to the program.
What we should be working on is the problems you identify, better
installation procedures. "You haven't got perl installed, do you
wish to install it? [y]", "you need at least version 4.2 of Foo::Bar,
do you wish to upgrade [y]".
------------------------------
Date: 02 Jan 1999 18:18:47 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: New to perl
Message-Id: <m3af01gnm0.fsf@moiraine.dimensional.com>
gorilla@elaine.drink.com (Alan Barclay) writes:
> In article <m3pv8xgwmq.fsf@moiraine.dimensional.com>,
> Daniel Grisinger <dgris@moiraine.dimensional.com> wrote:
> >0- Distributable applications
<snip>
> >pl2exe (which, IIRC, is windows-only) is the right idea, but it isn't
> >open source and it doesn't work on modern systems.
>
> I'd have to disagree totally here. pl2exe is the wrong idea.
pl2exe itself is the wrong idea. Like I said, it isn't open source
and it's windows specific. But the ability to distribute my programs
as a single, working file isn't a bad idea.
> By distributing a perl program, I have one program which can be used on
> any system which supports perl.
No, you have a program which can be used on any system which has a
perl installed that resembles the perl you created it with. You still
have to worry about module dependencies, compile time options, and
incompatibilities between different versions of perl. This quickly
becomes a non-trivial task.
> If the downloader wants to make changes,
> then she's got the enviroment to make any changes she wants.
Unfortunately, many of my users aren't competent to make changes. For
the ones who are a complete local perl installation is superior to a
packaged binary. For the rest it would be nice to give them a single
program that will just work.
> Compare that to compiled to binary languages like C & C++. You need a
> different compiled version for every version of every OS you want to
> support. On some OS's, you have to compile multiple versions depending
> on the enviroment. Yet after all that work, then the user gets a single
> unchangable program. If there is a bug, the user upgrades or changes their
> OS, or for some other reason changes their enviroment, then the user
> has to either go and download again, or they're stuck with the version
> they've got.
I think that we're discussing different problems. I'm not worried
about distributing my programs across the internet to millions of
people. I'm worried about delivering my programs to a thousand
salespeoples' notebooks for them to use during demos. This becomes
much, much easier with a tool like pl2exe.
I'm not worried so much for technical reasons as for time and
management reasons. I don't have time to build, install, and maintain
perl on all of these people's computers, nor does my employer have the
ability to adequately manage the additional complexity. If I had a
tool such as pl2exe that I was comfortable with (read: open source and
crossplatform) then I'd find distributing perl programs much easier.
dgris
--
Daniel Grisinger dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: 3 Jan 1999 01:31:26 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: numbers in base 36
Message-Id: <76mh9e$f4k$1@client3.news.psi.net>
Abigail (abigail@fnx.com) wrote on MCML September MCMXCIII in
<URL:news:76m1cc$dr1$1@client3.news.psi.net>:
++ Smith and cat (inwap@best.com) wrote on MCML September MCMXCIII in
++ <URL:news:76ko6p$l7$1@shell3.ba.best.com>:
++ ++ In article <75oq7s$7ne$1@client3.news.psi.net>,
++ ++ Abigail <abigail@fnx.com> wrote:
++ ++ >Here's a one liner, with no need for Perl:
++ ++ >$ echo "obase = 789; 123 ^ 456" | bc
++ ++
++ ++ OK, which version of Unix have BC_BASE_MAX greater than 99?
++ ++ The POSIX standard won't allow obase to be three digits.
++ ++ The above command fails with "output base is too large" even on
++ ++ the 64-bit Solaris-7.
++
++
++ $ uname -a
++ SunOS alexandra 5.7 Generic sun4u sparc
++ $ bc --version
++ bc 1.04
++ Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc.
++ $
Also:
$ echo "obase = 789; 123 ^ 456" | bc --warn --standard
produces the same output. No warnings, and (according to the manpage)
--standard follows the POSIX standard exactly.
Abigail
------------------------------
Date: Sun, 03 Jan 1999 00:01:27 GMT
From: amerar@unsu.com (The Windwalker)
Subject: Parsing Lists
Message-Id: <3690b2c5.87307961@news.chaven.com>
Hello,
I have two questions.
If I have an HTML form that has a multiple selection list box, what
type of code do I need to get all my selections? Currently I am only
able to access the last selected option.
This leads into another question. If I need to repost the form data,
including the list box data as hidden fields, how would I do this?
Please send replies to my e-mail.
Thank you for your help.
Arthur
amerar@unsu.com
------------------------------
Date: 3 Jan 1999 00:51:20 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Parsing Lists
Message-Id: <76meu8$21g$1@gellyfish.btinternet.com>
On Sun, 03 Jan 1999 00:01:27 GMT The Windwalker wrote:
>
> Hello,
>
> I have two questions.
>
> If I have an HTML form that has a multiple selection list box, what
> type of code do I need to get all my selections? Currently I am only
> able to access the last selected option.
>
> This leads into another question. If I need to repost the form data,
> including the list box data as hidden fields, how would I do this?
>
Answer to both questions is to get the module CGI.pm, read the documentation
and use it in your programs.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 2 Jan 1999 22:29:05 GMT
From: "Charles R. Thompson" <design@raincloud-studios.com>
Subject: Re: Perl Cookbook
Message-Id: <76m6jh$e5b@bgtnsc02.worldnet.att.net>
>Best book on Perl I have, and I think I have them all, ORA and others!
I used to be intimidated by the 'animal books' until I finally got serious
about Perl.. now they barely ever make it back to the shelf.
>I just wish the damn thing was on a CD!
Eh.. c'mon... they return me of the days of 'Compute!' magazine! 4 hours of
coding from a book to play 5 minutes of a crappy game. I we loved every
minute of it. :)
CT
------------------------------
Date: 3 Jan 1999 00:07:06 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Perl Cookbook
Message-Id: <76mcba$1ur$1@gellyfish.btinternet.com>
On 2 Jan 1999 22:29:05 GMT Charles R. Thompson wrote:
>
> I used to be intimidated by the 'animal books' until I finally got serious
> about Perl.. now they barely ever make it back to the shelf.
>
Hey, I dont even have a shelf for them, they're just creeping up the side
of the chair and now I've got the 'sendmail' book back from the office
they're threatening to take over the whole room.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 3 Jan 99 00:12:41 GMT
From: silk@interlog.com (Robin D.F. Silk)
Subject: Perl equivalent of stringtables (I18n)
Message-Id: <silk.1265710001F@news.interlog.com>
I am trying to find the "correct" way to put all my strings into language
files so that I may display each string in the correct language at run time.
I have created a separate file of strings for each language. This is
necessary as each file/language has to be translated by a different
translator from English to French, German, .... etc.
Each string file contains a hash e.g.:
# strings_fr.pl
# French strings
%strings_fr = (
hello, "Bonjour",
goodbye, "Au revoir",
greetings, "Comment ca va?",
);
The main script contains the requires to "include" the strings e.g.
require 'strings_en.pl'; # English
require 'strings_fr.pl'; # French
I would like to create a hash of hashes so that I can do something like:
$language = "fr";
print "strings{language}{hello}\n";
Can anyone assist me in the correct way to create the hash %strings?
If there are other (better?) ways to achieve the same result, I would be
happy to be enlightened.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Robin Silk POTS: (416) 960-5289
278 Bloor St. E, Suite 1603 e-mail: silk@interlog.com
Toronto, Ontario, M4W 3M4
------------------------------
Date: Sun, 3 Jan 1999 00:31:19 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Perl equivalent of stringtables (I18n)
Message-Id: <ebohlmanF4yK48.1n6@netcom.com>
Robin D.F. Silk <silk@interlog.com> wrote:
: Each string file contains a hash e.g.:
: # strings_fr.pl
: # French strings
: %strings_fr = (
: hello, "Bonjour",
: goodbye, "Au revoir",
: greetings, "Comment ca va?",
: );
: The main script contains the requires to "include" the strings e.g.
: require 'strings_en.pl'; # English
: require 'strings_fr.pl'; # French
: I would like to create a hash of hashes so that I can do something like:
: $language = "fr";
: print "strings{language}{hello}\n";
: Can anyone assist me in the correct way to create the hash %strings?
my %strings = (fr=>\%strings_fr, en=>\%strings_en,...);
------------------------------
Date: 3 Jan 1999 01:03:51 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Perl equivalent of stringtables (I18n)
Message-Id: <76mfln$21m$1@gellyfish.btinternet.com>
On Sun, 3 Jan 99 00:12:41 GMT Robin D.F. Silk wrote:
> I am trying to find the "correct" way to put all my strings into language
> files so that I may display each string in the correct language at run time.
>
> I have created a separate file of strings for each language. This is
> necessary as each file/language has to be translated by a different
> translator from English to French, German, .... etc.
>
> Each string file contains a hash e.g.:
>
> # strings_fr.pl
> # French strings
>
> %strings_fr = (
> hello, "Bonjour",
> goodbye, "Au revoir",
> greetings, "Comment ca va?",
> );
>
>
> The main script contains the requires to "include" the strings e.g.
>
> require 'strings_en.pl'; # English
> require 'strings_fr.pl'; # French
>
>
> I would like to create a hash of hashes so that I can do something like:
>
> $language = "fr";
> print "strings{language}{hello}\n";
>
It could be as simple as :
%strings = (
'french' => {
hello => "Bonjour",
goodbye => "Au revoir",
greetings => "Comment ca va?",
),
'english' => {
hello => "Hello",
goodbye => "See You Later",
greetings => "How are you?",
),
};
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 3 Jan 1999 00:14:59 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Perl upgrade on sunos 4.1.3C
Message-Id: <76mcq3$d5k$1@pegasus.csx.cam.ac.uk>
Jonathan Stowe <gellyfish@btinternet.com> wrote:
>On 1 Jan 1999 21:26:23 GMT M.J.T. Guy wrote:
>> There is one restriction - version 5.005 and later of Perl require
>> an ANSI C compiler, which the Sun supplied cc is not. So you should
>> either stick with Perl version 5.004_04 or you'll need to install gcc.
>
>I have managed to compile Perl on *Solaris* using the c89 compiler that I
>believe is part of the Sun Workshop package - Trying to compile 5.005+ with
>the standard cc indeed does nto work. Check out /opt/SunWS*/bin for 'c89'.
Ooops. I meant to say "the cc compiler supplied with SunOS 4.1.3".
Or something. The paid-for compilers with Solaris 2.x do the job fine.
Mike Guy
------------------------------
Date: 3 Jan 1999 01:37:41 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Regexp
Message-Id: <76mhl5$f4k$2@client3.news.psi.net>
Paul Wood (john.wood@diamond.co.uk) wrote on MCML September MCMXCIII in
<URL:news:76m08e$tn$1@nclient3-gui.server.ntli.net>:
++ For some reason (probably obvious, but not to me) this regexp isn't doing
++ what i'd like it to:
++
++ s/(http:\/\/[\w\-.]+\.[a-zA-Z]{2,3}([\w\-.\/~]+)?)/<a href="$1"
++ target="_top">$1<\/a>/gi;
++
++ It should find any http:// urls and turn them into links. That it does fine,
++ but it's also allowing urls like this:
++
++ http://www.domain.illegalsuffix
++
++ Which the \.[a-zA-Z]{2,3} is there to prevent. Any ideas on where i'm going
++ wrong?
'\.[a-zA-Z]{2,3}' matches '.dom', while 'ain.illegalsuffix' matches
'[\w\-.\/~]+'.
You can match URLs with regexes, but don't expect them to be simple or short.
Abigail
------------------------------
Date: Sat, 2 Jan 1999 14:37:48 -0800
From: "David Christensen" <dchrist@dnai.com>
Subject: Re: staircase effect
Message-Id: <76m7ge$6ss$1@pollux.dnai.com>
PAUL SUTTON wrote in message
<01be35bd$7e3ef9a0$f8c322c3@default>...
>Hi, I am looking for a script to stop the staircase effect under
RHLinux
>5.2, Using A cannon BJC250. I have two but neither seem to work,
or the one
>in the printing how to causes a compile error when executing
>
>perl filter.pl or perl filter depending on how I name it
>
>Thanks in advance for any help,
>
>Paul Sutton
><lonehacker@hotmail.com>
There is a printer setup utility in the X control panel that has a
way to print a test page and fix any staircase effect.
David
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 4534
**************************************