[6632] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 257 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 8 22:08:13 1997

Date: Tue, 8 Apr 97 19:00:26 -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, 8 Apr 1997     Volume: 8 Number: 257

Today's topics:
     ?? PERL execution on client using <SCRIPT .....> <\SCRI (Rhadji P)
     Arrays <peredina@progress.com>
     Re: CGI output HTML (Jason Lane)
     Re: CGI output HTML (Mike Stok)
     Re: Easy way to promote your web site (Andreas Pfotenhauer)
     Re: error in Makefile.PL (Nathan V. Patwardhan)
     Re: Executing a small EXE on NT/IIS ()
     Re: HELP: perl5.003 dynamic extensions don't build on S lvirden@cas.org
     Re: Holy Wars! (was: Perl vs C++, Unix vx MS, etc) ()
     Need simple perl script, Please. (Baron Sengir)
     Re: No GUI environment for Perl? ()
     Re: OO programming question (James A. Robinson)
     Perl-Books. <n94magho@isy.liu.se>
     Re: problem with -s (Jason Lane)
     Re: Question Of Leading \n From Join Function. (Mik Firestone)
     Question on Class method inheritance <chiue@nortel.ca>
     queuing forks <rdschramm@scripps.com>
     Redirect in FormMail jbernier@wsii.com
     Re: Redirect in FormMail (James A. Robinson)
     Re: select says data waiting but sysread blocks? (Lutz Albers)
     Re: sort array? (Billy Vitro)
     Substitution Question <thpr@vnet.ibm.com>
     Re: Substitution Question <tchrist@mox.perl.com>
     Re: Unix and ease of use  (WAS: Who makes more ...) (Kaz Kylheku)
     Re: Unix and ease of use  (WAS: Who makes more ...) (Jettero Heller)
     Why doesn't 5.003 pod2man work? <jc@buffie.mko.dec.com>
     Re: Why doesn't 5.003 pod2man work? <tchrist@mox.perl.com>
     Win32 and Tk buckinm@nfric.nesusa.com
     Re: Win95 opendir() (Nathan V. Patwardhan)
     Re: Win95 opendir() <flg@vhojd.skovde.se>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Tue, 08 Apr 1997 12:48:03 GMT
From: dharma@msys.net (Rhadji P)
Subject: ?? PERL execution on client using <SCRIPT .....> <\SCRIPT> tag. ??
Message-Id: <5idf5f$e3m@lois.zippo.com>

Is there an effort underway to gain perl client support via the HTML
script tag (for fictitious example)?....

<SCRIPT type="text/perl">
   print "<H1>Hello world...Again</H1>";
    </SCRIPT>

Ron Picker


DharmaSystems
dharma@msys.net
Druid Hollow
French Creek, WV.



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

Date: Tue, 08 Apr 1997 16:11:52 -0400
From: Curt <peredina@progress.com>
Subject: Arrays
Message-Id: <334AA688.B02@progress.com>

Could anyone help me with this:

1) How do I use arrays instead of temporary files (i.e. multiple record
arrays) for certain instances when I must recall data from a previous
action.

Thanks.


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

Date: 8 Apr 1997 14:06:54 -0400
From: jlane@pathfinder.com (Jason Lane)
Subject: Re: CGI output HTML
Message-Id: <5ie1fu$n31@bilbo.dev.pathfinder.com>

In article <01bc4404$e6b7e2a0$d314020a@char.saa-cons.co.uk>,
SAA <paull@saa-cons.co.uk> wrote:
[snip]
>
>I'm now trying to make it easier to maintain the HTML which is returned as
>it is currently in the Perl code  i.e. 	print <<END_OF_HTML;
>			        	<html goes here>
>				END_OF_HTML;
>so I took the HTML and placed it in another file which the scripts reads in
>using 
>OPEN(IN, filename) and outputs it as before, unfortunately the variable
>values marked by $var_name in the HTML no longer get replaced with the Perl
>values but just get shown as '$var_name'.


Try using double quotes.

-- 
--
Jason J. Lane                              jlane@pathfinder.com
Lead Application Developer                 212-522-9613
Time Inc. New Media                        http://www.pathfinder.com


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

Date: 8 Apr 1997 20:49:27 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: CGI output HTML
Message-Id: <5ieb0n$fth@news-central.tiac.net>

In article <01bc4404$e6b7e2a0$d314020a@char.saa-cons.co.uk>,
SAA <paull@saa-cons.co.uk> wrote:

>I'm now trying to make it easier to maintain the HTML which is returned as
>it is currently in the Perl code  i.e. 	print <<END_OF_HTML;
>			        	<html goes here>
>				END_OF_HTML;
>so I took the HTML and placed it in another file which the scripts reads in
>using 
>OPEN(IN, filename) and outputs it as before, unfortunately the variable
>values marked by $var_name in the HTML no longer get replaced with the Perl
>values but just get shown as '$var_name'.
>
>Has anybody managed to get this to work where Perl reads in the HTML file,
>replaces the $var_name with the Perl generated value and then outputs it to
>the browser ?

When you use a here document like that you are effectively using a double
quoted string which gets interpolated when you print it, but data you read
from a file isn't automatically interpolated (otherwise if you had a data
stream containing 'the price is $2.50 a unit' "interesting" things could
happen...)  You can do something along the lines of

  while (<FILE>) {
    no strict refs;
    s/\$([_a-zA-Z]\w*)/${$1}/g;
    print;
  }

but it might be more worthwhile to do something like putting variable ->
value mappings into a hash or a separate name space to prevent accidentla
data leakage if someone modifies the template file e.g.

  while (<FILE>) {
    s/\$([_a-zA-Z]\w*)/defined $textFor{$1} ? $textFor{$1} : ''/ge;
    print;
  }

maybe?

Hope this helps,

Mike
  
-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: Tue, 08 Apr 1997 19:41:14 GMT
From: pfote@wh-gotha.de (Andreas Pfotenhauer)
Subject: Re: Easy way to promote your web site
Message-Id: <334a1b25.61287339@news.roka.net>

Promoting your web site using freely avail. services
Summary of the mails I've got:
==========================================

From: "Magnus Holmberg." <pucko@lysator.liu.se>
	Go to http://www.peachmedia.com/shotgun/

From: "Rodney Myers (RM)" <rmyers@patrol.i-way.co.uk>
	http://www.webarrivals.com/main/submit.phtml
	http://www.liquidimaging.com/submit/

From: Wiliam Stephens <WILIAM_STEPHENS@compuserve.com>

Go to any of the major web search engines, and type in the keywords
'free' and 'web site' and 'promotion' or what ever you feel you
should, and there you have a listing of about 100 sites that do this
for you. www.submit-it.com is one of the best.


>On Thu, 03 Apr 1997 00:42:29 GMT, frankham@dial.pipex.com (Alfred
>Holmwood) wrote:
>
>>
>>Yawn.
>>
>>Or alternately visit any of the several sites which will do it for
>>free.
>>
>>Holmwood.
>
>Could you name some ?
>
>tnx in advance
>
>Andreas Pfotenhauer



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

Date: 8 Apr 1997 18:52:48 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: error in Makefile.PL
Message-Id: <5ie460$je2@fridge-nf0.shore.net>

Le T. Tran (totran@nasp01.lerc.nasa.gov) wrote:
: I just got Curses-1.0 package and compiled it. I got an error message:

:   Syntax error in file Makefile.PL at line 55, next 2 tokens "use ExtUtils"
:   Syntax error in file Makefile.PL at line 57, next 2 tokens "$inc and"
:   Syntax error in file Makefile.PL at line 71, next 2 tokens "\MY:"
:   Execution of Makefile.PL aborted due to compilation errors.

I never had a problem with Makefile.PL.  Are you sure you're using Perl 5,
not Perl 4?  My ISP installed Perl as perl5 and Perl (4.036) as perl, which
gave errors like the above.

For example, if I run perl (version 4) on some code which uses a module,
I get the following error:

syntax error in file group_check at line 4, next token "{"
syntax error in file group_check at line 14, next 2 tokens "use News"
syntax error in file group_check at line 15, next 2 tokens "new News"
syntax error in file group_check at line 18, next 2 tokens "new News"
syntax error in file group_check at line 20, next 2 tokens "->"
syntax error in file group_check at line 21, next 2 tokens "->"
syntax error in file group_check at line 25, next 2 tokens "->"
syntax error in file group_check at line 27, next 2 tokens "->"
Execution of group_check aborted due to compilation errors.

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: 8 Apr 1997 18:45:26 GMT
From: scott@lighthouse.softbase.com ()
Subject: Re: Executing a small EXE on NT/IIS
Message-Id: <5ie3o6$mru$1@mainsrv.main.nc.us>

Rdsdnen (_nospam_rasanen@sprynet.com) wrote:

: Why might the "system" line not be ok via a Perl script?

In Win32 + IIS, there are usually two culprits:

	1. The IIS environment defines a weird path. Make sure
	your program is on the path, and can be accessed from
	within an IIS session. (I don't think IIS does a
	chroot-like call to make other directories invisible,
	but you never know.)

	2. You may have permission to run this program
	from the command line, but scripts started
	by IIS may not.

Also, in your case, make sure the network drive n: is available,
unless this is really a local drive.

Scott



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

Date: 8 Apr 1997 12:29:43 GMT
From: lvirden@cas.org
Subject: Re: HELP: perl5.003 dynamic extensions don't build on Solaris ?
Message-Id: <5iddnn$h34@srv13s4.cas.org>


According to Benedict Lofstedt <benedict@daimi.aau.dk>:
:Hi,
:
:Can anyone help on this?  I'm trying to install perl5.003 on
:HPUX9.05, Solaris 2.4, 2.5, 2.5.1, IRIX5.3, 6.2.
:
:I have libdb.a and libgdbm.a on my system.  I can build the perl executable
:if I define '-Dusedl=false' in Configure, and the executable passes all
:self tests.
:
:If I try to use the dynamic extensions as dynamic [ which ought to be the
:intention ;-) ], I get the following error under the self test:
:
:lib/anydbm.....Can't load '../lib/auto/Fcntl/Fcntl.so' for module Fcntl: ld.so.1: ./perl: fatal: relocation error: symbol not found: main: referenced in ../lib/auto/Fcntl/Fcntl.so at ../lib/DynaLoader.pm line 140.
:
:and a lot of other instances of what appears to be the same error.

Interesting. I have a Solaris 2.5.1 system and am unable to convince Perl 5.003097b
to recognize they are present.  However, I had no problems under the self
test.



-- 
Larry W. Virden                 INET: lvirden@cas.org
<URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
Unless explicitly stated to the contrary, nothing in this posting should
be construed as representing my employer's opinions.


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

Date: 8 Apr 1997 18:52:05 GMT
From: scott@lighthouse.softbase.com ()
Subject: Re: Holy Wars! (was: Perl vs C++, Unix vx MS, etc)
Message-Id: <5ie44l$mru$2@mainsrv.main.nc.us>

Jason C Austin (jason@quake.cs.odu.edu) wrote:

: Why argue and block out all the real questions?

1. People who argue holy wars rarely have the restraint to stop
themselves, or they wouldn't do it in the first place :)

2. Usenet would cease to exist if these flame wars stopped.  The
proportion of legitimate traffic to flames is barely a blip on the
radar.

3. Culture clashes are bound to happen when one culture (like Perl)
meets another culture (like Windows). Both cultures don't
understand one another, and clashes are bound to happen.

4. The Voice Of Reason is just more noise on the Internet, because
every Joe AOL-Disk thinks he is the first person to think Bill Gates is
the Antichrist, UNIX is hard to use, emacs is better than vi, etc etc
etc. If there wasn't so much turnover, these flame wars wouldn't keep
happening. You rarely see repeat trollers.

5. The anonymity of Usenet encourages crudeness. If everyone had to
post messages in AVI format and everyone could see everyone else, I bet
the flame wars would stop.

If you've been on the Internet more than 2 years, you will begin
seeing how cyclical everything is. There's nothing new under
the sun.

Scott



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

Date: Tue, 08 Apr 1997 20:06:53 GMT
From: bnewman@infinet.com (Baron Sengir)
Subject: Need simple perl script, Please.
Message-Id: <334aa2a6.27474964@news.infinet.com>

Hello,

	I am not a programmer, but I am looking for a simple perl
script that I may be able to modify as needed, to read a database file
(ascii, flatfile> I can export however).  I need to be able to pull
the information up into a predesigned layout (a single html document)
and be able to cycle through, search, go directly to, and sort if
possible, the data in the file.  I do not need it to be able to edit.
I will edit the file in a database program and then export the new
database file as needed.

	If this is possible, please email me, I do not check
newsgroups very often.

Thank you for your assistance,
Bryan Newman
bnewman@infinet.com




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

Date: 8 Apr 1997 18:59:04 GMT
From: scott@lighthouse.softbase.com ()
Subject: Re: No GUI environment for Perl?
Message-Id: <5ie4ho$mru$3@mainsrv.main.nc.us>

Luca Passani (lpa@sysdeco.no) wrote:
:  The marketing crap was about a product which, through the use of some
: proprietary tools and languages, would allow to create HTML forms and
: CGI (in their basic-like language).
:  What I found unfair in the article...

Any claims made by marketing -- or articles regurgitating marketing --
can't be taken seriously. Or shouldn't be. You need your BS filter
turned waaaay up when you read computer trade rags.

:  If Perl was delivered with a nice GUI interface (both on Unix and PCs),
: it would gain much more appeal to the novices which are scared by a
: learning curve they will have to climb anyway.

I doubt this. If you're a clueless newbie who wants your computer
to have only one button, and it pre-pushed for you at the factory,
you'll NEVER "get" perl. No matter what.

An IDE-like environment would only help hardcore perl hackers be
more productive.

Scott

PS: Besides, writing write-only code in perl is something a lot of people 
take pride in :)



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

Date: 8 Apr 1997 10:53:20 -0700
From: jimr@aubrey.stanford.edu (James A. Robinson)
Subject: Re: OO programming question
Message-Id: <5ie0mg$m9a@aubrey.stanford.edu>

In article <5idp4d$5dp@fridge-nf0.shore.net>,
Nathan V. Patwardhan <nvp@shore.net> wrote:
>
> There are already modules on CPAN for uuencoding/decoding called
> Covert::UU.  There are already MIME modules for base64.

Right, my thought is to just have a neat little wrapper class around
preexisting conversion modules, so that people using this application
will have a unified interface.  I may develop my own modules as I need
them, but I'll tackle that when I get there it. :)

> I think you're looking to EXPORT the functions from a module, which
> means you should RTFM about exporting.

Well, from what I got out of the docs, the "Layer" class would still
need to be informed about "Layer::GZIP" and "Layer::UUENCODE"
etc. before being able to work.  So it one couldn't just drop in a new
"Foo/Layer/BINHEX.pm" file and expect to be able to call

	Layer->wrap('BINHEX', %args);

without first having to modify Layer.pm.  :(


Jim
-- 
Jim Robinson <jim.robinson@stanford.edu> - http://highwire.stanford.edu/~jimr/
HighWire Press -- Stanford University


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

Date: Tue, 08 Apr 1997 20:13:30 +0200
From: Hulken <n94magho@isy.liu.se>
Subject: Perl-Books.
Message-Id: <334A8ACA.1364@isy.liu.se>

Hi!

Can someone rekomend some good books about Lerning perl.


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

Date: 8 Apr 1997 14:19:31 -0400
From: jlane@pathfinder.com (Jason Lane)
Subject: Re: problem with -s
Message-Id: <5ie27j$n45@bilbo.dev.pathfinder.com>

In article <5ideah$tc2@gcsin3.geccs.gecm.com>,
Jim Michael  <jim.michael@gecm.com> wrote:
>I have a script which FTPs some files from our Vax cluster to an NT 
>(alpha) server. If the target files do not exist yet, zero byte files are 
>created on the NT server during the FTP session. Another script creates a 
>copy routine, but it  appears the -s does not work since all files are 
>copied including the 0 byte files:
>
>if (-s $datafile) {
>        print MYFILE ("copy $datafile \"Daily Captures\"\n");
>}
>
>How can I properly test for an empty file? TIA.


The following will print out the sizes of all files passed to it ignoring
files with 0 length:

perl5 -e 'while ($a = shift) {print $a, "\n" if -s $a > 0;}'

or in program form:

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

while ($a = shift) {
  print $a, "\n" if -s $a > 0;
}
-- 
--
Jason J. Lane                              jlane@pathfinder.com
Lead Application Developer                 212-522-9613
Time Inc. New Media                        http://www.pathfinder.com


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

Date: 8 Apr 1997 18:19:34 GMT
From: mfiresto@vnet.ibm.com (Mik Firestone)
Subject: Re: Question Of Leading \n From Join Function.
Message-Id: <5ie27m$bpq$1@mail.lexington.ibm.com>

In article <5ibso5$3kl@lois.zippo.com>, Rhadji P <dharma@msys.net> wrote:
>I've noticed the following sequence:
>
>@list ='';
>push(@list,val1,val2,val3,...valn);
>$array{key} = join("\n",@list);
>
>Results in:
>
>$array{key} = \nval1\nval2\nval3\n...\nvaln
>
>What is generating the leading \n?
Umm, the first element of your list, which happens to be NULL.

Your assignment of @list = ''; is forcing '' to be evaluated in a list 
context, so it becomes (''), which is an array of one element.  Then
your push() adds after that.  You are actually seeing something like
NULL\nval1\.. being printed.  As NULL is kinda hard to see, it looks to you
like \nval1.

I would strongly advise using @list = (); which is assigning the NULL list
to @list. 

Htth,
-----
Mik Firestone  mfiresto@mindspring.com
Evil Overlord Rule #9: After I kidnap the beautiful princess, we will be
married immediately in a civil ceremony, not a lavish spectacle in three
weeks time during which the final phase of my plan will be carried out.



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

Date: Tue, 08 Apr 1997 16:29:14 -0400
From: Hokee Chiu <chiue@nortel.ca>
Subject: Question on Class method inheritance
Message-Id: <334AAA99.2DA8@nortel.ca>

Hi,

I have a question regarding the support of inheritance in classes
in Perl 5.003:

I have 2 classes:

class Base:

defined fn A (public): calls fn B (public)

class Inherited:

only defines fn B (fn B in Inherited class should override Base class);
fn A defined in class Base can be re-used


When I create instance of class Inherited, and invoke fn A:

class Base::fn A invoked
class Base::fn B invoked   (I expect class Inherited::fn B is called)
class Base::fn B returned
class Base::fn A returned

Moreover, if in another scenario:

class Inherited: fn A is defined (override Base::fnA),
BUT fn B is NOT defined (i.e. I expect fn B in Base class to be reused)
when I execute the perl script, the following happens:

 ...
Undefined subroutine &Inherited::fnB called at xxxx.

I am not sure whether I am creating the classes correctly, or that
it is a bug in my version of Perl, or that the inheritance support
of Perl is different from C++.

Any insight/help is appreciated.


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

Date: Tue, 8 Apr 1997 15:55:17 -0400
From: "Rich Schramm" <rdschramm@scripps.com>
Subject: queuing forks
Message-Id: <5ieb73$61r$1@news.accessus.net>

Hi,

Below is a script I wrote that is *suppossed* to do the following:

1. loop about 20 times, shifting a parameter off of an array each time and
forking a process with that parameter.
2. Have the child signal handler to fork off another process each time a
child returns, thereby keeping 20 children running until all the items have
been shifted off the array.

This is basically supposed to run our log analyser against 20 logs at a
time until all of the logs (50+) have been analysed.

What is happening is that now there are only about 15 log files and all 15
start analysing immediately - just what I wanted.  However, as soon as one
log file is done, it goes back and starts analysing the same files it just
did. It *appears* that the shift is not working properly (not dropping
stuff from the array) but it is returning a value which leads me to think
it is something else.  I re-re-re-read the FAQ and camel book on signal
handling and it warns against doing anything that may malloc in the signal
catcher could cause a core dump, but I have not seen core dumps.

Does anyone have a code snippet that does process queuing like I am trying
to do (i.e., fork a new child everytime one returns until all the necessary
children are done?)

Thanks,

Rich

Please reply to rdschramm@scripps.com

-----------------------------
Code:

#!/usr/bin/perl
# Turn off buffering
$|=1;

# Import the variables / subs from the universal file
require "universal.pl";

#//////////////////
# Execute Program /
#//////////////////

# Open sitelist and build array of all sites 
# to run stats against.
open(SLIST,"<$SITELIST") || die "Could not open $SITELIST\n";
while(<SLIST>) {
 chomp;
 push(@sitelines, $_);
}

# If the maximum number of stats to run is more than the number of
# lines in the file, then set the maximum number to the number
# of lines in the file..
if (($#sitelines+1) < $MAX_STATS) {
  $MAX_STATS = ($#sitelines+1);
}

# Set child signal catcher to execute a "forkanother".
$SIG{'CHLD'} = 'forkanother';

$loop=1;
until ($MAX_STATS < $loop) {

 $linetodo = shift(@sitelines);
 ($hostname, $title, $configfile, $logdir) = split(/\|/,$linetodo);

 $pid=fork;

 if ($pid == 0) {
  # I am the child process
   $un_dir="$SS_STAGE/$hostname";
   $re_dir="$SS_RESOLVED/$hostname";
   &run_mkstats($hostname, $configfile, $re_dir);
   exit;
 }

 $PID{$pid}=$hostname;
 $loop++;

}

$SIG{'CHLD'} = 'DEFAULT';

until ( $kids == -1 ) {
  $kids=wait;

   if ($kids != -1) {
     &forkanother;
   }

}

sub forkanother {

 if ($#sitelines > -1) {
  $numprint = $#sitelines;
  $linetodo = shift(@sitelines);
  ($hostname, $title, $configfile, $logdir) = split(/\|/,$linetodo);
  $pid=fork;

  if ($pid == 0) {
    # I am the child process
    $un_dir="$SS_STAGE/$hostname";
    $re_dir="$SS_RESOLVED/$hostname";
    &run_mkstats($hostname, $configfile, $re_dir);
    exit;
   }

  $PID{$pid}=$hostname;

 }

}

############################
# run_mkstats subroutine   #
############################
sub run_mkstats {

 local($hostname, $configfile, $res_dir)=@_;
 local($SS_RES_STARTTIME, $SS_RES_STOPTIME);

 $SS_RES_STARTTIME=&sgettime('hh:mm:ss');

 # bring in the vars of the config file
 require("$SS_CONFIG_DIR/$configfile");

 use File::Path;

 # Make the reporting directory if it does not exist
 mkpath($REPORT_DIR, 0, 0755) unless -e $REPORT_DIR;


 # Run MKSTATS against the file
 $statcmd="$SS_MK_PROG -c $SS_CONFIG_DIR/$configfile -l $res_dir/$SS_RESFNAM
E -e > /dev/null 2>&1";
 # $statcmd="$SS_MK_PROG -c $SS_CONFIG_DIR/$configfile -l $res_dir/$SS_RESFN
AME -e -v";

 $mksres=system($statcmd);

 if (($mksres/256) == 0) {
  $SS_RES_STOPTIME=&sgettime('hh:mm:ss');
  &ss_write_log("$hostname: mkstats program started at $SS_RES_STARTTIME
and completed at $SS_RES_STOPTIME");
 } else {
  $SS_RES_STOPTIME=&sgettime('hh:mm:ss');
  &ss_write_log("FAILURE: $hostname: mkstats program started at
$SS_RES_STARTTIME and FAILED at $SS_RES_STOPTIME");
 }

}
#####################
# End resolvit
#####################





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

Date: Tue, 08 Apr 1997 13:22:49 -0600
From: jbernier@wsii.com
Subject: Redirect in FormMail
Message-Id: <860520384.3195@dejanews.com>

Hello,

I want to set-up Matt's Formmail script (WINNT) to redirect to an html
page on my server (MS IIS3.0) vs. the generic HTML page it produces.  I
set up my form as follows:

<input type=hidden name="redirect"
value="http://206.3.147.120/test/response.htm">

I keep receiving the following message:

Cannot open the Internet Site:
206.3.147.120/cgi-bin/formmail.cgi

Any help/suggestions would be greatly appreciated.


Thanks,
-John (jbernier@wsii.com)

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


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

Date: 8 Apr 1997 11:34:49 -0700
From: jimr@aubrey.stanford.edu (James A. Robinson)
Subject: Re: Redirect in FormMail
Message-Id: <5ie349$mms@aubrey.stanford.edu>

In article <860520384.3195@dejanews.com>,  <jbernier@wsii.com> wrote:
>Hello,
>
>I want to set-up Matt's Formmail script (WINNT) to redirect to an html
>page on my server (MS IIS3.0) vs. the generic HTML page it produces.  I
>set up my form as follows:

It would probably be easier for you to use CGI.pm and it's nifty
little "redirect($url)" method.


Jim

-- 
Jim Robinson <jim.robinson@stanford.edu> - http://highwire.stanford.edu/~jimr/
HighWire Press -- Stanford University


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

Date: Tue, 08 Apr 1997 11:13:55 +0200
From: lutz@muc.de (Lutz Albers)
Subject: Re: select says data waiting but sysread blocks?
Message-Id: <lutz-ya023480000804971113550001@news>

In article <3348DA31.6F1CBF7E@k2.net>, Matija Grabnar
<matija.grabnar@k2.net> wrote:

>Is my buffer size (65536) too big? Does it mean it should block
>until it has 65536 bytes or until the file is closed? If so,
>what would be a good size that would avoid blocking on the 
>sysread and still allow for efficient operation? 

>From man perlfunc:
               Attempts to read LENGTH bytes of data into
               variable SCALAR from the specified FILEHANDLE,
               using the system call read(2).  It bypasses stdio,

So, if it's using read, then it will try to read 65536 bytes (or eof
occurs). You could open the file with sysopen and the non-blocking flag
(check you system man pages, I don't have access to a Linux system :-).

I'm not sure if this will help you, but it might a pointer in the direction ...

ciao
  lutz
--
Lutz Albers, lutz@muc.de
Do not take life too seriously, you will never get out of it alive.


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

Date: Tue, 08 Apr 1997 10:58:15 -0700
From: bvitro@cisco.com (Billy Vitro)
Subject: Re: sort array?
Message-Id: <bvitro-0804971058150001@vitro-ipx.cisco.com>

You may want to try instantiating this as a hash rather than a standard
array, i.e.:

%line_is = ("10" => "line data",
            "1"  => "line data",
            "31" => "line data",
            (etc.)
);

foreach $key (sort {$a <=> $b} keys(%line_is)) {
    print "$line_is{$key}\n";
}

Of course, with hashes there is no way to get the original input order
printed out (i.e. you can't guarantee that you can print them out as
10,1,31,3,6,...)

If, on the other hand, you wanted to just sort a list (10,1,31,3,6,...)
numerically, try:

@numbers = (10, 1, 31, 3, 6, 2, 22, 202, 41, 4, 5);
print join("\n", sort {$a <=> $b} @numbers)."\n";

This won't keep the line data with the numbers, however.

Hope that helps,
Billy.


In article <5ib502$2va$1@news3.microserve.net>, soccer@microserve.net
(Geoffrey Hebert) wrote:

> I want to sort lines.  So simple (ha), I thought I would 
> code is as below.  The nature of my real data is like that
> below.  
> 
> help appreciated.
> 
> Yeh, this is my first sort.  Read and re-read for a couple of hours
> I haven't given up.  But, I know this is an easy question for someone
> that knows the answer.  Thanks.
> 
> #!/opt/bin/perl -w
> @line_is = (
>   ["10", "line data"],
>   ["1", "line data"],
>   ["31", "line data"],
>   ["3", "line data"],
>   ["6", "line data"],
>   ["2", "line data"],
>   ["22", "line data"],
>   ["202", "line data"],
>   ["41", "line data"],
>   ["4", "line data"],
>   ["5", "line data"],
> );                                    # problem one how to print line
> foreach $line(@line_is) { 
>   print "$line\n";            # This of course prints ARRAY(0..etc
> }
> @sorted= sort {$line_is[$a][1] <=> $line_is[$b][1]} @line_is;
>                                      # sort gives OUT OF MEMORY
> foreach $line(@sorted) {
>   print "$line\n";
> }
> exit;


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

Date: Tue, 08 Apr 1997 16:16:36 -0400
From: Thomas Parker <thpr@vnet.ibm.com>
Subject: Substitution Question
Message-Id: <334AA7A4.41C6@vnet.ibm.com>

Pardon my question on "Substitution" and "Quoting" (I think!), I've read
the FAQs and such, and have a solution (see below) but would like to
know from the more experienced people out there if there is a better way
to solve this problem.

Thanks!

If I have:

$temp_item = "A+B";
$master_item = "((A+B)/C)+((A+B)-D)";

how do I get $master_item to be:

((E)/C)+((E)-D)

I have tried:

$master_item =~ s/$temp_item/E/g;

But this fails because $temp_item contains a "+" which seems to be
evaluated as a regular expression.

I know

$master_item =~ s'$temp_item'E'g;

will not work because it does not expand $temp_item.

Do I have to [i.e. my current solution]

($replace_item = $temp_item) =~ s/([^\w\s])/\\$1/g;
$master_item =~ s/$replace_item/E/g;

??

Thanks.

-- 
Thomas Parker
thpr@vnet.ibm.com  x6-4673 (TIE 446)


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

Date: 8 Apr 1997 21:09:04 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Substitution Question
Message-Id: <5iec5g$hc7$2@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    Thomas Parker <thpr@vnet.ibm.com> writes:
:Pardon my question on "Substitution" and "Quoting" (I think!), I've read
:the FAQs and such, and have a solution (see below) but would like to
:know from the more experienced people out there if there is a better way
:to solve this problem.

However did you miss this FAQ?

  How can I quote a variable to use in a regexp?

        The Perl parser will expand $variable and @variable references
        in regular expressions unless the delimiter is a single
        quote. Remember, too, that the right-hand side of a `s///'
        substitution is considered a double-quoted string (see the perlop
        manpage for more details). Remember also that any regexp special
        characters will be acted on unless you precede the substitution
        with \Q. Here's an example:

            $string = "to die?";
            $lhs = "die?";
            $rhs = "sleep no more";

            $string =~ s/\Q$lhs/$rhs/;
            # $string is now "to sleep no more"

        Without the \Q, the regexp would also spuriously match "di".

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


    "For it, that's now" --Larry Wall


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

Date: 8 Apr 1997 18:10:48 GMT
From: kaz@vision.crest.nt.com (Kaz Kylheku)
Subject: Re: Unix and ease of use  (WAS: Who makes more ...)
Message-Id: <5ie1n8$lev@bcrkh13.bnr.ca>

In article <01bc43a7$0c0cdbe0$87ee6fce@timpent.a-sis.com>,
Tim Behrendsen <tim@a-sis.com> wrote:
>BTW, no offense, but *why* do people post PGP signatures?  Is it just
>me, or is it completely ridiculous?

It's so that when they post something completely idiotic, they can be
nailed beyond the shadow of a doubt. Stupid, if you ask me.

I have a PGP key floating around the servers somewhere, but I'll be
darned if I go through the trouble of signing every damn e-mail or posting.
It's a complete waste of bandwidth to authenticate yourself without first
being challenged to do so. You only need the authentication if someone doesn't
believe that you wrote the text. In that case, you can respond to the challenge
by privately forwarding a copy of the text along with your digital signature.


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

Date: 8 Apr 1997 20:35:11 GMT
From: heller@nacs.net (Jettero Heller)
Subject: Re: Unix and ease of use  (WAS: Who makes more ...)
Message-Id: <5iea5v$ujs@tracy.nacs.net>

Tim Behrendsen (tim@a-sis.com) wrote:
: Graham C. Hughes <graham.hughes@resnet.ucsb.edu>
: > Tim> Remember: The Sistine Chapel was a commissioned project.  Should
: > Tim> Michelangelo have done inferior work because he was getting paid
: > Tim> for it?
: > 
: > Would he have done inferior work if the Pope was standing over him the
: > entire time making ``suggestions'' and threatening him with
: > performance reviews?
: 
: He had "performance reviews" his entire career.  How do you think
: he *got* the project?

But he was never threatened with them. . . .

"Do this quickly. . .performance reviews are next month!"
I've heard that way too much. . .

** Heller

-- 
                     http://www.nacs.net/cgi-bin/heller/jokes              
                        http://www.nacs.net/~heller/
Corrupt, adj.: In politics, holding an office of trust or profit.
No, dear - smoke is SUPPOSED to come out...


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

Date: Tue, 08 Apr 1997 15:19:56 -0400
From: John Chambers <jc@buffie.mko.dec.com>
Subject: Why doesn't 5.003 pod2man work?
Message-Id: <334A9A5C.41C6@buffie.mko.dec.com>

Finally decided to add pod headers to a whole buncha scripts, C modules,
and so on.  When I fed them to pod2html, I got some good html (though
the =head1 lines seemed to shout a bit too loud).  However, everything
I fed to pod2man got the same error message:
   /usr/local/bin/pod2man: Invalid man page - no NAME line in foo.bar
where foo.bar was the input file, of course.  I did a lot of experiments
ending with taking a "real" man page (`man which` it was, to get a small
one without any trickiness), inserting "=head1 " before each of the
section thingies, and feeding that one to pod2man.  You'd think that
pod2man would accept as input the output of "man" so doctored, but no;
it told me:
   /usr/local/bin/pod2man: Invalid man page - no NAME line in which.pod

Has anyone actually gotten pod2man to work?  I'm rather baffled.  You'd
think that I'd be able to stumbumble onto as least *one* case that was
acceptable.  I poked around in pod2man with an editor, of course, and
was duly baffled by some of the coding, but didn't see any obvious
reasons
why it didn't work.  The pattern for the NAME line
(/^=head1\s+NAME\s*$/)
certainly looks like it oughta match, but even when I added a 'i' to the
end it didn't.

BTW, here's the start of the above which.pod file.  The pod2html script
likes it just fine, but pod2man insists there's no NAME line, which is
clearly a lie; I see it with my own little eyes, and it sure looks like
it matches the pattern (/^=head1\s+NAME\s*$/).  Any clues?


which(1)                                            which(1)

=head1 NAME
  which - Locates a program file including aliases and paths

=head1 SYNOPSIS
  which program ...

=head1 DESCRIPTION

  The which command takes a list of program names and looks for the
files
  that would be executed if these names were given as commands.

 ... and so on, to the line ...

=cut

   
-- 
<a href="http://eddie.mit.edu/~jc">Home page</a> of
<a href="mailto:jc@eddie.mit.edu">John Chambers</a>.
Geek Code (V3.0):
GCC/CM/CS/E/IT/MU/O/PA/S d+ s+ a++ C++ P+++ L+++ E--- W++ N++ K+++ w O-
M V- PS++ PE- Y+ PGP+ t- 5 X- R tv-- b++ DI++++ D- G- e+++ h--- r+++
y++++


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

Date: 8 Apr 1997 21:05:09 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Why doesn't 5.003 pod2man work?
Message-Id: <5iebu5$hc7$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, John Chambers <jc@buffie.mko.dec.com> writes:

:which(1)                                            which(1)

remove that line

:=head1 NAME
:  which - Locates a program file including aliases and paths

That should be two separate paragraphs:

=head1 NAME

which - Locates a program file including aliases and paths

:=head1 SYNOPSIS
:  which program ...

That one, also.

You could also look at existing man pages like perl.pod, you know.
Also, the pod2man man page should have been helpful.  Wasn't it?

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

    California is a fine place to live --if you happen to be an orange.
		    --Fred Allen


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

Date: Tue, 08 Apr 1997 14:11:40 -0600
From: buckinm@nfric.nesusa.com
Subject: Win32 and Tk
Message-Id: <860526482.7959@dejanews.com>

We have the Perl/Tk module up and running on our HPUX machines.  (Very,
Very, Very Cool).  Is there a Tk module in the works for Win32 Perl?

Thanks.

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


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

Date: 8 Apr 1997 18:31:09 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Win95 opendir()
Message-Id: <5ie2td$gu3@fridge-nf0.shore.net>

Mike Stok (mike@stok.co.uk) wrote:

: This seems completely stupid and spurious - the sequence \\ allows you to
: put a literal \ in a string and it's a legal character.  Perl doesn't

Well, it was a dedication to "stupid and spurious day" where everyone
prances around the yard aimlessly in paper hats and throwback fashion.

: accidentally re-interpolated to a newline character later.  \ and / both
: work as path separators in MS-DOS.

Granted, the "\\" method works, as in:
perl -e '$foo="C:\\nate\\text\\";print $foo,"\n";'

but ... there's absolutely no reason to do it like "\\" if it can be done 
like '/' or 'C:/'.  

: I would agree that "C:\\nate\\eek\\" has the two characher sequences \n
: and \e in it, but what's wrong with that?

Tom Christiansen has a document about this on http://www.perl.com.

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: 8 Apr 97 13:25:24 GMT
From: "Fredrik Lindberg" <flg@vhojd.skovde.se>
Subject: Re: Win95 opendir()
Message-Id: <01bc4420$a579dac0$e20f10c2@odens.di.vhojd.skovde.se>

Marcel Kuiper <Kuiper.Marcel@uniface.nl> wrote in article
<5id711$3f0@news.nl.compuware.com>...
> I've got a small problem with perl for Win32 build 304. When I try
> opendir(DIR,"\\"); 
> to open de root directory I got a message "no such file or directory"
> This worked well with bigperl 4.36. I can workaround it by:
> opendir(DIR,"\\SUBDIR\\..");
> but it looks like a small bug to me.

I got the same problem, but maybe a nicer workaround is

opendir(DIR, "/.") 

which should work on most (unixlike) system, and doesnt
require a subdirectory.

/Fredrik
 


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

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

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