[7226] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 851 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 12 09:17:51 1997

Date: Tue, 12 Aug 97 06:00:52 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 12 Aug 1997     Volume: 8 Number: 851

Today's topics:
     %ENV on PerlIS ? <pegit.swedmap@mbox300.swipnet.se>
     Re: adressing arrays <petri.backstrom@icl.fi>
     Re: Best way to connect to PostgreSQL 6.1.1 (robert)
     Re: Bidirectional Communication, Comm.pl (J%org Knappen)
     Can't match '3\\\3' (meta-characters) <Benarson.Behajaina@swh.sk>
     Re: changing perl to gibberish <pc1@scigen.co.uk>
     complex argument passing <dhoover@textwise.com>
     Re: Converting cgi submission to variable names? (Paul Buder)
     foreach problem (Sami Sandqvist)
     Frustration and -T (Tina Marie Holmboe)
     Hashes in Perl 5.004_01 <ecki@intershop.de>
     How to open a file to a variable instead of an array? bz7347275@ntu.edu.sg
     Re: How to open a file to a variable instead of an arra (Andrew M. Langmead)
     Re: How to open a file to a variable instead of an arra (Jeremy D. Zawodny)
     Re: How to treat "\n" as "\n" ? <lerdsuwa@scf.usc.edu>
     Re: How-to cut the last characters of a varibles (Mats Larsson)
     Re: Is it possible to use HTPASSWD within Perl? (J%org Knappen)
     Re: Is there a perl IDE? <neeri@iis.ee.ethz.ch>
     Re: MAX OPEN FILES under SunOS/Solaris? (Paul Buder)
     Re: Newbie - Perl for Win <petri.backstrom@icl.fi>
     NEWBIE help with sybperl <perkva@itk.ntnu.no>
     Re: Passing Parameter in Perl (Tina Marie Holmboe)
     Password Protection on a directory <gregmee@vianet.net.au>
     Re: Password Protection on a directory (Jeremy D. Zawodny)
     perl and libaries denis@mathi.uni-heidelberg.de
     Perlshop Setup <castillj@concentric.net>
     Re: Problem With Join() <perrella@ehsn23.cen.uiuc.edu>
     Re: Server Push in Perl??? (M.J.T. Guy)
     Trouble using an Array (ken)
     Re: Trouble using an Array (Tad McClellan)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Tue, 12 Aug 1997 09:13:44 +0200
From: Pinne <pegit.swedmap@mbox300.swipnet.se>
Subject: %ENV on PerlIS ?
Message-Id: <33F00D27.4410@mbox300.swipnet.se>

Hi,

Anyone else who runs PerlIS on NT S.
I run PerlIS (5.003 build 306) from Aciveware on
NT S 4.0 w IIS 3.0.
It seems like there are no usable entries in the
ENV-array.
It's just one, containing some version stuff.
I had difficulties installing Perl.exe for IIS 3.0,
couldn't make it work. PerlIS worked though, so I
thought since that one's a ddl I should be able to
get away with less overhead and used it instead.
But I don't know if I can use it without the ENV-
information.
Any help, suggestions etc are very welcome.
Thanks in advance.
/regards


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

Date: Tue, 12 Aug 1997 09:25:15 +0300
From: Petri Backstrom <petri.backstrom@icl.fi>
Subject: Re: adressing arrays
Message-Id: <33F001CB.298B@icl.fi>

denis@mathi.uni-heidelberg.de wrote:
> 
> i tried to adress the elementes of adresse.
> adressing them with $xxx[13] for example works, but if i use a variable
> it doesnot work any more...
> does anyone knom the answer?

I'm afraid your question is not very clear on what you are
attempting to accomplish.

What do you mean by "use a variable"? How do you want to 
"use a variable"? 

Also "doesnot work any more" isn't the most descriptive 
outline of your proble; please provide an example of the 
data you're trying to access, how you've stored it, and 
what you expect to get as a result.

Do also post an example of what you've tried, and what the 
results were (including any and all error messages).

And do run your Perl script with the -w command line
switch, and at least "use strict;" as the first line
of code. See the perldiag manual page for explanations
of any and all error messages, and act accordingly.

regards,
 ...petri.backstrom@icl.fi
    ICL Data Oy
    Finland


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

Date: 12 Aug 1997 10:55:59 +0200
From: robert@ICK.il.fontys.nl (robert)
Subject: Re: Best way to connect to PostgreSQL 6.1.1
Message-Id: <5sp8ev$91@bsd1.hqehv-internal.ilse.net>

Andrzej =?US-ASCII?Q?Bagi=F1ski?= <abagi@coral.idk.com.pl>:
 >What is the best way to work with PostgreSQL database using Perl?

Use the Pg module which comes with the PostgreSQL distribution :)

                                                                    robert


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

Date: 12 Aug 1997 09:22:18 GMT
From: knappen@iphcip1.Physik.Uni-Mainz.DE (J%org Knappen)
Subject: Re: Bidirectional Communication, Comm.pl
Message-Id: <5spa0a$i2b$1@esmeralda.zdv.Uni-Mainz.DE>

Eric Arnold schrieb:

> I just uploaded version 1.7 to CPAN (misc. minor changes for platform
> support, mostly).  However, you didn't include the details of your
> problem, such as what platform/environment you are using, what you
> tried, and how exactly it failed.

I will give some more details, allthough the problem was circumvented in this
case by avoiding directional piping at all. The platform is a sun under
SunOS 5.5.1.

A colleague of mine has written a function doing afs authorization, which is
called as follows:

afsauth.sun \n
login:password

The function than exits and writes the number of days on which the afspassword is
valid to STDOUT and if there is an error an explicit error message to STDERR.
In the original version, the function did not set differentiated exit status.
Note that the function must be called in this way, since the password must not be
visible via the ps command.

The context is a cgi script.

The work-around in our case was to communicate the interesting information also
in the exit status, such that I can use close and $? to fetch it.

The example of page 345 of the blue camel is deficient and does not work. It
misses Comm'init(); -- this was easy to find out -- but even after that I wasn't
able to read the value from afsauth.sun into a variable by using
$x=scalar <FILEHANDLE>;
as suggested in the book.

Yours, J"org Knappen 


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

Date: Tue, 12 Aug 1997 11:29:39 +0200
From: Benarson Behajaina <Benarson.Behajaina@swh.sk>
Subject: Can't match '3\\\3' (meta-characters)
Message-Id: <33F02D03.D920E787@swh.sk>

Is it possible to match a string wich includes meta-characters ?

1. Here is my little perl script foo.pl:

#!/usr/local/bin/perl -w
push(@fool, 'http://1\1','2\\2','3\\\3','4\\\\4','5\\\\\\5');
$farg = $ARGV[0];
print "Input:";
read(STDIN,$key,6);
print '-' x 50, "\n";
print "List: @fool\n";
print "Arg:  $farg\n";
print "Input:  $key\n";
print '-' x 50, "\n";
print "Output:\n";
foreach $a (@fool) {
  print "Match: $a\n" if $a eq $farg or $a eq $key;
}

2. Now I run this script from command line: %foo.pl 3\\\3

Input:4\\\\4
--------------------------------------------------
List: http://1\1 2\2 3\\3 4\\4 5\\\5
Arg:  3\3
Input:  4\\\\4
--------------------------------------------------
Output:
--------------------------------------------------

3. The result I expected is:

Input:4\\\\4
--------------------------------------------------
List: http://1\1 2\\2 3\\\3 4\\\\4 5\\\\\5
Arg:  3\\\3
Input:  4\\\\4
--------------------------------------------------
Output:
Match: 3\\\3
Match: 4\\\\4
--------------------------------------------------

4. I don't know how to find a string which includes meta-characters.
    Do you see that
     '1\1' is treated as '1\1'
     '2\\2' is treated as '2\2'
     '3\\\3' is treated as '3\\3' if it is from list
              but treated as '3\3' if it's from argument.
     etc ...

                   Any help would be appreciated.

                   Benarson.



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

Date: Mon, 11 Aug 1997 21:09:34 +0100
From: Phil Carmody <pc1@scigen.co.uk>
To: Victor Magdic <vmagdic@talas.com>
Subject: Re: changing perl to gibberish
Message-Id: <33EF717E.5C13@scigen.co.uk>

Victor Magdic wrote:
> 
> Does anyone know if there are any programs that will take perl source
> and scramble it into gibberish, so that it is effectively unreadable
> (i.e. human readable variable names are converted to strings of
> letters+numbers, spaces compacted etc.)

Russ Allbery does, see his .sig -

#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ >
0gFzDgD,
 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

Phil
-- 
\|/ ____ \|/   int c,a,x,y;main(){for(;a<2000;c    Phil Carmody,
 @~/ ** \~@    %=80)printf("%c"," .:lU@\nPhil"[    Consultant,
/_( \_ / )_\   x=a%80-40,y=a/80-13,c+=(x=400-x*    Scientific Generics,
   \__U_/      x-y*y*4)>0?x:0,a++%80?c/80:6]);}    Cambridge, UK


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

Date: Tue, 12 Aug 1997 08:16:22 -0400
From: Dean Hoover <dhoover@textwise.com>
Subject: complex argument passing
Message-Id: <33F05416.3785@textwise.com>

I previously posted an article requesting help on
how to call semctl in an undocumented way. Maybe
I should state my problem in a slightly more general
way:

I need to call a perl function (semctl) which calls
an underlying C function that expects one of its
arguments to be a C union. That union looks like
this:

          union semun {
               int val;
               struct semid_ds *buf;
               ushort *array
          } arg;

I need to set the "val" member of the union and pass
it to the semctl (perl) function. How do I do it???

Regards,

Dean Hoover


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

Date: 11 Aug 1997 23:12:31 -0700
From: paulb@kelly.teleport.com (Paul Buder)
Subject: Re: Converting cgi submission to variable names?
Message-Id: <5sousf$9f1$1@kelly.teleport.com>

In <5skqup$mc$1@netnews.upenn.edu> ayfishma@mail2.sas.upenn.edu (Ariel Y Fishman) writes:

>Hi,
>My apologies if this has been asked before; my newsreader is a bit slow 
>and frustrating in terms of finding the right recent posts.

>I am currently working on some scripts which use data that I process from 
>cgi form submissions. I want to assign a variable with the same name as 
>the "name" function in the cgi form to the "value" submitted in the form.

The following works but is somewhat dangerous.  It assumes you are
using CGI.pm.

use CGI;
$query=new CGI;
package cgivar;
@varnames=$main::query->param();
for(@varnames)
	{ 
	next if /[^a-zA-Z_]/;
	$$_=$main::query->param($_); 
	}
package main;
print "$cgivar::abc\n$cgivar::def\n";

The above will print 

123
456

given a url of /cgi-bin/cgi_var_test?abc=123&def=456

It is very important that the variables you are creating via your form
are in their own package.  Otherwise any user could trash any
variable, say, in your main package.  Also, the 'next' line prevents
user submissions like main::myvar or main'myvar.



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

Date: 12 Aug 1997 10:08:11 GMT
From: samiss@lehtori.cc.tut.fi (Sami Sandqvist)
Subject: foreach problem
Message-Id: <slrn45v0df7.22k.samiss@lehtori.cc.tut.fi>

I am having a problem with foreach. In the code I have attached there are
two lines marked with ####HERE. The first line prints several pages of
keys, but the second line is executed only once. What am I doing wrong?
I did not post the file that should be processed with it because it is
quite long.

Sami Sandqvist
----------------
#!/bin/perl -w
%tagit = qw {
    02  6F
    03  8F
    04  9F
    05  10F
    06A  11F
    06B  12F
    06C  13F
    07A  14F
    07B  15F
    08  16F
    09  4F
    };
open SISAAN, $ARGV[0] or die "$ARGV[0] ei auennut!\n";
#Kerataan luokat %luokat-hashiin
while (<SISAAN>) {
    if (/^<01>(.*)$/) {
	chomp $1;
	$luokat{$1}=[()];
    }
}
close SISAAN;
print STDERR keys %luokat;              ####HERE
foreach $ali (keys %luokat) {
    print STDERR "!\n";                 ####HERE
    $temp = $ali;
    do {
	if ( $temp =~ /\)$/ ) {
	    $temp =~ s/\([^\)]+\)$//;
	} 
	else {
	    $temp =~ s/.$//;
	}
	$temp =~ s/\.\.\.$//;
	$temp =~ s/\.$//;
	$temp =~ s/\*$//;
	$temp =~ s/\'$//;
	if (exists ($luokat{$temp})) {
	    push (@{$luokat{$temp}},$ali);
	    print STDERR "Jee\n";
	    last;
	}
    } while (length($temp) != 0);
}

foreach $i (keys %luokat) {
    %temppi = {};
    foreach $j (@{$luokat{$i}}) {
	$temppi{$j} = 1;
    }
    $luokat{$i} = [(sort keys %temppi)];
}

open SISAAN, $ARGV[0];
$uusinum = "EI";
while (<SISAAN>) {
#Ekalle riville ei tule alkuun ^-merkkia.
    if ( $. == 1 && s/<01>(.*)$/R\^1F\^P$1/o) {
	chomp $1;
	$uusinum = $1;
    }
    elsif (s/<01>(.*)$/\^R\^1F\^P$1/o) {
	chomp $1;
	$uusinum = $1;
    }
#Jos oli <1>-kentta niin tehdaan <2> ja ehka <14>

    if ($uusinum ne "EI") {
	print;
	$temp = $uusinum;
	$kolme = $uusinum;
	$laita = 1;
	$temp =~ s/.$//;
	$temp =~ s/\.$//;
	$_ = "^2F^P$temp\n";
	$uusinum = "EI";
    }
    if ( /^\<03\>/ ) {
	s/\./\^P/go;
    }
    s/^\<(\d\d[ABC]?)\>/\^$tagit{$1}\^P/;
    if ($laita) {
	print "^3F",join("^P", (@{$luokat{$kolme}})),"\n";
	$laita = 0;
    }
    print;
}
print "^";







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

Date: 12 Aug 1997 11:29:56 GMT
From: tina@scandinaviaonline.se (Tina Marie Holmboe)
Subject: Frustration and -T
Message-Id: <5sphfk$596$1@news1.sol.no>


  [Bear over with me for this, people - there are only philosophical style
   questions in here :) ]

  Background: creating several modules to be used with a CGi-script that my
employer wants. One of these is a search-engine, meant to take a list of
objects as an argument, and return a subset of these that matches a
searchstring.

  I wanted to give the user several choices in writing these searches, and
so both AND, OR, NOT, regular expressions, " ... ", '...', and 'barewords'
are accepted. In order to fix this I translate the searchstring into a 
Perl expression, which is then eval'ed.

  In other words:

     - Translate the searchstring.
     - Create an anonymous subroutine that does the testing on the data.
     - Create an reference to this with $Code = eval($PerlCode) ;

  so far, so good... Search.pm worked like a *charm* - I've used this
technique before, with luck. Of course, I tested it using

  env - perl name.pl5

  and it worked perfectly. Time to try it through the http-server. It died.
It *died* - and I mean *died* - in the middle of the eval(), without any sort
of error message from the server. I attempted, of course, to output $@.
Nops. It never *reached* the print statement after the eval.

  That was when the day became interesting... :)

  Much testing and scratching of heads followed, both by myself and one other
developer called in to assist. For about 30 minutes we tried things like:

    eval("print 1 ;") ;                     # Worked perfectly.         (1)
    $Code = eval("sub { print 1 ; }") ;     # Worked perfectly.         (2)

  and

    $PerlCode =<<EoD;
sub {
  print 1 ;
}
EoD
    $Code = eval($PerlCode) ;               # Did *not* work...         (3)



  All in all it was a rather frustrating situation. What bothered me the
most was the utter lack of error messages. Finally it dawned on me that
*perhaps* this was due to the -T, and Perl seeing that last eval() as
tainted. It did...

  Now, I have read the perlsec manpage, but I am still puzzled. Anyone
feeling up to explaining why (1) and (2) above are 'untainted', but (3) is
tainted ?

  If someone feel even *more* adventou...ouru... (ARGH!) - why on Earth
didn't I get any errors out ? Why did it _die_ inside that eval ? I'd
swallow an error from same eval() (in $@), but why this sudden death ?

  Did I miss something in the manuals ? Are there a FMTYEWTK on tainting ?



  (I'll restrain myself from asking someone to explain the question 
   behind the answer '42', however :)

--
 Tina Marie Holmboe                          tina@mail.scandinaviaonline.se

 The opinions expressed above are mine, and should in no way or under any
 circumstances be associated with Scandinavia Online AB unless this disclaimer
 is explicitly revoked.


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

Date: Tue, 12 Aug 1997 13:24:46 +0200
From: Eckard Brauer <ecki@intershop.de>
Subject: Hashes in Perl 5.004_01
Message-Id: <33F047FE.78C7@intershop.de>

Hi there!

Investigating the behaviour of a large Packe written in Perl5.001 with
Perl5.004_01 I found the following differences:

1. A local variable declared _twice_ in the same scope with my() will
   not be accepted. (is O.K.)

2. Making a Hash empty with 'my(%hashvar) = {};' doesn't work. (also
   O.K., I'm using 'my(%hashvar) = ();')

3. Using a construct like 'my(%hashvar, $scvar) = @_;' to leave $scvar
   undef'd with an even count of arguments and let it be the last arg
   with an odd count doesn't work too.

Please let me know (by mail, please, because I don't read this newsgroup
regularly because of its load) whether it's correct or not. This third
construct is used frequently in our application.

Thanks in advance!

Ecki

-----------------------------------------------------------------
smail: Eckard Brauer, Feuerbachstrasse 3 HH, D-04105 Leipzig
email: ecki@intershop.de
phone: +49-341-2115588 (work); +49-341-2115588 (private)
-----------------------------------------------------------------


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

Date: Tue, 12 Aug 1997 15:23:55 -0800
From: bz7347275@ntu.edu.sg
Subject: How to open a file to a variable instead of an array?
Message-Id: <33F0F08B.7A9E8E64@iris.eee.ntu.ac.sg>

How can i open a file to a variable instead of an array?

Thks.

Benny
benny@iris.eee.ntu.ac.sg



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

Date: Tue, 12 Aug 1997 12:09:31 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: How to open a file to a variable instead of an array?
Message-Id: <EEsv3v.F4w@world.std.com>

bz7347275@ntu.edu.sg writes:

>How can i open a file to a variable instead of an array?

I'm assuming you mean "how do I store the contents of a file in a
variable". You open a file to a filehandle, you use that filehandle to
access the contents of the file, and as you read the the file, you can
store its contents someplace.

One fairly straightforward way, is to join all of the lines together.

while(defined($line = <FILE>)) {
  $file = $file . $line;
}

or 

$file = join '', <FILE>;

A tricky way is to change the "input record separator" variable so
that perl won't stop at newlines:

{  # start a new block to contain the changes to $/
  local($/) = '';
  $file = <FILE>;
}


and an inefficient but quick to write way is to use the cat command and
backticks:

$f = `cat filename`;


-- 
Andrew Langmead


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

Date: Tue, 12 Aug 1997 12:48:48 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: How to open a file to a variable instead of an array?
Message-Id: <33f05b72.338825465@igate.hst.moc.com>

[cc'd to original author]

On Tue, 12 Aug 1997 15:23:55 -0800, bz7347275@ntu.edu.sg wrote:

>How can i open a file to a variable instead of an array?

What do you mean by "open a file to a variable"? Do you want to put
the contents of a file into a single variable? Do you want to open a
file whose name is conatined in a variable?

Have you read any of the Learning Perl documentation?

Jeremy
-- 
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio

http://www.marathon.com/

Unless explicitly stated, these are my opinions only--not those of my employer.


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

Date: Tue, 12 Aug 1997 00:23:13 -0700
From: Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
Subject: Re: How to treat "\n" as "\n" ?
Message-Id: <33F00F61.7379@scf.usc.edu>

Thomas Bahls wrote:
:  But I have just adopted a software project, in which I cannot
: (easily) change the data; in fact these are read in from many files
: which contain many different character sequences, that have normally
: "special meanings" in Perl, e.g.
: 
:         \n \t
:         $foo            (etc.)
: 
:  so I really have to force Perl to interpret the two chars
: <backslash> and <n> as "newline", <backslash> <t> as tab and even
: <dollar> "foo" as "42" (or whatever its value is).

The sequence <backslash> and <n> is \\n.  to change \\n to \n, just use 

	$a = "Some text\\n";
	$a =~ s/\\n/\n/g;

To replace $foo to its value, you will have to use eval

	$foo = 42;
	$a = '$foo';
	$cmd = '$new_a = '.$a;		# construct my command
					# '$new_a = 42'
	eval $cmd;			# results in $new_a
	print $new_a,"\n";


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

Date: 12 Aug 1997 09:04:22 GMT
From: matlar@rsv.se (Mats Larsson)
Subject: Re: How-to cut the last characters of a varibles
Message-Id: <5sp8um$b2t$1@u30039.rsv.svskt.se>

In article <lawsonh.870748042@melb132>, lawsonh@melb.cpr.itg.telecom.com.au (Lawson Hanson) says:
>
>Stephane Robertson <Stephane.Robertson@hec.ca> writes:
>
>>Hello,
>
>>How can I cut the last characters of a variable? 
>
>>For example: I need to use printf "%20s", $variable;
>>             and if the $variable is more than 20 characters I want it
>>             to be cut to the 20th characters. Even if the variable is
>>more then 20 characters
>>             I want 20 characters to be printed on the screen.
>
>>How do I do that?
>
>I should think looking in the index of any Perl book,
>under "string", or "sub-string" would probably point you
>to the "substr" function:
>
>    printf "%20s", substr( $variable, 0, 20 );
>

or printf "%20.20s", $variable;

Regards Mats Larsson


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

Date: 12 Aug 1997 09:09:51 GMT
From: knappen@iphcip1.Physik.Uni-Mainz.DE (J%org Knappen)
Subject: Re: Is it possible to use HTPASSWD within Perl?
Message-Id: <5sp98v$h2i$1@esmeralda.zdv.Uni-Mainz.DE>

Tim Armbruster schrieb:

> I am trying to generate user names and passwords for per-directory access
> within a Perl script, and then write them to a password file (with the
> passwords 64-base encoded.) 

\begin{offtopic}
base64 is not a suitable encoding for passwords. It is just a mechanical 
transform from binary data to text format and easily be inverted.
\end{offtopic}

--J"org Knappen

P.S. I had a similar problem recently, look under the subject
Re: Bidirectional Communication, Comm.pl for more information.




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

Date: 12 Aug 1997 11:14:24 +0200
From: Matthias Neeracher <neeri@iis.ee.ethz.ch>
Subject: Re: Is there a perl IDE?
Message-Id: <86hgcvoj9r.fsf@iis.ee.ethz.ch>

Kenneth Vogt <KenVogt@rkymtnhi.com> writes:
> I can't seem to find a perl IDE for Win95 anywhere.  What do you folks
> use?

I use a Mac, on which there *is* an IDE :-)

Matthias

-----
Matthias Neeracher   <neeri@iis.ee.ethz.ch>   http://www.iis.ee.ethz.ch/~neeri
   "I'm set free to find a new illusion" -- Velvet Underground


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

Date: 11 Aug 1997 22:42:47 -0700
From: paulb@kelly.teleport.com (Paul Buder)
Subject: Re: MAX OPEN FILES under SunOS/Solaris?
Message-Id: <5sot4n$767$1@kelly.teleport.com>

I missed the original quoted article mentioned below but think it
worth mentioning the default hard limit in Solaris is 1024.  I believe
the default soft limit in Solaris is 64 but maybe on your system it is
256.  Any user can raise the soft limit up to the hard limit.  The way
to do this in perl is to get a copy of BSD::Resource off of CPAN and
use setrlimit and RLIMIT_NOFILE.

In >5sgbvr$9s9@news-central.tiac.net> mike@stok.co.uk (Mike Stok) writes:

>In article >5sg9up$9op$1@Mars.mcs.net>,
>Michael Borowiec >mikebo@MCS.COM> wrote:

>>Under Solaris 2.5[.1], which has a "ulimit -n" of 1024, the program dies:
>>File 253 open failed:  at sbin/maxfile line 5.

>>Can anyone tell me why I can't open the OS maximum number of files with
>>Perl? It fails the exact same way with Perl 4.036 or 5.004_01. Any help


>The operating system imposes these limits per process, using setrlimit
>it's possible to lower the limits for a process, and if your process has
>superuser permissions it's possible to raise them to some limit which is


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

Date: Tue, 12 Aug 1997 09:15:50 +0300
From: Petri Backstrom <petri.backstrom@icl.fi>
Subject: Re: Newbie - Perl for Win
Message-Id: <33EFFF96.1B4B@icl.fi>

Jerry Pank wrote:
> 
> I have installed perl for win and I am trying to work my way thru
> examples in the llama book.
> 
> Whilst I can see that unix side will fail (as I have no unix directory
> structure etc) I can get simple scripts to run ,in a dos window, but the
> problem I have is that the window closes as soon as the script has
> executed.  this gives me no time to evaluate my experiments.

Open an MS-DOS Window and run your Perl programs from the command
line.

There's also a program property "close window on exit", which
you can set or unset for non-Windows programs run under Windows.

See also the Perl for Win32 FAQ at

  http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html

The "standard" Perl FAQ (among other things) can be found via

  http://www.perl.com/FAQ/

regards,
 ...petri.backstrom@icl.fi
    ICL Data Oy
    Finland


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

Date: Tue, 12 Aug 1997 14:00:19 +0200
From: Per Fredrik Kvarme <perkva@itk.ntnu.no>
Subject: NEWBIE help with sybperl
Message-Id: <33F05053.76F5@itk.ntnu.no>

Hello

	I'm setting up a database on a sybase server, and I want to use 
sybperl to write a CGI interface. Unfortunately I'm all new to perl, and 
so I REALLY need simple, plain, detailed instructions on what I need to 
do to set up sybperl, include modules and libraries, etc, and how to do 
sybperl calls in my script.

	Please, somebody help me, or point me to some understandable 
source, because I haven't really found anything that makes sense on the 
net so far :) Thanks in advance!


 - Per Fredrik Kvarme


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

Date: 12 Aug 1997 12:13:06 GMT
From: tina@scandinaviaonline.se (Tina Marie Holmboe)
Subject: Re: Passing Parameter in Perl
Message-Id: <5spk0i$596$2@news1.sol.no>

In article <33EB7A9C.49FC@hackberry.chem.niu.edu>,
	Darin Burleigh <burleigh@hackberry.chem.niu.edu> writes:

> Anthony Danh wrote:
>> 
>> Hi...
>>         How many parameters can you pass using the below syntax?
>> 
>> "/cgi-bin/CGI2Perl.exe/mo/order.pl?id=10&name=testing...."
>> 
>>         can a parameters have space between them? (look below)
>> 
>> "/cgi-bin/CGI2Perl.exe/mo/order.pl?id=10&name=This is a test&file=one"
>> 
>> Thanks
>> 
>> Anthony Danh
> 
> 
> this is not Perl syntax, its CGI protocal. look it
> up in the FAQ's. I'm pretty sure you can't have a space.

  As Tom(P) with his - as always - straight aim pointed out this isn't
exactly a Perl question. The answers looked for are, however:

  1) The number and size of parameters are implementation dependent; ie.
     check with the server.

  2) Yes, and no - you *can* have spaces if you code them as %20...

--
 Tina Marie Holmboe                          tina@mail.scandinaviaonline.se

 The opinions expressed above are mine, and should in no way or under any
 circumstances be associated with Scandinavia Online AB unless this disclaimer
 is explicitly revoked.


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

Date: 12 Aug 1997 12:11:01 GMT
From: "Greg Meechan" <gregmee@vianet.net.au>
Subject: Password Protection on a directory
Message-Id: <01bca719$49541740$fc230dcb@www.cosmic.com.au>

Hi!

A client of mine wants to restrict access to a directory at his site so
that he can have a 'members only' section. According to what I've read this
is done using a .htaccess file. My problem is that although my client has
full access to run cgi scripts the only way to transfer the scripts is via
FTP as the host site does not allow telnetting. 

I've tried to FTP a .htaccess file across, I've tried to FTP a htacess file
across and then rename it .htaccess. However, none of these work! 

Does anyone have any suggestions, or can anyone recommend a 'off the shelf'
password script. My client wants the small password window to 'popup' when
the members section is accessed.

Thanks for any help!

Greg Meechan
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Greg Meechan                                        ~
~ Cosmic Web Designs                              ~
~ Perth Australia                                        ~
~ greg@cosmic.com.au                              ~
~ http://www.cosmic.com.au                       ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

Date: Tue, 12 Aug 1997 12:47:38 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: Password Protection on a directory
Message-Id: <33f05b1d.338740422@igate.hst.moc.com>

[cc'd to original author]

On 12 Aug 1997 12:11:01 GMT, "Greg Meechan" <gregmee@vianet.net.au>
wrote:

>I've tried to FTP a .htaccess file across, I've tried to FTP a htacess file
>across and then rename it .htaccess. However, none of these work! 
>
>Does anyone have any suggestions

Yeah, contact the ISP and ask them to fix the problem, or at least ask
them what the proper procedure is.

Jeremy
-- 
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio

http://www.marathon.com/

Unless explicitly stated, these are my opinions only--not those of my employer.


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

Date: Tue, 12 Aug 1997 10:00:08 +0200
From: denis@mathi.uni-heidelberg.de
Subject: perl and libaries
Message-Id: <33F01808.167E@mathi.uni-heidelberg.de>

hallo,

i tried to use the perl standard libaries, but i noticed that they are 
not installed on my machine. so i got the sorces end copied the lib 
files in a directory. next i added a $INC[0]=libdir; in my script.
but the error messages didnot change.
has anyone a solution?
thanks

	denis


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

Date: 12 Aug 1997 06:54:10 GMT
From: "Jose Castilla" <castillj@concentric.net>
Subject: Perlshop Setup
Message-Id: <01bc8136$0c55d4e0$2986adce@josepe>

Has anyone been able to setup Perlshop successfully in Windows NT?
It comes with UNIX setup instructions. Any advise?

-- 
Jose Castilla
castillj@concentric.net


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

Date: Tue, 12 Aug 1997 07:41:56 -0500
From: perrella andrew c <perrella@ehsn23.cen.uiuc.edu>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Problem With Join()
Message-Id: <Pine.SOL.3.95.970812074032.9641A-100000@ehsn23.cen.uiuc.edu>


Thanks, 

	I made these switches and they worked fine.  The only THing I had
to do was put in a $new_data =~ s/\n\n/\n/g;

to filter out the spaces.

thanks again.

andrew
perrella@uiuc.edu

On Mon, 11 Aug 1997, Tom Phoenix wrote:

> On Mon, 11 Aug 1997, perrella andrew c wrote:
> 
> > open(admin_info, "./admin/ip-admin.dat");
> 
> You should really be checking the return value of open. And if you used
> -w, Perl would remind you that a filehandle shouldn't be all lower case. I
> recommend all caps for filehandle names. 
> 
> > 		undef $/;
> > 		$admin_data = <admin_info>;
> > 		$/ = '\n';  
> 
> That's probably not what you want, since '\n' doesn't appear in files so
> often as "\n" does. :-)
> 
> Hope this helps!
> 
> -- 
> Tom Phoenix           http://www.teleport.com/~rootbeer/
> rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
> Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
> 



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

Date: 12 Aug 1997 07:05:56 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Server Push in Perl???
Message-Id: <5sp20k$d74$1@lyra.csx.cam.ac.uk>

Matthew Burnham <danew@enterprise.net> wrote:
>
>Try unbuffering the output: $| = '';

Close, but...

Set $| to a true value (conventionally 1) for unbuffered output.
Setting a false value (such as '') sets buffered output.


Mike Guy


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

Date: 12 Aug 1997 06:05:08 GMT
From: babyvis@mail.teleport.com (ken)
Subject: Trouble using an Array
Message-Id: <5souek$1qj$1@nadine.teleport.com>

Newbie problem... help appreciated; 

I'm trying to read a file, stuff each new line of text into an 
array so I can use the sort function to organize the 
file (by line). All the examples I've seen so far seem to 
use arrays to contain the elements within a line...? 



@array_of_lines = <LOG>;  Hoping that this "loads" the array
			array_of_lines[0] = first line in LOG
			array_of_lines[1] = second line, etc

sort(@array_of_lines);
print(@array_of_lines);


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

Date: Tue, 12 Aug 1997 05:11:34 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Trouble using an Array
Message-Id: <mscps5.sj.ln@localhost>

ken (babyvis@mail.teleport.com) wrote:
: Newbie problem... help appreciated; 

: I'm trying to read a file, stuff each new line of text into an 
: array so I can use the sort function to organize the 
: file (by line). All the examples I've seen so far seem to 
: use arrays to contain the elements within a line...? 



: @array_of_lines = <LOG>;  Hoping that this "loads" the array

It does.

Of course, you already knew that because you put in a couple of
print statements to check it, right?

   print "0: '$array_of_lines[0]'\n";
   print "1: '$array_of_lines[1]'\n";

: 			array_of_lines[0] = first line in LOG
: 			array_of_lines[1] = second line, etc

: sort(@array_of_lines);

That sorts the array, and *returns the sorted list*.

But you have not saved the list anywhere. 

Nor have you printed out the sorted array.

So it is gone...


: print(@array_of_lines);


   print(sort @array_of_lines);


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

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

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