[6408] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 33 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 1 08:07:19 1997

Date: Sat, 1 Mar 97 05:00:33 -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, 1 Mar 1997     Volume: 8 Number: 33

Today's topics:
     Re: Assigning an element to a multidimensional hash (M.J.T. Guy)
     Re: assigning ascii character to a variable <art2mis@apk.net>
     Re: can $_ be dissociated from its contents? <dbenhur@egames.com>
     Can anyone help me please! <hoffa@medio.mh.se>
     Re: Can anyone help me please! (Nathan V. Patwardhan)
     Re: GDBM,Perl HP 10.10 <spicano@ptdcs2.intel.com>
     Getting vars after http://ww/page.cgi? <HERE> (David Weibel)
     Re: How to spam - legitimately (Per Hedeland)
     Re: How to spam - legitimately (Luis Fernandes)
     Re: Howto use open2() <roderick@argon.org>
     Re: If you know perl this should be simple (Tad McClellan)
     Re: If you know perl this should be simple (Doug Holton)
     Re: Inline subroutines? <sadd@msc.cornell.edu>
     Re: Inline subroutines? <sadd@msc.cornell.edu>
     Interview With The Internet's Wise Guys Of Perl - Web W inforch@cris.com
     Re: Need Perl index creator script!! Help! (Doug Holton)
     Newbie question: perl, OS/2, and #! <NPHS@trader.com>
     Re: Perl as a shared library? (Frank D. Cringle)
     Re: Scoping problem using my() [kinda long] (M.J.T. Guy)
     Simple tr/// <kens@cannet.com>
     Re: Undefining a single element in a multidimensional a (Brian L. Matthews)
     Re: using \U and \L with edvEDV <jhi@alpha.hut.fi>
     Using color with the Curses module <microsys@IntNet.net>
     using perl modules (Scott Anderson)
     Validating data using // (Mark Thompson)
     Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)

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

Date: 1 Mar 1997 09:41:46 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Assigning an element to a multidimensional hash
Message-Id: <5f8tkq$924@lyra.csx.cam.ac.uk>

Chris Plachta  <stats9@mail.idt.net> wrote:
>
>and I want to assign some other hash a particular value:
>
>$new_hash{KEY1} = $hash{KEY1}
>
>without creating a reference, how do I do it?  When I do the above,
>%new_hash gets referenced to %hash, so now both data structures are
>pointing to the same data.

  %{$new_hash{KEY1}} = %{$hash{KEY1}};

will copy the contents of the hash.   See  perlref  for explanation.


Mike Guy


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

Date: 1 Mar 1997 00:24:48 GMT
From: "Craig or Diana Duncan" <art2mis@apk.net>
Subject: Re: assigning ascii character to a variable
Message-Id: <01bc25d6$785a1590$2e08b7ce@zeus>


How about
$b = chr($a);

I don't know if this will work for octal, though.

dh@rutile.iucr.ac.uk wrote in article <856976213.7493@dejanews.com>...
> How do you assign a character to a variable using just its ascii
> number.
> e.g.,
> 
> octal value for ascii 'A' is 101
> so I can
> print "\101";
> and it prints A, but how to i do this
> $a=101;
> $b="\$a";
> 
> I want $b to contain A. not a reference to $a



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

Date: Fri, 28 Feb 1997 23:18:11 -0800
From: Devin Ben-Hur <dbenhur@egames.com>
To: Rahul Dhesi <c.c.eiftj@66.usenet.us.com>
Subject: Re: can $_ be dissociated from its contents?
Message-Id: <3317D833.5956@egames.com>

Rahul Dhesi wrote:
> Is there any way in perl of doing such a thing?  My experiments with
> references did not yield useful results.  Something like:
> 
>    push(@::ARRAY, \$_);
>    $_ = 'something else';
> 
> did not work as I had hoped -- the reference pushed onto @::ARRAY points
> towards the current $_, and not towards original data that $_ contained.

Perhaps you need a newer version of Perl, or you did something 
odd in your experiment.  This code:

foreach (qw(one two three)) {
    push @a, \$_;
}
$_ = "junk";
print join(':', map($$_,@a));

prints:
  one:two:three

which seems like the behavior you were hoping for.
(This was Perl 5.003_07, Activeware Win32 port.)

HTH
--
Devin Ben-Hur      <dbenhur@egames.com>
eGames.com, Inc.   http://www.egames.com/
eMarketing, Inc.   http://www.emarket.com/
"Don't run away. We are your friends."  O-



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

Date: Sat, 1 Mar 1997 01:55:36 +0100
From: Robert Johansson <hoffa@medio.mh.se>
Subject: Can anyone help me please!
Message-Id: <Pine.GSO.3.95.970301015050.10048A-100000@ior>


Hi! 
I'm running a mud and I want a Tintin script to autoload and logon
a Character to the mud. Since You can`t start Tintin outside a Xterm
window in Unix I was suggseted to write a perl script that starts the
tintin script. The problem is I don't know anything about perl so could
anyone write a basic perl program that starts a tintin session?
If so please mail it to me and I will be very greatfull.
        
             ~   ~ 
            (o) (o)
 ---------oooo-O-oooo---------------     
| Robert 'Hoffa' Johansson          |
| Email: hoffa@medio.mh.se          | 
| URL: http://www.medio.mh.se/~hoffa|
 ----------oooo0-0oooo--------------



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

Date: 1 Mar 1997 02:16:30 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Can anyone help me please!
Message-Id: <5f83hu$or3@fridge-nf0.shore.net>

Robert Johansson (hoffa@medio.mh.se) wrote:

: I'm running a mud and I want a Tintin script to autoload and logon
: a Character to the mud. Since You can`t start Tintin outside a Xterm
: window in Unix I was suggseted to write a perl script that starts the
[snip]

Arggh.  Muds.

Simplifying the process of what you are trying to do would be painful
for a beginner AND the person writing the program, so I'll offer you 
the following advice:

(1) Read this newsgroup for the posting entitled "getting the most out
    of comp.lang.perl.misc." - this posting explains guidelines for using
    this group effectively.  I'm not trying to insult you when I tell
    you that your subject line is MEANINGLESS.  People who are looking
    for answers to the same question won't be able to query Usenet
    archives properly (by subject/keyword), because your subject is 
    non-descript, and people who provide follow-ups to your posting
    (with answers and suggestions) will surely get buried amongst the
    10,000 other postings with non-descript subject headers.

(2) If your university/provider has Perl 5 installed, check out 
    perlipc.pod, or have an experienced programmer explain sockets
    to you.  I believe you'll need sockets for this program, as
    you'll have to output a character to the mud program (which is
    running on port x of x.x.x.x server), and "do something" based
    on what is returned by the mud server.

(3) Learn to crawl before you can walk.  Sockets aren't the most
    difficult thing to learn, but a reasonable understanding of 
    Perl's syntax will make the implementation process easier.
    You might want to grab _Programming Perl_, second edition.

(4) Check out http://www.dejanews.com and query for perl sockets
    or comp.lang.perl.misc sockets.  This might do the trick.

--
Nathan V. Patwardhan
nvp@shore.net
"A stitch in time saves nine."


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

Date: Fri, 28 Feb 1997 17:00:17 -0800
From: Silvio Picano <spicano@ptdcs2.intel.com>
To: "James B. Crocker" <80crojam@menasha.com>
Subject: Re: GDBM,Perl HP 10.10
Message-Id: <33177FA1.41C6@ptdcs2.intel.com>

James B. Crocker wrote:
> 
> I've gotten gdbm-1.7.3 to compile and install without incident. I've gotten
> perl-5.003 to compile and install without incident on an HP 10.10 box. The
> configure says that
> ndbm, dbm etc are OK. However when it loads up the gdbm.h it complains:
> 
> <gdbm.h> found.
> gdbm_open() NOT found.
> We won't be including <gdbm.h>
> 
> Looking at the gdbm.h file it lists gdbm_open? What might be going on here?
> Anyone else come across this as an issue?
> --
> James B. Crocker
> I.S. Technical Services - Webmaster
> Menasha Corporation
> 80crojam@menasha.com




Looks very similar to my problem last weekend; you need to explcitly
tell make-maker where your include/libraries are installed; 

[1] When I tried to build my installation down a non-standard path, I
first tried this command:

  perl Makefile.PL \
      INSTALLPRIVLIB=/i/p/local/lib/perl5 \
      INSTALLARCHLIB=/i/p/local/lib/perl5/sun4m_413/5.003 \
      INSTALLSITELIB=/i/p/local/lib/perl5/site_perl \
     INSTALLSITEARCH=/i/p/local/lib/perl5/site_perl/sun4m_413 \
          INSTALLBIN=/i/p/local/bin \
      INSTALLMAN1DIR=/i/p/local/man/man1 \
      INSTALLMAN3DIR=/i/p/local/man/man3 \
                LIBS=-L/i/p/local/lib/gdbm/sun4m_413/lib \
                 INC=-I/i/p/local/include

  However, after I make'd, install'ed, and ran a test program
  I received a very similar error as you mention above.


[2] I edited the Makefile.PL and explicitly added my lib path
     to libgdbm in there:

  use ExtUtils::MakeMaker;
  WriteMakefile(
      NAME => 'GDBM_File',
      LIBS => ["-L/usr/local/lib -L/i/p/local/lib/gdbm/sun4m_413/lib
-lgdbm", "-ldbm"],
      MAN3PODS    => ' ',         # Pods will be built by installman.
      XSPROTOARG => '-noprototypes',              # XXX remove later?
      VERSION_FROM => 'GDBM_File.pm',
  );

I performed the "perl Makefile.PL ...", make'd, install'ed, and 
ran my test program correctly.


Good luck.
Silvio


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

Date: 1 Mar 1997 04:49:36 GMT
From: weibeld@clem.mscd.edu (David Weibel)
Subject: Getting vars after http://ww/page.cgi? <HERE>
Message-Id: <5f8ch0$6ta@clem.mscd.edu>

How do you get the variables using perl/cgi-lib.pl
after the standard URL like...
http://www.server.com/~acct/my.cgi?<The variables here?>

I'm sure this has to be pretty easy but I can't find any documentation
on it.  I know how to get them with c++.  So I would think I can with
perl.  Please let me know...

-David
 David@farm.co.us

PS.  Please send me a copy of the answer in case I miss it on USENET thanks.



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

Date: 1 Mar 1997 00:58:00 GMT
From: per@erix.ericsson.se (Per Hedeland)
Subject: Re: How to spam - legitimately
Message-Id: <5f7uuo$osn$1@news.du.etx.ericsson.se>

In article <pudge-ya02408000R2702971056090001@news.idt.net>
pudge@pobox.com (Chris Nandor) writes:
>Alright, here's a new one (name withheld, posted to comp.lang.perl.modules):
>
>#You can send me by email
>
>Now THAT would be an interesting trick ... ;-)

Missed RFC 1437?:-)

--Per Hedeland
per@erix.ericsson.se


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

Date: 28 Feb 1997 21:17:45 -0500
From: elf@ee.ryerson.ca (Luis Fernandes)
Subject: Re: How to spam - legitimately
Message-Id: <x067zcuzhy.fsf@gemini.ee.ryerson.ca>

>>>>> "merlyn" == Randal Schwartz <merlyn@stonehenge.com> writes:

    merlyn> So, there's no such word as "emails".

I prefer "femails".


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

Date: 1 Mar 1997 00:30:52 -0500
From: Roderick Schertler <roderick@argon.org>
To: rgarg@rgarg-sun.us.oracle.com (Raman Garg)
Subject: Re: Howto use open2()
Message-Id: <pzohd42na3.fsf@eeyore.ibcinc.com>

On 28 Feb 1997 00:28:01 GMT, rgarg@rgarg-sun.us.oracle.com (Raman Garg) said:
>
> I need to pass a host list to "rup" & get the output but "rup" starts
> executing & broadcasting on the network without waiting for the STDIN
> .( That's what "rup" does when run w/o arguments).

rup doesn't read anything off its stdin, it takes the hostnames from its
argument vector.  Read the man page.  You don't need to use open2.  Just
do

    open RUP, "rup @host_list|" or die "Can't fork: $!\n";
    while (<RUP>) {
	print "read $_";
    }
    close RUP;
    $? == 0 or die "Return status $? from rup\n";

(This assumes that @host_list has been vetted for valid hosts or at
least invalid input.  If a user is giving you the hosts they could use
this code to run arbitrary programs on your machine.)

-- 
Roderick Schertler
roderick@argon.org


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

Date: Fri, 28 Feb 1997 20:20:36 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: If you know perl this should be simple
Message-Id: <kp38f5.ef4.ln@localhost>

Bill Cowan (billc@tibinc.com) wrote:
: Geoffrey Hebert wrote:
: > 
: > Need help Received this message
: > Can't modify subroutine entry in scalar assignment at addlink7.cgi
: > line 398,
: > near "];"
: > 
: > line 398 is marked below
: > 
: > sub find_index_file {
: >     my($word) = @_;
: >     local $a_file= ' ';  ## tried this thought it might help
: > $first_char=substr($word,0,1);
: >    $first_char=lc($first_char);
: >    $a_dir=$first_char;
: >    if ($first_char lt 'a') {$a_dir='a';}
: >    if ($first_char gt 'u') {$a_dir='vwxyz';}
: >    $all_files = `ls $p_subject\/alpha\/$a_dir`;
: > print "all files $all_files \n";
: >    @all_files = split(/\s+/,$all_files);
: >    $num_files = @all_files;
: > print "num files is $num_files \n";
: >     if ($num_files==1) {
: >        $a_file=@all_files[0];     ## line 398  ### here is the line
:                 ^^^
: Didn't you mean:
: 	$a_file = $all_files[0]
: to get subscript zero of the array? I admit the error message is
: puzzling.  Did you run this with -w switch?  
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If he did then he ignored the warning it gave about that very line...


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: 1 Mar 1997 04:25:36 -0500
From: dlh@cc.gatech.edu (Doug Holton)
Subject: Re: If you know perl this should be simple
Message-Id: <5f8smg$e9r@pravda.cc.gatech.edu>

soccer@microserve.net (Geoffrey Hebert) writes:
>Can't modify subroutine entry in scalar assignment at addlink7.cgi
>line 398,

## comments below may be of help

>sub find_index_file {
>    my($word) = @_;
>    local $a_file= ' ';  ## tried this thought it might help

## since you return $a_file later, perhaps it shouldn't be local
## (perhaps you modify or match its value somewhere outside the
## subroutine, thus calling the error?

>$first_char=substr($word,0,1);
>   $first_char=lc($first_char);
>   $a_dir=$first_char;
>   if ($first_char lt 'a') {$a_dir='a';}
>   if ($first_char gt 'u') {$a_dir='vwxyz';}
>   $all_files = `ls $p_subject\/alpha\/$a_dir`;

## maybe use the readdir function instead (and you won't need
## the split routine below then too)

>print "all files $all_files \n";
>   @all_files = split(/\s+/,$all_files);
>   $num_files = @all_files;

## $num_files = $#all_files;

>print "num files is $num_files \n";
>    if ($num_files==1) {  
>       $a_file=@all_files[0];     ## line 398  ### here is the line 

## $a_file = $all_files[0];

>print "return a_dir $a_dir, a file $a_file  \n";
>      return $a_dir, $a_file;
>   }

>Please email answer also   heberts@microserve.net

>Thanks

-- 
Doug Holton		mailto:dlh@cc.gatech.edu
EduTech Institute	http://www.cc.gatech.edu/cogsci/edutech/
Georgia Tech		http://www.gatech.edu/
Atlanta, GA 30332-0280


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

Date: Fri, 28 Feb 1997 20:53:49 -0500
From: Michael Sadd <sadd@msc.cornell.edu>
To: deb@marinbridge.com
Subject: Re: Inline subroutines?
Message-Id: <33178C2D.3C76E8B7@msc.cornell.edu>

I'm not sure, but I think what Larry, Randall, et. al. 
mean when refering to inline functions are the little code
blocks that end up after grep's, sort's, etc.  For example,
here is a section from the perlfunc description of sort,
which they refer to as an inline function:

# this sorts the %age associative arrays by value
# instead of key using an inline function
@eldest = sort { $age{$b} <=> $age{$a} } keys %age;

I suppose it would be possible to put these code segments
into a scalar, then use eval to execute them.

I may be wrong...If so, I would also be interested in
the real answer!

	Mike


Debbie Whitten wrote:
> 
> On page 539 of the 2nd edition Camel book it talks about inlining
> subroutines for time efficiency. I can't find any information on how to
> do this in the rest of the book. Does anyone have any ideas?
> 
> Thanks,
> 
> Deb

-- 
| Michael Sadd                          | Cornell Univerisity        |
| Department of Physics and             | Ithaca, NY 14850           |
| Lab of Atomic and Solid State Physics | www.msc.cornell.edu/~sadd/ |


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

Date: Sat, 01 Mar 1997 02:58:51 -0500
From: Michael Sadd <sadd@msc.cornell.edu>
Subject: Re: Inline subroutines?
Message-Id: <3317E1BB.442FEEBB@msc.cornell.edu>

Michael Sadd wrote:
> 
> I'm not sure, but I think what Larry, Randall, et. al.

I'm also not sure why I think I am on a first name basis with
these gentlemen I've never met.  Pardon me, I should have been
more respectful.

	Mike


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

Date: Sat, 01 Mar 1997 01:23:02 GMT
From: inforch@cris.com
Subject: Interview With The Internet's Wise Guys Of Perl - Web Week
Message-Id: <331784f1.651896130@news.cris.com>

Interview With The Internet's Wise Guys Of Perl - Web Week 

Find this article at:

NewsLinx Daily Web News (2/28/97)

http://www.newslinx.com/


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

Date: 28 Feb 1997 22:05:52 -0500
From: dlh@cc.gatech.edu (Doug Holton)
Subject: Re: Need Perl index creator script!! Help!
Message-Id: <5f86eg$sp9@pravda.cc.gatech.edu>

njohnson@enterprise.net (Neil Johnson) writes:
>Could someone please tell me where I can download a perl script that
>can produce a directory index in HTML format.

There's probably a great deal of them, like the the Dir-It
script listed at the bottom of http://www.selah.net/cgi.html

>Also is there a Perl script that can allow users to upload files onto
>a server??

cgi-lib.pl 2.14:
http://www.bio.cam.ac.uk/cgi-lib/
CGI.pm or CGI_Lite:
ftp://uiarchive.cso.uiuc.edu/pub/lang/perl/CPAN/modules/by-module/CGI/
-- 
Doug Holton		mailto:dlh@cc.gatech.edu
EduTech Institute	http://www.cc.gatech.edu/cogsci/edutech/
Georgia Tech		http://www.gatech.edu/
Atlanta, GA 30332-0280


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

Date: Fri, 28 Feb 1997 23:53:36 -0600
From: Webmaster <NPHS@trader.com>
Subject: Newbie question: perl, OS/2, and #!
Message-Id: <3317C460.23F5@trader.com>

Thanks to a "proprietary hardware" stipulation in an Internet connection 
grant my school received, we now have an OS/2 server that I am 
attempting to run perl on.  I keep gettin Error 500 Internal CGI-BIN 
Error: execve() of c:/www/cgi-bin/test.cgi failed.  Error=37 messages 
when I try to run a test script.  I believe that my #!perl line is 
wrong, or that this doesn't work in OS/2 (like the similar problem in 
DOS), but I've made numerous attempts to fix it, ending in my going bald 
at the age of 17.  I've got the Perl 5.002 for OS/2 port by Raymond 
Chen, Kai Uwe Rommel, and Andreas Kaieser in my c:\www\bin directory.  
How should the #!perl line be set up (assuming that this works in OS/2)?  
Also, what should I write scripts in?  Can I use just a plain text 
editor (OS/2's system editor)?

Kyle Adams
Webmaster, New Palestine High School



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

Date: Fri, 28 Feb 1997 16:58:28 GMT
From: fdc@cliwe.ping.de (Frank D. Cringle)
Subject: Re: Perl as a shared library?
Message-Id: <vtene0uatn.fsf@cliwe.ping.de>

Brett McCormick <brett@speedy.speakeasy.org> writes:
>aml@world.std.com (Andrew M. Langmead) writes:
>
>> 
>> Marius Kjeldahl <marius@funcom.com> writes:
>> 
>> 5.003 is able to be built with libperl.a as a shared library. The
>> Configure script didn't ask if you wanted it though, so you had to
>> edit config.sh by hand.
>
>Does anyone know how this can be done?  I have many C programs linked
>with perl, and would like to decrease the disk usage..  (they're very,
>very, big)...

You need to set "useshrplib" when configuring perl.  Here is how I
install a new perl.  *NOTE*: Do not blindly copy this.  If you are not
on a sparc/10 running Solaris-2.x with gcc installed it won't work.
If you want to avoid going through the interactive question and answer
session, you must figure out the equivalent set of options for your
environment.

% sh Configure -des -D cc=gcc -D optimize='-O2 -msupersparc' \
  -D useshrplib -D lddlflags='-G -L/usr/local/lib -R/usr/local/lib' \
  -D ldflags='-L/usr/local/lib -R/usr/local/lib' 
% env LD_LIBRARY_PATH=$cwd make test
% env LD_LIBRARY_PATH=$cwd make install

-- 
Frank Cringle,      fdc@cliwe.ping.de
voice: (+49 2304) 467101; fax: 943357


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

Date: 1 Mar 1997 08:17:06 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Scoping problem using my() [kinda long]
Message-Id: <5f8om2$6aa@lyra.csx.cam.ac.uk>

Dave Thomas <Dave@Thomases.com> wrote:
>Or, altered to return 0 for incorrect values:
>
>   sub conv_fractional_inches($)
>   {
>     my ($whole, $fraction) = $_[0] =~ /^0*(\d*)(\d\d)$/;
>     $whole ||= 0;
>     $fraction ||= 0;
>     $result = $whole + $fraction/64; 
>   }

It would be politer to return a distinctive value, such as 'undef' on
error (and that 0* is redundant):

    sub conv_fractional_inches($)
    {
      return undef unless my ($whole, $fraction) = $_[0] =~ /^(\d*)(\d\d)$/;
      $result = $whole + $fraction/64;
    }


Mike Guy


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

Date: Sat, 01 Mar 1997 01:08:01 -0500
From: Ken Schrock <kens@cannet.com>
Subject: Simple tr///
Message-Id: <3317C7C1.10CC8912@cannet.com>

I am new to Linux but played with Perl under NT...
If I do MAN XXX > FILE I get stuff that looks like...

N\bNA\bAM\bME\bE
       ps - report process status

S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS

So I thought fine, I will use Perl tr/// 
To get this garbage out, 
But I appear to be holding my mouth wrong. <g>
Will someone please help me?

-- 
Ken Schrock
kens@cannet.com
Solutions Software


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

Date: 28 Feb 1997 16:59:14 -0800
From: blm@halcyon.com (Brian L. Matthews)
Subject: Re: Undefining a single element in a multidimensional array
Message-Id: <5f7v12$cfd$1@halcyon.com>

In article <33166EA6.1043D2EA@mail.idt.net>,
Chris Plachta  <stats9@mail.idt.net> wrote:
|undef($hash{KEY1});
|After doing this, KEY1 still shows up in keys(%hash).  I need to
|completely wipe out KEY1 from this data structure.

delete

Brian
-- 
Brian L. Matthews				Illustration Works, Inc.
	For top quality, stock commercial illustration, visit:
		  http://www.halcyon.com/artstock


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

Date: 01 Mar 1997 14:31:09 +0200
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: using \U and \L with edvEDV
Message-Id: <oeen2snbxpu.fsf@alpha.hut.fi>


> How do I set this locale information? I wold like "\ueke" translate to
> "Eke".

Requirement 0: you MUST have at least Perl 5.002. Before that, no way.
	       Well, without modifying the source code of Perl. But then
	       you might as well upgrade.

Requirement 1: your operating system correctly supports Swedish locales
	       and you have them installed.

Requirement 2: you have set one or more of the three environment variables
	       LC_ALL LC_CTYPE LANG to be something Swedish.

Requirement 3: if you are running the developer releases of Perl 5.004
	       you must 'use locale;' in the file/block you want the
	       above to happen.

Reqs 1 and 2 are very, umm, no, let me rephrase that, VERY system
dependent.  I do not know, nobody knows, where all this locale
information is stored in each and every system and what the Swedish
locales happen to be called.

For a lot longer discussion take a look at the
<URL:http://www.hut.fi/~jhi/perl5/perllocale.html>. It is for the
5.004 but from there you can find how to know whether the Requirement
2 is satisfied and how to pass the Requirement 3, this advice works
also in pre-5.004.

-- 
$jhi++;
# Jarkko Hietaniemi <URL:http://www.iki.fi/~jhi/> <URL:mailto:jhi@iki.fi>
# Lost interest?  It's so bad I've lost apathy.
# Not speaking for any past, present, or future employers.


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

Date: Thu, 27 Feb 1997 04:33:53 -0500
From: Ron Klimaszewski <microsys@IntNet.net>
Subject: Using color with the Curses module
Message-Id: <33155501.CFF@IntNet.net>

When I try to run 'init_pair' to set colors, the colors being a
variable, it does not work.  But when I write in the actual color, it
does.

Can anyone explain?

WORKS:  init_pair(1,COLOR_GREEN,COLOR_BLACK)
DOESN'T:  init_pair(1,$FG,$BG)

Please e-mail.  Thanks.

Ron Klimaszewski


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

Date: Fri, 28 Feb 1997 22:47:29 -0500 (EST)
From: sda@arentfox.com (Scott Anderson)
Subject: using perl modules
Message-Id: <199703010347.WAA00393@outland.arentfox.com>

I am having a problem using the Syslog module in one of my
programs. When I put the lines

use Sys::Syslog ();

openlog('abort.pl','cons pid','user');
syslog('info','this is a test');
closelog;

in my program and run it I get this error message.

Undefined subroutine &Sys::Syslog::hostname called at
/usr/lib/perl5/Sys/Syslog.pm line 92.
BEGIN failed--compilation aborted at ./abort.pl line 11.

It is erring on the 'use' line. I have never used modules before, what
am I doing wrong?

_______________________________________________________________________________
Sevareid's Law:
  The chief cause of problems is solutions.



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

Date: Sat, 01 Mar 1997 07:49:49 GMT
From: mwt@cyberg8t.com (Mark Thompson)
Subject: Validating data using //
Message-Id: <3317dc47.10600624@news.alt.net>

Hi,

I'm trying to write a password changing program and I need to do
validation of text that people enter.  Basically, I'm trying to limit
the user's input to letters and numbers with a minimum of 1 and a
maximum of 10 characters.

I tried doing it like this:

if($oldusername ne /[A-Za-z0-9]{1,10}/)
{
     $error += 1;
     $errormsg[$error] = "$oldusername is not a valid username";
}

                         and am not getting the desired results.

I will also be looking to validate passwords to so that it doesn't
contain any space type characters (space, /t, /n, etc).

I'm assuming that this is something simple (since I've been scouring
the Perl Manpages and have only found really complicated examples.
Anyone have any ideas?

Thanks,

Mark




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

Date: 8 Jan 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Jan 97)
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.  

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.

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 33
************************************

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