[7815] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1440 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 9 10:29:33 1997

Date: Tue, 9 Dec 97 07:00:42 -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           Tue, 9 Dec 1997     Volume: 8 Number: 1440

Today's topics:
     Re: Alphanumeric Ranges Using .. and ++ <hietanie@koah.research.nokia.com>
     Re: Alphanumeric Ranges Using .. and ++ (Bart Lateur)
     Re: Alphanumeric Ranges Using .. and ++ (Clay Irving)
     Re: Anyone done any utmp/wtmp stuff with Perl? <ghowland@hotlava.com>
     Re: can perl do multi-threaded programming? <ghowland@hotlava.com>
     Re: CGI.pm Usage Questions <Harald.Joerg@mch.sni.de>
     Deiconifying windows in Perl/Tk Win32 (or starting with (Paul Murray)
     Re: Deiconifying windows in Perl/Tk Win32 (or starting  (Jan Blom)
     Great Xmas-stuff (M.V.vanHoornAlkema)
     Help print to an open file... lineberry@cyberdude.com
     Re: Help print to an open file... <ckc@dmi.dk>
     Re: Help print to an open file... <emaneiro@bigfoot.com>
     Re: Help with text file searches on BSD Unix <wim.geurts@barco.com>
     how can I fork a process from the Web.. <h.syed@larc.nasa.gov>
     How to get keyword <bosch@goweb.lu>
     linux perl 5.004 locale problem? (Martin Brown)
     Re: linux perl 5.004 locale problem? (Honza Pazdziora)
     Listing files on your server as scalar values. lineberry@cyberdude.com
     Re: Listing files on your server as scalar values. <emaneiro@bigfoot.com>
     Re: Listing files on your server as scalar values. (Golubovskij I.N.)
     multipile comments lines . <edris@canaan.co.il>
     Re: Perl Plug-In for Netscape? (Clay Irving)
     perl stumper <jones-joe@usa.net>
     Problem with MIME::Lite and MIME-tools (rr)
     Re: Shared libraries on IRIX? (Honza Pazdziora)
     Re: Sorting huge array (Pontus Berglund)
     Which http-server ?? (Josef Gergetz)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 09 Dec 1997 12:21:11 +0200
From: Jarkko Hietaniemi <hietanie@koah.research.nokia.com>
Subject: Re: Alphanumeric Ranges Using .. and ++
Message-Id: <dpzpman7fs.fsf@koah.research.nokia.com>


Mark Stallard <mrs@cae091.ed.ray.com> writes:
> > Hmmm... You haven't yet given a full specification: What comes after
> > 1715A99999? It it 1715B00000 or 1715A100000? Or maybe 1715A9999A? :-)
> 
> 1715A99999, 1715B00000, 1715B00001 ...  The number of characters
> doesn't change in a given sequence.

What should happen after "ZZZ"?

-- 
Jarkko Hietaniemi


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

Date: Tue, 09 Dec 1997 11:56:26 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Alphanumeric Ranges Using .. and ++
Message-Id: <3491313c.13321344@news.tornado.be>

Mark Stallard <mrs@cae091.ed.ray.com> wrote:

>1715A99999, 1715B00000, 1715B00001 ...  The number of characters
>doesn't change in a given sequence.
 ...
>It sounds like I'd need to write the increment & decrement functions
>myself, and keep a record as to whether each char is alpha or numeric.
>I'm not sure how much all that WOULD help.  I'll keep it in mind,
>though.

I've taken a shot at it.

sub next {
	my($left, $c, $right) = unpack("a4a1a5",$_[0]);
	length(++$right)<6 or length(++$c)<2 or ++$left;
	return substr(sprintf("%04d",$left),-4) .
		substr($c,-1) . substr(sprintf("%05d",$right),-5);
}

print &next("1715Z99999");

> 1716A00000

Yup. That seems to work.
HTH,
Bart.


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

Date: 9 Dec 1997 09:43:06 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Alphanumeric Ranges Using .. and ++
Message-Id: <66jldq$jj5@panix.com>

In <dpzpman7fs.fsf@koah.research.nokia.com> Jarkko Hietaniemi <hietanie@koah.research.nokia.com> writes:

>Mark Stallard <mrs@cae091.ed.ray.com> writes:
>> > Hmmm... You haven't yet given a full specification: What comes after
>> > 1715A99999? It it 1715B00000 or 1715A100000? Or maybe 1715A9999A? :-)
>> 
>> 1715A99999, 1715B00000, 1715B00001 ...  The number of characters
>> doesn't change in a given sequence.

>What should happen after "ZZZ"?

You wake up? :)

-- 
Clay Irving <clay@panix.com>                  I think, therefore I am. I think? 
http://www.panix.com/~clay/


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

Date: Tue, 09 Dec 1997 10:48:38 +0100
From: Gary Howland <ghowland@hotlava.com>
To: Andrew Pollock <apollock@bit.net.au>
Subject: Re: Anyone done any utmp/wtmp stuff with Perl?
Message-Id: <348D13F6.1DA0@hotlava.com>

Andrew Pollock wrote:
> 
> I'm about to wade through CPAN, but I thought I'd ask here first...
> 
> I need a Perl script to make utmp/wtmp entries (it's a login replacement).
> I've run the h2ph script on all the relevant header files, but it still
> doesn't work:

I use the following to remove myself from utmp:


#!/usr/local/bin/perl -w
 
# open(FH, '+< /var/log/wtmp');
open(FH, '+< /var/run/utmp');
 
my $entry = '';
while (read(FH, $entry, 36))
{
        my ($line, $name, $host, $time);
        ($line, $name, $host, $time) = unpack("a8 a8 a16 L", $entry);
 
        $_ = $name;
        if (m/gary/)
        {
                seek(FH, -36, 1);
                print FH "\0"x36;
                seek(FH,0,1);
        }
}


Gary
-- 
pub  1024/C001D00D 1996/01/22  Gary Howland <gary@hotlava.com>
Key fingerprint =  0C FB 60 61 4D 3B 24 7D  1C 89 1D BE 1F EE 09 06


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

Date: Tue, 09 Dec 1997 11:09:18 +0100
From: Gary Howland <ghowland@hotlava.com>
Subject: Re: can perl do multi-threaded programming?
Message-Id: <348D18CE.1C82@hotlava.com>

Sriram Srinivasan wrote:
> 
> >
> > The select call does not solve the problem of being able to save and
> > restore your state, but threads do.  If I use select, then every time
> > I
> > want to do some I/O, I must save my state, return back to the select
> > loop,  read the next character (or whatever), and restore myself when
> > selected again!!!  Select() is a pathetic "solution".  (Unless of
> > course
> > we have a save-state/restore-state facility (coroutines), in which
> > case
> > select is a fine solution.
> 
> 
> Having programmed the last six months or so in java, I find myself
> missing select terribly. The JDK unfortunately doesn't have
> select, so one is forced to either allocate a thread to listen on
> every socket or poll every socket, both of which are fairly painful
> solutions.

I'm a bit puzzled as to why you find it painful allocating a thread for
every socket - surely dealing with an array of Threads isn't much
different to dealing with an array of file descriptors?  I suppose if
you're writing something like inetd, you may be a little uncomfortable
starting up a whole bunch of threads.  This may be especially true if
you've previously been used to using fork(), and are perhaps expecting
Threads to be relatively "expensive" - however, a program should be able
to run with hundreds, if not thousands, of threads without too much
trouble (I don't know what the Perl overhead per thread is going to be,
though).
 
Still, it's a shame java doesn't provide access to select() though. (But
I'd be happy if that were the worst of it's problems)

Gary
-- 
pub  1024/C001D00D 1996/01/22  Gary Howland <gary@hotlava.com>
Key fingerprint =  0C FB 60 61 4D 3B 24 7D  1C 89 1D BE 1F EE 09 06


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

Date: Tue, 09 Dec 1997 14:01:49 +0100
From: Harald Joerg <Harald.Joerg@mch.sni.de>
To: Stephan Vladimir Bugaj <bugaj@bell-labs.com>
Subject: Re: CGI.pm Usage Questions
Message-Id: <348D413D.2608@mch.sni.de>

Stephan Vladimir Bugaj wrote:
> 
> I've got a CGI program which should set a hidden variable called
> last_pass to  remind itself what stage it was in last call, like
> such:
> 
> print ...
>      $query->hidden(-name=>'last_pass',
> -default=>['load_config']),...
> 
> However, when I try to use this I get results for the previous stage
> (the login stage in this case) and the HTML that is output is this:
> 
>  <INPUT TYPE="hidden" NAME="last_pass" VALUE="login">
> 
> And if I submit the form I do get the result from processing a value
> of "login" for this variable.
> 
> What am I screwing up here?

You missed the section in the documentation of CGI.pm, which says:

    "General note 2.
     If you want to change the value of a field from its previous
     value, you have two choices:
     1. call the param() method to set it
     2. use the -override (alias -force) parameter. (This is a new
        feature in 2.15) This forces the default value to be used,
        regardless of the previous value of the field:
            print $query->textfield(-name=>'favorite_color',
                                    -default=>'red',
                                    -override=>1);
    "
--
Oook,
--haj--


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

Date: 9 Dec 1997 08:58:08 GMT
From: murray-paul@usa.net (Paul Murray)
Subject: Deiconifying windows in Perl/Tk Win32 (or starting without dos box)
Message-Id: <slrn68q20u.64p.murray-paul@unix1.netaxs.com>

I have been creating a little interface application in Perl/Tk.
Users being what they are, it has to be nice and pretty, and obviously
we can't have nasty DOS boxes popping up on our screens, now can we?

Now I can make the shortcut start minimised, and that hides the DOS
box, but also hides the application window. 

After much playing around I find that I can 'Popup' Toplevel windows,
but not the initial MainWindow, which does not appear to 'be' a
Toplevel (even though it's initial title is 'Toplevel', grr).

So my current workaround is to create a dummy MainWindow, create my
old mainwindow as a Toplevel of that, then 'withdraw' the MainWindow
and Popup the Toplevel.

This seems to work, but is rather icky, and might break other things.

So my questions are:

To .misc: Is there are way under Win32 to get rid of the DOS box that
pops up when a shortcut runs 'perl <script>'?

To .tk: Is there a way to Popup Mainwindows, and in general is there
any documentation on these proceedures? (Wm.pm has no docs, I can't
find anything in the Perl/Tk FAQ on window manager interaction, and
can't really understand enough of the Tk FAQ to apply it to perl
(ie. I have tried :))

Thanks in advance,
-Paul Murray



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

Date: Tue, 09 Dec 1997 10:00:24 GMT
From: janblom@infotech.nl (Jan Blom)
Subject: Re: Deiconifying windows in Perl/Tk Win32 (or starting without dos box)
Message-Id: <66j4sm$qrn$1@beta.infotech.nl>

In article <slrn68q20u.64p.murray-paul@unix1.netaxs.com>, murray-paul@usa.net (Paul Murray) wrote:
>I have been creating a little interface application in Perl/Tk.
>Users being what they are, it has to be nice and pretty, and obviously
>we can't have nasty DOS boxes popping up on our screens, now can we?
>
>Now I can make the shortcut start minimised, and that hides the DOS
>box, but also hides the application window. 
>
We use a workaround that is a bit more elaborate than this, but it does what 
you want and does not require any tricks in the application:
call the perl interpretor + script from a separate .bat file (yes, sorry...) 
and create a shortcut to that .bat file. make that shortcut start minimised. 
Your dos box will appear minimised, but the perl application will appear as 
you want it.

regards


----
Jan Blom  --  ADP Infotech, the Netherlands --  janblom@infotech.nl


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

Date: Tue, 09 Dec 1997 10:59:11 GMT
From: M.V.vanHoornAlkema@KUB.NL (M.V.vanHoornAlkema)
Subject: Great Xmas-stuff
Message-Id: <66j89v$qc0$2@mailnews.kub.nl>

watch :
http://stuwww.kub.nl/~s657352/

and add your Xmas wishes


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

Date: Tue, 09 Dec 1997 02:41:29 -0600
From: lineberry@cyberdude.com
Subject: Help print to an open file...
Message-Id: <881656182.29821@dejanews.com>

Hello,

	I've been trying to figure out how to print to a file. I'm new to
perl programming and I find it really easy to create scripts, but I have
not been able to print to a file when I use the "while" command. I
accidently posted a this very problem to comp.lang.perl and I did get
some e-mail responses but I am still encountering the same problem.


Here's what I want to do. I have a file named str.txt that contains about
73 lines with a domain name followed by 3 usernames. Same three users in
same order.

----str.txt----
kingkong.com	jerryl freddy tommy
goofball.com	jerryl freddy tommy
jibberish jibberish jibberish jibberish jibberish
(...)
pooh.com	jerryl freddy tommy
----str.txt----

If I run the following script, it prints to my terminal the desired
results:

----terminal print----
#!/usr/bin/perl -w

{
open(FN, "str.txt");
while (<FN>) {
	/jerryl/;
	print $`."\n";
	}
close(FN);
}
----terminal print----

The results look something like:

kingkong.com
goofball.com
[...]
pooh.com

The script removes all usernames since all lines with users contain
"jerryl". It also removes lines that have jibberish because "jerryl" is
not on those lines. This is my desired results, which I want to write to a
file called "result".

If I try to open a file and print to it like this:

{
open(FN, "str.txt");
while (<FN>) {
	/jerryl/;
	$all = $`."\n";
	}
open(FN, ">result");
print FN $all;
close(FN);
}

I only get the very first domain name in the "result" file.
----result----
kingkong.com
----result----

The weird part is if I run the following I get the last domain name only:

{
open(FN, "str.txt");
while (<FN>) {
	/jerryl/;
	$all = $`."\n";
# If I open below as <FN> perl takes a very long time to run this script!
# Why do I get the correct response if I comment the open command?
# When I print to "result" I get only the very last domainname.
open(STDOUT, ">result");
print $all;
	}
close(FN);
}

If you can explain how I should go about getting the desired results, I'd
really appreciate it. I believe that I am getting a grasp on writing these
scrpts. I am just stuck on printing to an open file.

Thanks for any help.
-Jerry
---
Jerry Lineberry
San Antonio, Texas
(210) 746-1787

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: 09 Dec 1997 10:06:06 +0100
From: Casper Kvan Clausen <ckc@dmi.dk>
Subject: Re: Help print to an open file...
Message-Id: <wvpwwheq41t.fsf@hobbes.ejoper.dmi.min.dk>

lineberry@cyberdude.com writes:

> If I try to open a file and print to it like this:
> 
> {
> open(FN, "str.txt");
> while (<FN>) {
> 	/jerryl/;
> 	$all = $`."\n";
> 	}
> open(FN, ">result");
> print FN $all;
> close(FN);
> }

So, you read a bunch of lines with a while() and print ONE line? No
wonder you're not getting what you want.

Move the print line into the while loop, and give the output file a
different handle from the input file.

Kvan.

-- 
-------Casper Kvan Clausen------ | 'Ah, Warmark, everything that passes
----------<ckc@dmi.dk>---------- |  unattempted is impossible.'
           Lokal  544            |   
I do not speak for DMI, just me. |        - Lord Mhoram, Son of Variol.      


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

Date: Tue, 09 Dec 1997 10:55:58 +0100
From: Emilio Maneiro =?iso-8859-1?Q?M=E1rquez?= <emaneiro@bigfoot.com>
Subject: Re: Help print to an open file...
Message-Id: <348D15AE.3C4B@bigfoot.com>

lineberry@cyberdude.com wrote:
> Here's what I want to do. I have a file named str.txt that contains abo=
ut
> 73 lines with a domain name followed by 3 usernames. Same three users i=
n
> same order.
> =

> ----str.txt----
> kingkong.com    jerryl freddy tommy
> goofball.com    jerryl freddy tommy
> jibberish jibberish jibberish jibberish jibberish
> (...)
> pooh.com        jerryl freddy tommy
> ----str.txt----
> =

> If I run the following script, it prints to my terminal the desired
> results:
> =

> ----terminal print----
> #!/usr/bin/perl -w
> =

> {
> open(FN, "str.txt");
> while (<FN>) {
>         /jerryl/;
>         print $`."\n";
>         }
> close(FN);
> }
> ----terminal print----
> =

> The results look something like:
> =

> kingkong.com
> goofball.com
> [...]
> pooh.com
> =

> The script removes all usernames since all lines with users contain
> "jerryl". It also removes lines that have jibberish because "jerryl" is=

> not on those lines. This is my desired results, which I want to write t=
o a
> file called "result".
> =

> If I try to open a file and print to it like this:
> =

> {
> open(FN, "str.txt");
> while (<FN>) {
>         /jerryl/;
>         $all =3D $`."\n";
>         }
> open(FN, ">result");
> print FN $all;
> close(FN);
> }
> =

> I only get the very first domain name in the "result" file.
> ----result----
> kingkong.com
> ----result----
> =


I think the following should work...

 {
 open(FN, "str.txt");
 open(OUT, ">str.txt.new");
 while (<FN>) {
         /jerryl/;
         print OUT $_ ."\n";
         }
 open(FN, ">result");
 close(FN);
 close (OUT);
 }


> The weird part is if I run the following I get the last domain name onl=
y:
> =

> {
> open(FN, "str.txt");
> while (<FN>) {
>         /jerryl/;
>         $all =3D $`."\n";
> # If I open below as <FN> perl takes a very long time to run this scrip=
t!
> # Why do I get the correct response if I comment the open command?
> # When I print to "result" I get only the very last domainname.
> open(STDOUT, ">result");

This opens the file every time the script goes thru the while loop

> print $all;
>         }
> close(FN);
> }
> =

> If you can explain how I should go about getting the desired results, I=
'd
> really appreciate it. I believe that I am getting a grasp on writing th=
ese
> scrpts. I am just stuck on printing to an open file.
> =

> Thanks for any help.
> -Jerry

Greetings :-)
-- =

----------------------------
Emilio Maneiro M=E1rquez
e-mail: emaneiro@bigfoot.com
Huelva, Espa=F1a.


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

Date: Tue, 09 Dec 1997 12:57:38 +0000
From: Wim Geurts <wim.geurts@barco.com>
To: Paul Heindselman <webmaster@radcliffe-waye.com>
Subject: Re: Help with text file searches on BSD Unix
Message-Id: <348D4042.41C6@barco.com>

Paul Heindselman wrote:
> 
> Hello,
> 
> I am trying to write a perl scrip to do a search on a text file and if
> it finds the string it goes to a JavaScript script (external .js file)
> If it doesn't find the string I want it to write the string to the
> file, then go to the JavaScript script. So far I've gotten the script
> to write to the file, I'm using glimpse to search the file, but can't
> figure out how to set up the if-else statement. Below is what I have
> so far:
> -------------------------------------------------------------------------------------
> #!/usr/bin/perl -w
> 
> #print "Content-type:text/html\n\n";
> 
> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
>      @pairs = split(/&/, $buffer);
> 
>      foreach $pair (@pairs)
>      {
>          ($name, $value) = split(/=/, $pair);
>          $value =~ tr/+/ /;
>          $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
>          $value =~ s/~!/ ~!/g;
>          $FORM{$name} = $value;
>      }
It seems like you're trying to parse the input of a html form;
cgi-lib.pl can do that for you...

The routine in cgi-lib.pl goes as follows:

sub ReadParse {
  local (*in) = @_ if @_;
  local ($i, $key, $val);

  # Read in text
  if (&MethGet) {
    $in = $ENV{'QUERY_STRING'};
  } elsif ($ENV{'REQUEST_METHOD'} eq "POST") {
    read(STDIN,$in,$ENV{'CONTENT_LENGTH'});
  }

  @in = split(/&/,$in);

  foreach $i (0 .. $#in) {
    # Convert plus's to spaces
    $in[$i] =~ s/\+/ /g;

    # Split into key and value.  
    ($key, $val) = split(/=/,$in[$i],2); # splits on the first =.

    # Convert %XX from hex numbers to alphanumeric
    $key =~ s/%(..)/pack("c",hex($1))/ge;
    $val =~ s/%(..)/pack("c",hex($1))/ge;

    # Associate key and value
    $in{$key} .= "\0" if (defined($in{$key})); # \0 is the multiple
separator
    $in{$key} .= $val;

  }

  return length($in); 
}


A different approach; and it works...


Wim


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

Date: Tue, 09 Dec 1997 09:18:29 -0500
From: Hazari Syed <h.syed@larc.nasa.gov>
Subject: how can I fork a process from the Web..
Message-Id: <348D5335.C589EAF4@larc.nasa.gov>


--------------F5849E8A14FCE8086B1613A8
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi:
  I have written a perl cgi script that runs on the web.. I need to fork
off a
process in the background when the user clicks a button.. The user then
can do
whatever he wants.. The process that is running in the background will
eventually
complete successfully.  The cgi script does not need the status of this
completed
process. Can this be done..

Hazari

--
**********************************************************************
 Hazari I Syed                                   h.syed@larc.nasa.gov
**********************************************************************



--------------F5849E8A14FCE8086B1613A8
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<HTML>
Hi:
<BR>&nbsp; I have written a perl cgi script that runs on the web.. I need
to fork off a
<BR>process in the background when the user clicks a button.. The user
then can do
<BR>whatever he wants.. The process that is running in the background will
eventually
<BR>complete successfully.&nbsp; The cgi script does not need the status
of this completed
<BR>process. Can this be done..

<P>Hazari
<PRE>--&nbsp;
**********************************************************************
&nbsp;Hazari I Syed&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; h.syed@larc.nasa.gov
**********************************************************************</PRE>
&nbsp;</HTML>

--------------F5849E8A14FCE8086B1613A8--



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

Date: Mon, 08 Dec 1997 22:39:34 +0100
From: Bosch Patrick <bosch@goweb.lu>
Subject: How to get keyword
Message-Id: <348C690F.521BD692@goweb.lu>

This is a multi-part message in MIME format.
--------------424D8D38E4843F1974169EFF
Content-Type: text/plain; charset=us-ascii; x-mac-type="54455854"; x-mac-creator="4D4F5353"
Content-Transfer-Encoding: 7bit

Hello everybody!

I have a web server and I want that the users of this server can get a keyword.
I have already a lot of perl cgi programs running on this server. The server
should call one of these programms and this programm should get  the keyword
from a daemon. On startup the daemon should ask for the keyword and identify the
caller of daemon by uid and pid. The problem is that I don't if this is possible
and how to realize it.

Could anyone please help me?

Patrick B.
--
Patrick Bosch
+++++++++++++++++++++++++++++++
  GoWeb sarl
  Internet Project Management
+++++++++++++++++++++++++++++++
Tel.: +352/33 28 01
E-mail: bosch@goweb.lu

14, rue General Patton
L - 7270 Walferdange
Luxembourg
 

--------------424D8D38E4843F1974169EFF
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Patrick Bosch
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Patrick Bosch
n:              Bosch;Patrick
org:            GoWeb Sarl
adr:            ;;14, rue Giniral Patton;Walferdange;Luxembourg;7270;
email;internet: bosch@goweb.lu
title:          Manager
tel;work:       +352/33 28 01
tel;fax:        +352/33 28 01
tel;home:       +352/021/183 814 (cellular)
x-mozilla-cpt:  ;0
x-mozilla-html: TRUE
end:            vcard


--------------424D8D38E4843F1974169EFF--




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

Date: 9 Dec 1997 00:47:00 -0700
From: mjbjr@primenet.com (Martin Brown)
Subject: linux perl 5.004 locale problem?
Message-Id: <66it1k$iqt@nntp02.primenet.com>

I recently upgraded the perl on my Linux system to version 5.004_03 using
a rpm (Red Hat Package Manager)for the upgrade.  This upgrade was supplied
by the maker of my current Linux distribution. 

As you can see things are not totally correct:

[mjbjr@beau mjbjr]$ perl -v
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LC_ALL = (unset),
        LANG = "us"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

This is perl, version 5.004_03

Copyright 1987-1997, Larry Wall

Perl may be copied only under the terms of either the Artistic License or
the GNU General Public License, which may be found in the Perl 5.0 source
kit. 

-----

I sent the above info to the maker of the perl rpm, who replied that they
had been able to recreate the "problem"...: 

"Here's the official word from our engineering department:

"The behavior exhibited above is correct.  Perl will only recognize "C" as
a valid LANG envar setting.  If you have anything other than "C" in the
LANG envar, perl will set the local to "C" automatically. 

"So, the error message above is actually just perl saying that it's
working correctly.  No need for concern." 

-----

Indeed, I do have LANG set to "us".  I don't know what software sets this
var, but I think that since I'm in the U.S. and speak English that this is
probably a correct setting for my current system and most likely the
settings for my previous versions of my system. 

Why would anyone have the LANG var set to 'C'?

I didn't have this problem with previous versions of perl.

As you can probably tell, I'm not completely satisfied with the answer I
have been given.  What is your take on the matter? 

Thanx for any light you may shed.

--
                            - Martin J. Brown, Jr. -  

                               mjbjr@primenet.com
                      PGP public key available via finger


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

Date: Tue, 9 Dec 1997 10:48:07 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: linux perl 5.004 locale problem?
Message-Id: <adelton.881664487@aisa.fi.muni.cz>

mjbjr@primenet.com (Martin Brown) writes:

[...]

> Indeed, I do have LANG set to "us".  I don't know what software sets this
> var, but I think that since I'm in the U.S. and speak English that this is
> probably a correct setting for my current system and most likely the
> settings for my previous versions of my system. 

You should really check why you have your LANG set this way. The Perl
error message says (and correctly) that the locale you request (us)
is not installed correctly. The files in /usr/share/locale or so are
missing.

You should really check the perllocale man page and run locale -a or
what it suggests.

> Why would anyone have the LANG var set to 'C'?

Because (like you) doesn't have another locale installed correctly.

> I didn't have this problem with previous versions of perl.

No, because previous version of perl did not obey the locales.

Hope this helps,

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: Tue, 09 Dec 1997 02:51:25 -0600
From: lineberry@cyberdude.com
Subject: Listing files on your server as scalar values.
Message-Id: <881656967.30439@dejanews.com>

Hi,  I want to set each file I have on my remote server as a scalar
value. I wrote the following script that will list all the files in my
directory (unix system) but the information is in a file not a scalar
variable.

Here's what I got so far:

#!/usr/bin/perl

$foo = `ls -l`;
open(AUTOLIST, ">dir");
print AUTOLIST $foo;
close(AUTOLIST);

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Tue, 09 Dec 1997 11:10:52 +0100
From: Emilio Maneiro =?iso-8859-1?Q?M=E1rquez?= <emaneiro@bigfoot.com>
Subject: Re: Listing files on your server as scalar values.
Message-Id: <348D192C.4CB7@bigfoot.com>

> =

> #!/usr/bin/perl
> =

> $foo =3D `ls -l`;
> open(AUTOLIST, ">dir");
> print AUTOLIST $foo;
> close(AUTOLIST);

If you want to write to every file you could have an array in spite of a
scalar

@foo =3D `ls`;

and this wil give you an array with the names of every file on the
directory. You could do:

my $file;
foreach $file ( @foo ) {
	open (OUT, ">$file");
	print OUT 1; # Print a constant to the file.
	close OUT;
}

I have not tried this solution, so be careful.

Greetings :-)
-- =

----------------------------
Emilio Maneiro
e-mail: emaneiro@bigfoot.com
Huelva, Espa=F1a.


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

Date: 9 Dec 1997 11:40:12 GMT
From: igor@kpbank.ru (Golubovskij I.N.)
Subject: Re: Listing files on your server as scalar values.
Message-Id: <slrn468qbi2.1nr.igor@swserv1.hq.kem>

In article <881656967.30439@dejanews.com>, lineberry@cyberdude.com wrote:
>Hi,  I want to set each file I have on my remote server as a scalar
>value. I wrote the following script that will list all the files in my
>directory (unix system) but the information is in a file not a scalar
>variable.
>
>Here's what I got so far:
>
>#!/usr/bin/perl
>
>$foo = `ls -l`;
>open(AUTOLIST, ">dir");
>print AUTOLIST split ('\n', $foo);
	        ^^^^^^^^^^^^^^^^^^
>close(AUTOLIST);
>
>-------------------==== Posted via Deja News ====-----------------------
>      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Tue, 09 Dec 1997 23:32:21 +0200
From: Edris Abzakh <edris@canaan.co.il>
Subject: multipile comments lines .
Message-Id: <66j40n$4ma$1@news.NetVision.net.il>

Hello ..

I was wondering if there is any way to turn a few lines of perl to 
comments and that without using the '#' char before every line ?
something like /* bla bla .. 
                   bla bla
               */ in C .

thanks for your support,

Edris Abzakh

Software Engineer


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

Date: 9 Dec 1997 09:39:30 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Perl Plug-In for Netscape?
Message-Id: <66jl72$j70@panix.com>

In <66i93d$41r$1@newbabylon.rs.itd.umich.edu> Alex Tang <altitude@ren.us.itd.umich.edu> writes:
>Peter Prymmer <pvhp@forte.com> wrote:
>: Eric Hilding wrote:


>: > Eric Hilding wrote:
>: > ***UPDATED***
>: > >
>: > > Tad McClellan (tadmc@metronet.com) wrote:
>: > > : Eric Hilding (eric@hilding.com) wrote:
>: > > : : I've looked around but just can't seem to find the
>: > > : : info on an alleged Perl 'Plug-In' for Netscape.  Any
>: > > : : references would be appreciated.  Tnx.
>: > >
>: > > : Where did you hear the allegations?
>: > >
>: > > It was on a Tcl related website somewhere...can't remember where,
>: > > but sent an inquiry to an e-mail link on the page in the wee hours
>: > > of the morning.  After several days, still no response so I posted.
>: > 12/2/97 ***FOUND IT AGAIN*** ...

>: > OK... "where are the 'perl plug-ins' hiding "on the web"???????????????

>: Stan Melax wrote one for perl but it was for a much older (> 1 year ago)
>: verision of Netscape.  Stan is in Canada.

>I'm not sure if this is what you're talking about, but try
>http://interact.canoe.ca/~bsugars/nsapi_perl.htm

I get this:

  Not Found

  The requested object does not exist on this server. The link you 
  followed is either outdated, inaccurate, or the server has been 
  instructed not to let you have it. 

-- 
Clay Irving <clay@panix.com>                  I think, therefore I am. I think? 
http://www.panix.com/~clay/


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

Date: Tue, 09 Dec 1997 04:58:41 -0700
From: JJ <jones-joe@usa.net>
Subject: perl stumper
Message-Id: <348D3271.34AC@usa.net>

Trying to learn perl for cgi and more!

1. What is the best way to learn perl in windows, but to use these
scripts for cgi purposes?
2. Do I have to load them on server every time to make them work?
3. I've installed perl, on my computer but to make the scripts run I
have to keep them in the same directory? (I've already done everything
to my path statement but it dos'nt help)


please if you can Help
Thank you
JJ


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

Date: Tue, 09 Dec 1997 13:43:20 GMT
From: rr@RR.R (rr)
Subject: Problem with MIME::Lite and MIME-tools
Message-Id: <348d46cc.27491410@news.unisource.ch>

Hi All

I tryed to use the MIME::Lite and MIME-tools modules on a NT 4.0 Perl
for  Win32 5.001 Build 110

my script:
--------------------------------------------------------------------------------
    use MIME::Lite;

$message = "message";
$mailprog = 'postmail.exe';
$sourcedir = "u:/web/cgi_data";
    $msg = new MIME::Lite
                From    =>'me@myhost.com',
                To      =>'josef.ender@softronic.ch',
                Cc      =>'josef.ender@softronic.ch',
                Subject =>'A message with 2 parts...',
                Type    =>'multipart/mixed';

    attach $msg 
                Type     =>'TEXT',   
                Data     =>"Here's the GIF file you wanted";

    attach $msg 
                Type     =>'image/gif',
                Path     =>'$sourcedir/gugi.gif',
                Filename =>'gugi.gif';
    $msg->print(\*$mailprog);
---------------------------------------------------------------------------

I have allways the same errors:

Global symbol "VERSION" requires explicit package name at
D:\perl5\lib/MIME/Lite
 .pm line 155.
Global symbol "QUIET" requires explicit package name at
D:\perl5\lib/MIME/Lite.p
m line 158.
Global symbol "VERSION" requires explicit package name at
D:\perl5\lib/MIME/Lite
 .pm line 756.
Global symbol "QUIET" requires explicit package name at
D:\perl5\lib/MIME/Lite.p
m line 797.
Global symbol "QUIET" requires explicit package name at
D:\perl5\lib/MIME/Lite.p
m line 1560.
Global symbol "QUIET" requires explicit package name at
D:\perl5\lib/MIME/Lite.pm line 1561.
 at mailtest2.pl line 2.
BEGIN failed--compilation aborted at mailtest2.pl line 2.

Any response would be greatly appreciated!
Thanks!

Josi



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

Date: Tue, 9 Dec 1997 09:51:25 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Shared libraries on IRIX?
Message-Id: <adelton.881661085@aisa.fi.muni.cz>

Alex Tang <altitude@ren.us.itd.umich.edu> writes:

[...]

> Can't load '/local/lib/perl5/site_perl/IP32-irix/auto/Ldapc/Ldapc.so' for
> module Ldapc:  9986:/usr/bin/perl: rld: Fatal Error: cannot successfully
> map soname 'libldap10.so' under any of the filenames
> /usr/lib32/libldap10.so:/lib32/libldap10.so:/usr/libn32/libldap10.so:/libn32/libldap10.so:  at /local/lib/perl5/IP32-irix/5.00404/DynaLoader.pm line 166.
>  at /local/lib/perl5/site_perl/Ldapp.pm line 207
> BEGIN failed--compilation aborted at ./test.pl line 2.
> 
> 
> But the shared library is located in /usr/lib32 (which is in the path that 
> was searched.
> 
> gromit% ls -al /usr/lib32/libldap10.so
> -rwxr-xr-x    1 root     sys       375804 Dec  8 17:40 /usr/lib32/libldap10.so*

I would guess that the /usr/lib32/libldap10.so is corrupt. Is it
loadable from other programs (I mean, do other programs work with it)?
You should ask your root to check that.

Hope this helps,

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: Tue, 09 Dec 1997 14:34:49 GMT
From: Pontus.Berglund@se.adsanker.com (Pontus Berglund)
Subject: Re: Sorting huge array
Message-Id: <349056ea.345660815@Falun70>

On Tue, 9 Dec 1997 05:22:49 GMT, aml@world.std.com (Andrew M.
Langmead) wrote:

[...]
>
>Also, since you only want the top ten files, you might be better of
>going through the list and comparing each element with a separate list
>of "top ten candidates". When the current element is larger any of the
>elements in your new list, knock off the smallest item and insert the
>new item. Then the sorting doesn't have to decide if file 11 is
>greater or less then file 12.

This is way faster than sorting the hash! I keep the list sorted, and
check if the current element is larger than the last element in the
list. Apparently this is faster than iterating the list to check for
the smallest element.

Thanks to you and Mike Guy for your help!

This has brought up another problem though. The list is really a list
of lists, which I have to initialize like this:

@arr = ( [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0,
0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]);

Is there a more flexible way to do this? I've tried playing around
with the x operator, but I haven't got it to work.

Sincerely,

    [Pontus]

--
Name: Pontus Berglund
Homepage: http://come.to/pontus
ICQ UIN: 619869
E-Mail (Home): pontus.berglund@swipnet.se 
E-Mail (Work): pontus@se.adsanker.com
PGP 5.0 key: http://come.to/pontus/Crypto/crypto.html
PGP key fingerprint: CDFE C72A C450 2D41  3FEC C8C7 CF93 E090


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

Date: Tue, 09 Dec 1997 09:29:51 GMT
From: *NO.SPAM*.josef.gergetz@*NO.SPAM*.siemens.at (Josef Gergetz)
Subject: Which http-server ??
Message-Id: <348d0ca1.6435553@news>

Hi,

I am new to Perl, and want to test my pages on my computer (Win95) at
home.
I will use Server Side Includes. Can anybody tell me, which Server I
should use ? The personal Web-Server delivered with FrontPage does not
support Perl & SSI I think (if yes - how?).
The server should be free/shareware and run under Win95  ;-(.

TIA
Josef
(e-mail replies: remove the " *NO.SPAM*."




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

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

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

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