[6401] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 26 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 27 18:17:26 1997

Date: Thu, 27 Feb 97 15:00:21 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 27 Feb 1997     Volume: 8 Number: 26

Today's topics:
     Re: !!!help me please!!! (Curt Bousquet)
     Re: *perlxstut error : Embedding C/C++ into Perl 5.003 <mdsmith@qualcomm.com>
     anyone got a pl for secure html page?? <richard.ells@ndirect.co.uk>
     Re: Avoiding trashing a file with flock <dbenhur@egames.com>
     Re: Can't Subscribe to Perl5-Porters list <tchrist@mox.perl.com>
     Delayed variable interpolation in string question (Herschel Goldstein)
     Re: escaping quotes/#? <wkuhn@uconect.net>
     Re: Generating a randomly sorted list of integers (Herschel Goldstein)
     Help: Resources.pm problem (Ido's )
     help: Server error (Keith Warner Colvin)
     Re: Hiring Webpage Designers <zot@ampersand.com>
     Re: How would I write this more concisely (Randy J. Ray)
     in place editing across NFS mount dhall@sportsline.com
     Join our CGI List FREE! jyll@msn.com
     Re: max string size. <rootbeer@teleport.com>
     Re: Named Pipes and Perl, anyone done this? <humphric@akcity.govt.nz>
     Re: Optimizing nested loops <dbenhur@egames.com>
     Re: Perl on Windows 95 <anon@nowhere.com>
     Re: Perl PRO needed here ! ($cgi)?(Perl):(SSI); (Shockwave Rider)
     pingecho() generates junk output (Raman Garg)
     Re: Returning a reference to a 'my' variable <rootbeer@teleport.com>
     Space Allocation in Perl Arrays <craig@lucent.com>
     telnet with no local echo? <amundson@cs.umn.edu>
     Unix Commands in Perl Script jimrsmith@unn.unisys.com
     Re: Unix Commands in Perl Script <fawcett@nynexst.com>
     Re: vi & color coding <jerrym@ibmoto.com>
     Re: Win95 can't always do this! ( Was: Re: Perl on Wind <boren@tngms1.mro1.dec.com>
     Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)

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

Date: Thu, 27 Feb 97 19:35:17 GMT
From: no@spam.please (Curt Bousquet)
Subject: Re: !!!help me please!!!
Message-Id: <5f4nlq$alu@thrush.sover.net>

In article <3315C339.3AF3@ntplx.net>, anon7@ntplx.net wrote:
>
>        I've found the $ENV 'REMOTE_HOST' but it only seems to take me back to
>the users' host.  I can't seem to get the users' id/username.  Is that
>possible?

        Not that I know of. The only way you can get the user ID is to entice 
the visitor to submit on a form somehow. 
        I guess if the visitor has a fixed IP address, you might find 
something out about him/her using 'finger' on the value returned by 
'REMOTE_HOST'

      
>        Is there a list of $ENV somewhere?

        This is not really a Perl question, and should more appropriately be 
in the CGI newsgroup, buit that said here is a page that defines some of the 
variables:

http://cykic.com/onlnhelp/3000/05c.htm


+++++++++++++++++++++++++++          
Curt Bousquet
http://www.webrover.com/ia/
$Email = (scanline\@+sover.net =~ s/+//g); 


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

Date: Thu, 27 Feb 1997 14:02:47 -0800
From: Michael Smith <mdsmith@qualcomm.com>
To: John Carter <john.carter.3320157@nt.com>
Subject: Re: *perlxstut error : Embedding C/C++ into Perl 5.003
Message-Id: <33160487.58FF@qualcomm.com>

John Carter wrote:
<snip>

> npgts143 30: test1.pl
> Can't find loadable object for module Test1 in @INC (./blib
> /opt/perl/lib/sun4-s
> olaris/5.003 /opt/perl/lib /opt/perl/lib/site_perl/sun4-solaris
> /opt/perl/lib/si
> te_perl .) at Test1.pm line 18
> BEGIN failed--compilation aborted at test1.pl line 5.

I *just* did this for the first time today as well, and came across the
same problem.  I finally figured out what it was complaining about; it
couldn't find the .so file.  You need to include the directory
containing the .so file in your LD_LIBRARY_PATH env var, like:

setenv LD_LIBRARY_PATH
/the/path/to/test1/Test1/blib/arch/auto/Test1:$LD_LIBRARY_PATH

This would have been taken care of if you (we) would have run this test
in perl's 'home' directories.  Of course, since I don't have permissions
(or a desire) to do this, we need to make some alterations.

Of course, that got *test*.pl to work.  Now I have the error msg:
  Can't locate auto/Test1/hello.al in @INC at test1.pl line 7
when I try to run test1.pl.  It seems to be able to find the module, but
is unable to run the functions in the library.  Shouldn't the make
create the .al file?  Is there a parameter I need to add for the
autoloader?

Incidentally, I would like to propose that this man page have an
addendum in case the user isn't working with Test1 within the perl
'source' directories themselves.  Perhaps add explanations to solve the
problems that John and I are having (or at least pointers to other man
pages).

Also, does someone know of a location (man page, WWW page, etc.) that
addresses most of the problems that occur when one does *not* have
access to the perl home directories, and must install modules in their
separate user space?  I'm looking for pointers to things like the @INC
array, PERL5LIB, LD_LIBRARY_PATH, and other problems I have yet to solve
(like this one).  I would find such a trouble-shooting resource very
valuable.  These gems of wisdom are scattered throughout the Camel book,
but I never seem to be able to find my solution (the index isn't useful
for finding many of these 'embedded' gems).

Thanks!
-- Mike


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

Date: 27 Feb 97 21:15:51 GMT
From: "Rick" <richard.ells@ndirect.co.uk>
Subject: anyone got a pl for secure html page??
Message-Id: <01bc0d5f$9fe88040$35fe4ac2@richard>

Greetings!

Anyone out there got a perl script to enable a secure are (password
protected) in a web site???? I have swoppable things!!

All the best

Richard Ells

richard.ells@ndirect.co.uk



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

Date: Thu, 27 Feb 1997 10:32:50 -0800
From: Devin Ben-Hur <dbenhur@egames.com>
To: Mark Thompson <mwt@cyberg8t.com>
Subject: Re: Avoiding trashing a file with flock
Message-Id: <3315D352.439F@egames.com>

Mark Thompson wrote:
> I ran the following test program to see how open and flock interelate
> and I'm wondering if I'm missing a trick or something:
> 
> open(MBOX, ">passwd.tmp");
> <STDIN>;
> flock(MBOX, 2);
> seek(MBOX,0,2);
> print MBOX "Test";
> flock(MBOX, 8);
> 
> If you notice, the open will trash testoutput before flock gets to
> determine whether everything's all right.  Another catch is that the
> way the program is written, there's no way to know whether passwd.tmp
> actually exists beforehand.
> Anyone have any suggestions?

Yes.  Whenever you're establishing a lock on several
files at once (or on a file that might or might not exist),
don't lock the file(s) being manipulated, but rather a seperate
file whose sole purpose is to act as a semaphore for your
file locking.  For your example:

open(LOCK, "+<file.lock") or die;
flock(LOCK, 2);
open(MBOX, ">passwd.tmp");
<STDIN>;
seek(MBOX,0,2);
print MBOX "Test";
flock(LOCK, 8);

My understanding of flock under unix is that it's mearly
advisory.  That is, the only thing the lock blocks are other
flock requests.  There's no low-level blocking of file access
(open/close/read/write/rename/unlink), merely an advisory
state which *co-operating* processes can query & set to
coordinate shared access.

--
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: 27 Feb 1997 22:19:36 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Can't Subscribe to Perl5-Porters list
Message-Id: <5f519o$5de$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    gaa7065@tntech.edu (Gary Andraza) writes:
:Everyone,
:
:        I tried to subscribe to the perl5-porters mailing list three times over
:the past two days.  By doing just like the page at www.perl.com said to by
:sending mail to majordomo@nicoh.com but all I got abck each time was that the
:list didn't exist. I got a list of served lists from that server , I didn't
:appear on it.  Where did the list move to so that I can subscribe to it.  I
:would sure apprieciate the help.

Bug in address, and the silly nicoh people don't have a forwarder.

Use perl5-porters-request@perl.org (or .com if you forget; I've an alias).

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    "I think the pod should be the master...."
	    --Larry Wall in <9410072305.AA03994@scalpel.netlabs.com>


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

Date: 27 Feb 1997 21:27:33 GMT
From: herschel@waterw.com (Herschel Goldstein)
Subject: Delayed variable interpolation in string question
Message-Id: <5f4u85$cqd@sea.waterw.com>

The following script works, but seems to lack that perl prettiness (the eval
line has backslash disease).

$x = "The answer is \$y\n";		# don't interpolate $y here
$y = 10 * 23 + 6;			# set $y here
eval "print \"$x\"";			# now interpolate it

Mindful of the multitude of methods perl possesses, there should be another
way. If it's in the faq, sorry, the pages loaded unbearably slowly.

Herschel P. Goldstein, Ph.D.
herschel@hallweb.com


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

Date: Fri, 21 Feb 1997 01:02:11 -0500
From: Bill Kuhn <wkuhn@uconect.net>
Subject: Re: escaping quotes/#?
Message-Id: <330D3A63.43E26486@uconect.net>

Something you may want to do is use the qq (double quote) function.

Just choose/use a delimiter for qq that doesn't appear in the text you
are using qq on (kind of like with m// you can use m##).

example:

print qq|<body bgcolor="#FFFFFF">|,"\n";

In the above example it is not a big deal to just escape the
metacharacters, but when you get more complicated expressions like

<a href="somewhere.com/path/to/index.html"><img src="graphic.gif" alt="a
graphic"></a>

escaping all the metacharacters is a pain.

I prefer doing qq|expr| personally.

-Bill
-- 
Bill Kuhn
Chief Developer
Wired Markets, Inc.
http://www.buyersindex.com


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

Date: 27 Feb 1997 21:57:53 GMT
From: herschel@waterw.com (Herschel Goldstein)
Subject: Re: Generating a randomly sorted list of integers
Message-Id: <5f5011$cr2@sea.waterw.com>

Stephen Frost (frostbyt@shell01.ozemail.com.au) wrote:

> I needed to write some code to produce a randomly sorted list of
> integers (between "1" and "n").  This I have done, but I am not
> at all happy with the amount of code that was required, nor with
> the performance implications of the way I've gone about it.  It
> works just dandy (and fast enough) with 1->99 or thereabouts, but
> if I were to use it with 1->999 or 1->9999 it would probably die
> a horrible death.

Here's a grunt solution I use. Any list will work.

$m = 10000;	# cinch
@x = ( 1 .. $m );
&RandList( \@x, $#x+1 );

sub RandList( $$ )	# randomize first $n list items
{
        my( $lref, $n ) = @_;

        srand( time() );
        for( $i=0; $i<=($n-2); $i++ )
        {
                my($li) = $n - $i - 1;          # current list index
                $rn = int($x=rand($li+1));

                if( $li != $rn )
                {
                        my($temp) = $$lref[$li];

                        $$lref[$li] = $$lref[$rn];
                        $$lref[$rn] = $temp;
                }
        }
}


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

Date: 27 Feb 1997 19:20:50 GMT
From: idoh@cais.com (Ido's )
Subject: Help: Resources.pm problem
Message-Id: <5f4mqi$1ur@news2.cais.com>

I have been trying to figure out Resources.pm and I have not been able to 
succeed.  The main program is first, my resfile is next and then the 
output.  How do I find out what TZ is set to, and how do I find out what 
is in "all" or in series5?  However, as one can see from the output my 
resfile is not even read.  What am I doing wrong? [I'm using 1.02 amd perl
5.002]

---
Main Program:
---
#!/usr/local/bin/perl -w

use lib "./Modules";

use Resources;

$resfile = "./.resfile"; # 

$res = new Resources ( $resfile ) || die;

foreach $key ( keys( %{ $res->{Res} } ) ) {

    print "$key \t => \t". ${ $res->{Res}->{ $key } }[0] . "\n";

}

---
Resfile:
---
Time.TZ		: GMT	# Greenwich Timezone
Time.LTZ	: ET	# Eastern Timezone

iterations	: 2	# number of iterations

fleet.series5	: ( 51, 52, 53, 54, 55, 56 )	# series5 in fleet contains 
						# the array elements
fleet.series6	: ( 61, 62, 63, 64, 65, 67 )	# series6 in fleet contains 
						# the array elements
---
Output:
---
resources.appclass 	 => 	mse_Resources
resources.editor 	 => 	/bin/vi
resources.verbosity 	 => 	1
resources.resources 	 => 	%Resources
resources.tmpfil 	 => 	/tmp/resedit28064
resources.viewcols 	 => 	78
resources.writepod 	 => 	0
resources.pager 	 => 	/bin/cat
resources.viewmincols 	 => 	15
resources.separator 	 => 	:
resources.updates 	 => 	0
resources.mergeclass 	 => 	1


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

Date: Thu, 27 Feb 1997 11:45:27 -1000
From: colvin@aloha.net (Keith Warner Colvin)
Subject: help: Server error
Message-Id: <colvin-2702971145270001@hawaii-26.u.aloha.net>

Aloha from Hawai'i:

I am new at this, no joke ;), I am using Macperl5:

When I try to run my cgi this is what I get:

<HEAD><TITLE>Server Error</TITLE></HEAD>
<BODY><H1>Server Error</H1>
The server encountered an internal error or
misconfiguration and was unable to complete
your request.<P>
Please contact the server administrator,
 Webmaster and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.<P>
</BODY>

This is where it is at:
http://hele.com/cgibin/html_web_store.cgi?page=number.shtml&cart_id=

How do I fix this server error and use the cgi the way I want it.

Malama Pono....


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

Date: 27 Feb 1997 16:23:41 -0500
From: Mark Atwood <zot@ampersand.com>
Subject: Re: Hiring Webpage Designers
Message-Id: <v6afoqx7s2.fsf@colon.dev.ampersand.com>


Dear Bonehead,

Use <URL:news:misc.jobs.offered>.

Thank you

jons@compute.com (Jon Sullivan) writes:
> 
> Network Intensive of Irvine, California, is accepting applications for
> full time Webpage Illustrators/Designers.  This is a salaried
> position.  The ideal candidate would have experience designing
> webpages at a professional level, familiarity with UNIX, Photoshop
> expertise, proven design skills, an understanding of CGI and Perl,
> good customer interaction skills, and familiarity with emerging web
> technologies.  Illustration skills are a major plus.
> 
> We are not interested in freelance or telecommuting developers.  Our
> developers work closely together to bring our customers polished and
> professional designs.
> 
> We specialize in custom Web solutions, back-end programming, on-line
> commerce, and complete connectivity solutions.
> 
> Please e-mail your resume to employment@ni.net or mail it to: 
> 
>                        Network Intensive
>                        8001 Irvine Center Drive, Suite 1130
>                        Irvine, California 92718
>                        Attn: Employment Opportunities 
> 
> --------------------------------------------
> 
> Network Intensive, a complete network solution provider, is a
> full-service provider of network consultation, and high-performance
> products and services to technically oriented businesses of the
> greater LA Basin and Albuquerque, New Mexico markets. The company is
> headquartered in Irvine, California , with a regional office in
> Albuquerque, New Mexico. Sales are handled directly through the
> technical account teams operating from both locations. For more
> information, visit the Network Intensive Web Site: http://www.ni.net,
> or businesses can call Network Intensive at 1-800-273-5600.
> 

-- 
Mark Atwood       | Cuius testiculos habes,
zot@ampersand.com | habeas cardia et cerebellum.



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

Date: 27 Feb 1997 14:35:42 -0700
From: rjray@tremere.ecte.uswc.uswest.com (Randy J. Ray)
Subject: Re: How would I write this more concisely
Message-Id: <uow4teylyoh.fsf@tremere.ecte.uswc.uswest.com>

gej@spamalot.mfg.sgi.com (Gene Johannsen) writes:

> if ($#ARGV == -1) {
>     $sked_file = "sked";
> }
> else {
>     $sked_file = shift;
> }
> ...

$sked_file = ($#ARGV == -1) ? "sked" : shift;
$min       = ($#ARGV == -1) ? 5      : shift;

(Long time, old friend...)

Randy
-- 
===============================================================================
Randy J. Ray -- U S WEST Technologies IAD/CSS/DPDS         Phone: (303)595-2869
                Denver, CO                                     rjray@uswest.com
"It's not denial. I'm just very selective about the reality I accept." --Calvin
===============================================================================


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

Date: Thu, 27 Feb 1997 14:21:14 -0600
From: dhall@sportsline.com
Subject: in place editing across NFS mount
Message-Id: <857074522.3157@dejanews.com>

Has anyone ever seen this?

I'm running the following command line in a directory that lives
physically on an NT box, and is mounted via NFS on a Solaris box

perl -i.bak -p -e 's[/usr/bin][/usr/local/bin]' *.pl

The backup files are fine, but the original files are all empty.

TIA

Dave Hall
SportslineUSA
http://www.sportsline.com

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


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

Date: Thu, 27 Feb 1997 21:12:37 GMT
From: jyll@msn.com
Subject: Join our CGI List FREE!
Message-Id: <3315f8c1.550456713@netnews.worldnet.att.net>

Join our CGI List FREE!

Sign-Up Form For email List Is At:

http://www.newslinx.com/lists/

CGI - Information, ideas, and new applications for the cgi guru and
those that want to be!
--


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

Date: Thu, 27 Feb 1997 13:40:33 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Mohammed Dewan <s798284@aix2.uottawa.ca>
Subject: Re: max string size.
Message-Id: <Pine.GSO.3.95q.970227133649.4167H-100000@kelly.teleport.com>

On 27 Feb 1997, Mohammed Dewan wrote:

>    i was trying to copy a whole file into a 
> string . The file size is only 200k . But i could
> not do it . To my understanding perl runs in 
> protected mode . So Any string variable could 
> be as long as my total memory size. But it doesn't 
> seem to work that way . Could any one explain why .My 
> code is 
> 
> open (File,"<"."test.txt")
> while (<File>)
> {
>  $store=$store.$_;
> }

Hmmm... That code isn't syntactically valid, so I'm sure _that_'s not your
code. But try this anyway.

    {
        local($/);
        open FILE, "test.txt" or die "Couldn't open file: $!";
        $store = <FILE>;	# Slurp in whole file
        close FILE;
    }

Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Thu, 27 Feb 1997 22:23:11 GMT
From: Craig Humphrey <humphric@akcity.govt.nz>
Subject: Re: Named Pipes and Perl, anyone done this?
Message-Id: <3316094F.5B9E@akcity.govt.nz>

Bill Cowan wrote:
> 
> Craig Humphrey wrote:
> >
> > Hi People,
> >         in the never ending quest for info on Perl and the various ways to use
> > it as the goo between our Netscape Communications WWW server and our MS
> > SQL Server (6.5), I was wondering if anyone had any ideas on how to to
> > use named pipes in Perl (I have 5.something).
> >
> > I'd heard that it was possible.  Has anyone managed it?  If so, care to
> > give me some pointers, even if it's just to online docos.
> >
> > Thanks.
> >
> > Later'ish
Hi Bill,

 
> Assuming you are running on NT, you may want to check out:
> 
>         ftp://ftp.roth.net/pub/ntperl/
> 
> for Dave Roth's set of module extension for Win32.  There appears to
> module for pipes you may want to check (just a guess).
> 
> Of more interest would be the Win32::ODBC module as possible means to
> develop Perl CGI scripts with SQL Server access via ODBC.

Yeah.  Nabbed this.  Runs like a dream.  EXCEPT! ;-)  I can't get it
retreiving SQL Server's TEXT data type fields.  Which is the core of my
project!

Thanks for your help.

Later'ish
Craig


-- 
usagi@ihug.co.nz                    | My views and opinions are barely
humphric@akcity.govt.nz             | my own, let alone that of my
usagi@ibm.net                       | employer or ISP!
http://homepages.ihug.co.nz/~usagi  | "Come to Butt-Head" - Butt-Head


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

Date: Thu, 27 Feb 1997 14:08:46 -0800
From: Devin Ben-Hur <dbenhur@egames.com>
To: doug.alcorn@sonoco.com
Subject: Re: Optimizing nested loops
Message-Id: <331605EE.55DB@egames.com>

Doug Alcorn wrote:
> I have a script I am writing.  It works, but it is slow IMO.  I am new
[snip]
> lines in it.  I am told that this is average case.  When I run the
> program on my box using the time command, it takes 3m49.94s.  I would
> like to cut this down some as I will have to run this program
> frequently.  TIA

> open (PART_NUM_FILE, $part_num_name) or die "$0: Cannot open
> $part_num_name for read.\n";
> foreach (<PART_NUM_FILE>) {
>     chomp;
>     push @part_num_list, $_;
> }
> close PART_NUM_FILE;
> 
> open (BOM_FILE, $bom_name) or die "$0: Cannot open $bom_name for
> read.\n";
>  BOM: while (<BOM_FILE>) {
>      ($bom_grade, $bom_remainder) = split /~/, $_, 2;
>    PART_NUM: foreach $part_num (@part_num_list) {
>        ($part_grade) = ($part_num =~ m/.{6}_(\d{4})\./);
+++ here's your biggest time sink
>        $test = ($bom_grade <=> $part_grade);
>        next BOM if ($test == -1);
>        next PART_NUM if ($test == 1);
>        print $part_num, $bom_remainder;
>   }
> }

Note that in your inner loop (executed @bom * @part times)
you are continuously reparsing the encoded part-number record.
Also, you're using a regexp to parse a fixed-length field
layout for which unpack is more suited and undoubtedly
faster...

I'd rewrite your code to do the essential part-record parsing
when you read the part file. eg: (untested)

 ...
foreach (<PART_NUM_FILE>) {
    chomp;
    my ($junk,$grade) = unpack "a7 a4", $_;     # extract part grade
    # add anonymous hash with both grade & full record elements to array
    push @part_num_list, { grade => $grade, record => $_};
}
 ...
while (<BOM_FILE>) {
    my ($bom_grade, $bom_remainder) = split /~/, $_, 2; # see note (1)
    foreach $part (@part_num_list) {
        last if $bom_grade < $part->{grade};	# move to next bom record
        if ($bom_grade == $part->{grade}) {	# found match!
            print $part->{record}, $bom_remainder;
	}
    }
}

(1) if your bom records always have that fixed format where the
first 4 bytes are the grade, this would probably be faster than
the split:
    my ($bom_grade, $junk, $bom_remainder) = unpack "a4 c a*", $_;

BTW, what the heck does "bom" stand for?

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: 27 Feb 1997 22:27:29 GMT
From: "Sandy MacKenzie" <anon@nowhere.com>
Subject: Re: Perl on Windows 95
Message-Id: <01b8c7bf$e0020b80$2e9375c2@none>

I got perl scripting working well with PWS and Netscape.  IE3 however
demands that 
I invoke dial up networking.

Terence Jordan <tjordan@ns15.cca.rockwell.com> wrote in article
<33158dd2.4281113@news>...
> On Tue, 25 Feb 1997 23:51:46 GMT, wilsonpm@gamewood.net (Pete M.
> Wilson) wrote:
> 
> >Microsoft has the free PWS (Personal Web Server) for Win95 on their
> >site. I don't know if it supports scripting.
> >
> >Peter Holtan <puzzled@cris.com> wrote:
> 
> I tried it, but I couldn't get it to work with perl.
> +--Terence Jordan(x7233)----------------+----------------------------+



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

Date: Thu, 27 Feb 1997 20:34:10 GMT
From: shockwave.rider@worldnet.att.net (Shockwave Rider)
Subject: Re: Perl PRO needed here ! ($cgi)?(Perl):(SSI);
Message-Id: <331aef3a.31651581@netnews.worldnet.att.net>

Or you sould just use an SSI (Server Side Include):
(<!--#echo var="HTTP_REFERER"-->)

<html>
<head><title>PROJECT - PHASE #1 </title></head>
<frameset rows="60,*">
    <frame src="title.html" name="title"  SCROLLING=no>
    <frameset cols="180,*">
         <frame src="nav.html" name="nav" SCROLLING=auto>
         <frame src=<!--#echo var="HTTP_REFERER"--> name="main"
SCROLLING=auto>
   </frameset>
</frameset>
</html>

Travis

On 27 Feb 1997 11:20:49 GMT, "Charles Robbie" <intaba@iafrica.com>
wrote:

>Hi
>Can anyone write me a good script that when a person clicks on a link in my
>site, it will bring up a frames page in my site and IMPORT the outside URL
>or site INTO the body of my frame - That way I do not lose the viewer from
>my site?
>
>Any Genius out there?
>Thanx
>Charles
>intaba@iafrica.com



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

Date: 27 Feb 1997 22:04:05 GMT
From: rgarg@rgarg-sun.us.oracle.com (Raman Garg)
Subject: pingecho() generates junk output
Message-Id: <5f50cl$jog@inet-nntp-gw-1.us.oracle.com>

Hi,

	I was just trying to use pingecho() function in the following script
to check for All UP hosts on the network .For some reason, it prints  junk
binary data at the end .
I can't find the problem with the script which works all right otherwise 
( except the junk characters at the end)

Please take a look and email me any clues to this problem.

Here is the relevant portion of the script :



#!/usr/local/bin/perl -w

use Net::Ping;

@check=(1..100);   #Host list etc.
open(NOWDOWN, ">/tmp/.nowdown") || die ( "Can't open file for writing\n ");
foreach (@check) {
        if ( pingecho($_,10) ) {
        print NOWDOWN  ("$_ is up \n" ) ;
        }
        else {
        print NOWDOWN  ("$_ is down \n" ) ;
         }
}
@out = ();
@out = <NOWDOWN>;
print @out;
close NOWDOWN;


TIA.
--
------------------------------------------------------------------- 
Raman Garg			Phone:	  (415)506-6044 
Oracle Corporation		Internet: rgarg@us.oracle.com 
--------------------------------------------------------------------
Disclaimer: The opinions expressed above do not necessarily represent  
those of my employer Oracle Corporation ( or for that matter my own :-)


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

Date: Thu, 27 Feb 1997 13:33:19 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Luc St-Louis <lucs@cam.org>
Subject: Re: Returning a reference to a 'my' variable
Message-Id: <Pine.GSO.3.95q.970227133227.4167G-100000@kelly.teleport.com>

On Wed, 26 Feb 1997, Luc St-Louis wrote:

> I need to write a sub thats creates a huge list and would like to return
> a reference to the list, rather than the list itself. For example:
> 
>   sub CreateList
>     {
>     my @x;
>     # ... Build up the list ...
>     return \@x;
>     }
> 
>   $A = CreateList();
>   $B = CreateList();
> 
> Does this work? Are references $A and $B guaranteed to be different and
> usable?

Yes, and yes. (And a nice feature it is, too.) Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Thu, 27 Feb 1997 15:57:11 -0600
From: Craig Votava <craig@lucent.com>
Subject: Space Allocation in Perl Arrays
Message-Id: <33160337.41C6@lucent.com>

Folks-

Here's an interesting question:

When an element in a Perl-5 array is defined, is space allocated for
all of the elements from the start of the array, to that point?

I wrote a test program to try and determine this, but I get output that
I can't explain. Any help is appreciated!

TEST PROGRAM:
-------------------------------------------
my @ARRAY;

print "Current process size:\n";
system "ls -las /proc/$$";

$ARRAY[409600] = "hi";

print "New process size:\n";
system "ls -las /proc/$$";
-------------------------------------------

Output:

Current process size:
3392 -rw-------    1 cmv      cmv      1736704 Feb 27 15:53 /proc/4870
New process size:
8872 -rw-------    1 cmv      cmv      4542464 Feb 27 15:53 /proc/4870

There is a difference of 2,805,760 bytes. I think the answer is yes.
What am I missing here...

-Craig

	()_()	Craig Votava
	 (_)	Lucent Technologies
		craig@lucent.com


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

Date: Thu, 27 Feb 1997 14:35:15 -0600
From: Shawn T Amundson <amundson@cs.umn.edu>
Subject: telnet with no local echo?
Message-Id: <3315F003.6D62FC41@cs.umn.edu>

I'm trying to write a server to a couple of different things
and have run into a problem which currently has me stumped.  The
server is fairly simple, it creates a TCP socket and that all
goes fine.  I can connect with telnet, etc.  

The problem is that I have not been able to find a way to 
turn off local echo in the telnet application.  I've tried
to send it Control E, but that has not worked.  Telnet tells
me it is in old line mode.

Any help would be greatly appreciated.

--
Shawn T. Amundson		University of Minnesota
Systems Administration	 	Computer Science System Staff
amundson@cs.umn.edu	  	http://www.cs.umn.edu/~amundson/     	

while (i) { last }
    i, do exist.
    forever;



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

Date: Thu, 27 Feb 1997 14:21:09 -0600
From: jimrsmith@unn.unisys.com
Subject: Unix Commands in Perl Script
Message-Id: <857074272.2942@dejanews.com>

Okay, before I get the RTFM and RTFFaq's, I did that already.
I am a brand new perl person, with some ksh backround, and I am just
not comprehending the docs.
How do I issue this command string from perl?
echo $msg1 | /usr/local/pager -cfg_dir $cfg -user $who
or this one:
echo $datestamp : $msg1 > $errorlog

I have tried lots of iterations of system(), and have been unsuccessful.

Thanx !

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


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

Date: 27 Feb 1997 15:43:57 -0500
From: Tom Fawcett <fawcett@nynexst.com>
Subject: Re: Unix Commands in Perl Script
Message-Id: <8jzpwqgesy.fsf@nynexst.com>

jimrsmith@unn.unisys.com writes:
> Okay, before I get the RTFM and RTFFaq's, I did that already.
> I am a brand new perl person, with some ksh backround, and I am just
> not comprehending the docs.
> How do I issue this command string from perl?
> echo $msg1 | /usr/local/pager -cfg_dir $cfg -user $who

system("echo $msg1 | /usr/local/pager -cfg_dir $cfg -user $who")
	and die "system: $!";

or if you want more control:

open(PAGER, "| /usr/local/pager -cfg_dir $cfg -user $who") 
	or die "open(PAGER): $!";
print PAGER $msg1, "\n";
close(PAGER) or die "close(PAGER): $!";


-Tom


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

Date: Thu, 27 Feb 1997 14:44:04 -0600
From: Jerry Monsen <jerrym@ibmoto.com>
Subject: Re: vi & color coding
Message-Id: <3315F214.7DE1@ibmoto.com>

Mike Stok wrote:
> 
> In article <Pine.HPP.3.95.970226171451.17142A-100000@beehive.twics.com>,
> Kevin Baker  <ol@twics.com> wrote:
> 
> >two newbie type questions. Hopefully I'll impress the oldtimers by my
> >interest in vi, the king of editors.
> 
> You'd better don some flameproof clothes, people seem to get their
> underwear all bunched up when people start that kind of talk :-)
> 
> >1) Can you get a color coded perl syntax 'vi' editor
> 
There is kind of a way to get there, if xemacs is available for your
platform.
xemacs has a really good vi emulation (viper) and has font-lock-mode to
indicate
what part of the code is which. It doesn't seem to get confused too
often by the
code unless you use a lot of regular expressions...

Good luck

Jerry


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

Date: Thu, 27 Feb 1997 17:25:19 -0500
From: Ed Boren <boren@tngms1.mro1.dec.com>
Subject: Re: Win95 can't always do this! ( Was: Re: Perl on Windows 95)
Message-Id: <331609CF.7968@tngms1.mro1.dec.com>

Hank LeMieux wrote:

> Mostly you can, and I do.  However, there is one key catch.  I'm not
> familiar with the technicals, but apparently Win95 is unable to open a
> new port from your local server when your browser executes a CGI script
> that, for instance, sends email via BLAT.  So, for example, I have a

I've had this problem in perl win32 (5.001m) when running under Netscape
Fasttrack Server 2.0 for Windows 95 (it seems to work in NT 4.0). It
seems to fail when doing a gethostbyname. If run from the command line
everything works fine, but when run as a ShellCGI script it fails. Other
Win95 web servers seem to work just fine. Has anybody else experienced
this?

ed boren
Digital Equipment Corporation
boren@tngms1.mro1.dec.com


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

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

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