[6371] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 993 Volume: 7

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Feb 22 21:07:12 1997

Date: Sat, 22 Feb 97 18:00:23 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 22 Feb 1997     Volume: 7 Number: 993

Today's topics:
     Re: [Q] Perl in win3.11? (Ric Harwood)
     Re: [Q] Perl in win3.11? (Ilya Zakharevich)
     Re: [Q] Perl in win3.11? (Ric Harwood)
     Re: [Q] removing lines in a file.. <tchrist@mox.perl.com>
     Camelrata <tom@geronimo.uit.no>
     Re: debugger question <billc@tibinc.com>
     Re: el porvenir di perl und java-script <tchrist@mox.perl.com>
     Re: for god sake (A. Deckers)
     Re: Getting positions in matched string <owt1@cornell.edu>
     Re: grep(/x/,@l) works but @l =~ m/x/g doesn't? (Tad McClellan)
     Re: grep(/x/,@l) works but @l =~ m/x/g doesn't? <billc@tibinc.com>
     Re: how to "free" a hash <tchrist@mox.perl.com>
     Re: HOW TO SPLIT A SIMPLE STRING <agriffis@calypso.coat.com>
     Opening a file to an exact location HELP?! (Paul J Tomsic)
     PATH and FILENAME question jmack@p3.net
     Re: PATH and FILENAME question (Tad McClellan)
     Re: Perl array passing <jander@jander.com>
     perl forking problem <s14237dc@umassd.edu>
     Re: perl help  ... dcon@eden.com
     Re: Perl not working as cgi on local server <hanklem@ibm.net>
     Re: Porting Perl from UNIX to NT <billp@muscatine.org>
     Re: really really Simple Question <hardtnf@nextwork.rose-hulman.edu>
     Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
     Re: Strange pack/unpack behavior <craig@lucent.com>
     syntax error (Maksym Panfilov)
     What happens if you use a -l switch without -[np]? <tom@geronimo.uit.no>
     Win95 can't always do this! ( Was: Re: Perl on Windows  <hanklem@ibm.net>
     Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)

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

Date: Sat, 22 Feb 1997 20:12:37 GMT
From: ric@discoveryinternational.com (Ric Harwood)
Subject: Re: [Q] Perl in win3.11?
Message-Id: <330f5115.18986913@news.demon.co.uk>

In comp.lang.perl.misc, on 19 Feb 1997 02:23:28 GMT
ilya@math.ohio-state.edu (Ilya Zakharevich), wrote:


>As I mentioned it in another post today, unless you install sh.exe
>from sh_dos.zip, and set PERL_SH_DIR according to the docs, you are
>not going to have backticks and pipes working.

I have not been able to find this, could I have a URL please?

[I'm still trying to get the emx+rsx]

TIA
Ric.

-- 
"Big whorls have little whorls that feed on their velocity, 
and little whorls have lesser whorls and so on to viscosity."
                                          -- L.F.Richardson
PGP id:0766ABE5  http://www.discoveryinternational.com/ric/


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

Date: 22 Feb 1997 20:55:05 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: [Q] Perl in win3.11?
Message-Id: <5enmf9$n4u$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Ric Harwood
<ric@discoveryinternational.com>],
who wrote in article <330f5115.18986913@news.demon.co.uk>:
> In comp.lang.perl.misc, on 19 Feb 1997 02:23:28 GMT
> ilya@math.ohio-state.edu (Ilya Zakharevich), wrote:
> 
> 
> >As I mentioned it in another post today, unless you install sh.exe
> >from sh_dos.zip, and set PERL_SH_DIR according to the docs, you are
> >not going to have backticks and pipes working.
> 
> I have not been able to find this, could I have a URL please?

Sorry, this is in README.os2 in newer Perls, but not in the older
binary release:

	ftp://ftp.math.ohio-state.edu/pub/users/ilya/os2/sh_dos.zip

> [I'm still trying to get the emx+rsx]

This _is_ in README.os2. Btw, a newer version of RSX is reported to
jump into existence. 

Ilya


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

Date: Sat, 22 Feb 1997 21:33:53 GMT
From: ric@discoveryinternational.com (Ric Harwood)
Subject: Re: [Q] Perl in win3.11?
Message-Id: <330f606e.22915424@news.demon.co.uk>

In comp.lang.perl.misc, on 18 Feb 1997 18:27:55 -0500 Dean Pentcheff
<dean@tbone.biol.sc.edu>, wrote:

>> "Big whorls have little whorls that feed on their velocity, 
>> and little whorls have lesser whorls and so on to viscosity."
>>                                           -- L.F.Richardson
>
>[As a biofluidmechanician, I heartily applaud your signature...]

Ta {:^)

>make is to make sure you get a Perl 5, not a Perl 4.  Perl 4 is

I now have most of perl5 as you described.

>Grab the port from CPAN.  Start at <URL:http://www.perl.com/perl> and

Found it on ftp.demon. Ta.   But does it have POSIX? I do *need* it
for acos, asin etc.

>                perl_aou.zip
>                perl_mlb.zip
>                perl_pod.zip
>                perl_ste.zip
>                perl_utl.zip
>                plREADME.zip

I have all those now.

>Make sure you have a decent unzip utility on DOS/Win.  One that works

I'm running winzip, which _seems_to do the job.

>Now unpack the zip files into appropriate directories.  To do that,

Done.

>Put the following in your autoexec.bat (carefully noting the slash
>directions in the text that follows):
>
>        set path=...your...existing...path...;c:\perl\bin
>        set perllib_prefix=f:/perllib c:/perl
>
>(I assume your perl destination is drive "c:", otherwise modify the
>"c:"s above appropriately, but don't change the "f:").

I have c:\bin\perl\ etc, therefore:
        set path=...your...existing...path...;c:\bin\perl\bin
        set perllib_prefix=f:/perllib c:/bin/perl

Is that correct?

>Now, based on addresses in Ilya's documentation, go out and grab the
>latest versions of the "emxrt" package and the "rsx" package.  Unpack

Having to use batch ftp for these.

Probably more later when I get that far.
Regards,
Ric.

-- 
"Big whorls have little whorls that feed on their velocity, 
and little whorls have lesser whorls and so on to viscosity."
                                          -- L.F.Richardson
PGP id:0766ABE5  http://www.discoveryinternational.com/ric/


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

Date: 23 Feb 1997 00:36:58 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: [Q] removing lines in a file..
Message-Id: <5eo3fa$9do$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    ecarter@a-lincoln.hnet.uci.edu (Eric D. Carter) writes:
:I want to remove a single line from a file.  So far, I have only been
:able to do this by opening an existing file, writing to a temp file 
:and renaming when I'm done.  Is it possible to simply open a file and
:remove a $_ (entire line..) without using a second file?  

No, this can't (really) be done.  Why is that people hate temporary files?
What is it about a simple text file that folks don't grok that it's not
like a stack of punch-cards one per line?  This is not a binary file with
a weird database format you know.  You can't do what you're talking about.

The most you could hope for is to read the whole file into memory,
make your changes to the in-core version, and then rewind, truncate,
and rewrite the same file.  This is a very dangerous thing, and you
shoudln't in general try it.  First of all, it doesn't leave a backup.
Secondly, it requires that you have enough memory for the whole file.

Bad idea in general.  See the -i flag, BTW.

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

San Francisco isn't what it used to be, and it never was.
                -- Herb Caen


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

Date: 23 Feb 1997 01:07:29 +0100
From: Tom Grydeland <tom@geronimo.uit.no>
Subject: Camelrata
Message-Id: <ofbbu9ce666.fsf@geronimo.uit.no>


I don't think these are in the official errata:

1) p. 77, table on top of page

 '.'  should have been '..'


2) why isn't the ... variant of the range operator mentioned in any of the
   operator tables, precedence tables or even in the index?
   
   A few days ago, I was thinking sed->perl, and seemed to remember a
   range operator '...', that worked like sed's ','.  When I tried looking
   for it in the camel book, I couldn't find it anywhere.  Nothing.
   I began to think my mind was playing tricks on me.
   I went to the manual pages armed with '/', and found it in the perlop
   manpage (as I hoped I would.  I'm too young to be senile) under '..'.
   And after that I *did* find it in the camel book.
 
   Now, to me, that seems like an awful lot of trouble to go through just
   to find an operator.  Will you at least mention it in the index if I
   say please?
 

--
//Tom Grydeland <tom@nospam.eiscat.no>   remove 'nospam.' to mail me


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

Date: Sat, 22 Feb 1997 17:46:28 -0500
From: Bill Cowan <billc@tibinc.com>
To: Mike Bartolone 5-4266 <bartolonem@med.ge.com>
Subject: Re: debugger question
Message-Id: <330F7744.4164@tibinc.com>

Mike Bartolone 5-4266 wrote:
> 
> If any of you use the built-in perl debugger, can you tell me if
> there is a command to list the current values of all of the currently
> defined variables?
> 
> --
> bartolonem@med.ge.com | 'Close eyes..Think tree...
> bartolon@execpc.com   | In your mind, make picture..
>                       | now open eyes..make like picture...'
>                       | paraphrased from 'The Karate Kid'

>From perldebug man page:

V package [symbols] 
     Display all (or some) variables in package (defaulting to the main
package) using a data pretty-printer (hashes show their keys and values
so you see what's what, control characters are made printable, etc.).
Make sure you don't put the type specifier (like $) there, just the
symbol names, like this: 

         V DB filename line 


X [symbols] 
     Same as as ``V'' command, but within the current package. 

-- Bill
-----------------------------------------------------------------------
Bill Cowan <billc@tibinc.com>    Voice:919-490-0034   Fax:919-490-0143
Tiburon, Inc./3333 Durham-Chapel Hill Blvd Suite E-100/Durham, NC 27707


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

Date: 22 Feb 1997 22:59:43 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: el porvenir di perl und java-script
Message-Id: <5entov$7ft$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    Varadarajan <tsv@gold.cs.umanitoba.ca> writes:
:For the benefit of people who dont understand this language, would a
:English translation be posted?? 

It's kinda hard to explain.  If you've read Umberto Eco's "Name of the
Rose", think of the character Salvatore and how he spoke.  It was 
kinda like that.  

Europeans should do ok with in if they look at it long enough.  I see
from your surname that you're probably not continentally educated, so I'll
decode it through eventually.  I'd prefer let others poke and peck at it a
few days to see whether they can decode it.  It's just to make our French
friend see what it's like to get an inscrutable posting, although given
its roots, I expect he'll actually be able to scrute it reasonably well.

Oh, and there's one bug: s/uma coise/uma coisa/.  One can construe
"coise" as well, but then "uma" would have to change number also.

Remind me to post my chthonic camel sentence sometime.

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

sv_magic(sv, Nullsv, 'B', Nullch, 0);     /* deep magic */
    --Larry Wall, from util.c in the v5.0 perl distribution


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

Date: 22 Feb 1997 21:50:54 GMT
From: Alain.Deckers@man.ac.uk (A. Deckers)
Subject: Re: for god sake
Message-Id: <slrn5guqhu.s73.Alain.Deckers@nessie.mcc.ac.uk>

In <uHfgcCASmZDzEw5M@c-a-t-s.demon.co.uk>,
	Tony Facey <C-A-T-S@c-a-t-s.demon.co.uk> wrote:
>Subject: for god sake

That's a seriously sucky Subject: line. ;-)

You might benefit from reading the periodic posting titled "Chosing good
Subject: lines".

>I have twice tried to download latest.tar.gz, While decompressing the
>file it freezes at aux_sh.
>I am using windows 95 and winzip to decompress the file..
>
>
>Am i doing somthing wrong?
>should i be downloading a diffrent file for windows 95?

If you plan to use it on Win95, the answer is an emphatic yes. Look in
the ./ports/win32 subdirectory of any CPAN mirror.

 <URL:http://www.perl.com/CPAN/>

HTH,
-- 
Alain.Deckers@man.ac.uk          <URL:http://www.man.ac.uk/%7Embzalgd/>


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

Date: 22 Feb 1997 13:18:21 -0500
From: Owen Taylor <owt1@cornell.edu>
Subject: Re: Getting positions in matched string
Message-Id: <lzybcgvh5e.fsf@cu-dialup-0819.cit.cornell.edu>

Owen Taylor <owt1@cornell.edu> writes:

Looks like I left out the punchline of the example. To make
things a bit clearer:

> Given a string representing a perl regex with inserted slashes,
>   
>     $pat = "((AB|AAB)/)*C/DD?"
> 
> and a string to match against,
> 
>     $str = "AABABCD"

The result I wanted was:

      "AAB/AB/C/D"

Sorry for any confusion this caused,
                                        Owen



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

Date: Sat, 22 Feb 1997 14:31:45 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: grep(/x/,@l) works but @l =~ m/x/g doesn't?
Message-Id: <h3lne5.4m.ln@localhost>

Kin Cho (kin@sampras.isi.com) wrote:
: Reading perlop, m//g should work like the UNIX grep.
  ^^^^^^^^^^^^^^

While managing to miss the section titled "Perl operators and precedence" ;-)


: Futhermore, it may also work faster than grep(//) since
: only 1 function is involved.
: However, I was disappointed that m//g does not seem to work at all:
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Perl is only doing what you _told_ it to do!


: @fns = ('a.c','b.C','c.cxx','d.H');
: @srclst = grep(/\w+\.(cxx|c|h)$/i,@fns);	# grep() works fine
: #@srclst = @fns =~ m/\w+\.(cxx|c|h)$/gi;	# also should work, but doesn't
: $out = join(' ',@srclst);
: print "$out\n";

: What gives?
  ^^^^^^^^^^

Operator precedence.



since pattern match binding (=~) is of higher precedence than assignment (=),

@srclst = @fns =~ m/\w+\.(cxx|c|h)$/gi; parses as:

@srclst = (@fns =~ m/\w+\.(cxx|c|h)$/gi);
          ^                            ^


(@srclst = @fns) =~ m/\w+\.(cxx|c|h)$/gi; parses as:
^              ^

seems to work just fine...



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


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

Date: Sat, 22 Feb 1997 18:22:12 -0500
From: Bill Cowan <billc@tibinc.com>
To: Kin Cho <kin@sampras.isi.com>
Subject: Re: grep(/x/,@l) works but @l =~ m/x/g doesn't?
Message-Id: <330F7FA4.35A8@tibinc.com>

Kin Cho wrote:
> 
> Reading perlop, m//g should work like the UNIX grep.
> Futhermore, it may also work faster than grep(//) since
> only 1 function is involved.
> However, I was disappointed that m//g does not seem to work at all:
> 
> @fns = ('a.c','b.C','c.cxx','d.H');
> @srclst = grep(/\w+\.(cxx|c|h)$/i,@fns);  # grep() works fine
> #@srclst = @fns =~ m/\w+\.(cxx|c|h)$/gi;  # should work, but doesn't
             ^^^^^^^

This should be scalar string for m// operation. (@fns may be treated in
scalar context for value of 4.)  You could do the something like the
following untested code (but this is logically same the grep()!):

foreach $item ( @fns ) {
	if ($item =~ m/\w+\.(cxx|c|h)$/gi) {
		push @srclst, $item;
	}
}


> $out = join(' ',@srclst);
> print "$out\n";
> 
> What gives?
> 
> -kin
> 
> --
> Kin Cho, Staff Engineer (408)542-1644 Fax (408)542-1958
> Integrated Systems Inc., 201 Moffett Park Drive, Sunnyvale, CA 94089
> http://www.isi.com
> 
> I'll procrastinate tomorrow
>                                 -- Garfield.

-- Bill
-----------------------------------------------------------------------
Bill Cowan <billc@tibinc.com>    Voice:919-490-0034   Fax:919-490-0143
Tiburon, Inc./3333 Durham-Chapel Hill Blvd Suite E-100/Durham, NC 27707


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

Date: 22 Feb 1997 19:22:56 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: how to "free" a hash
Message-Id: <5enh2g$35i$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    dupont@galois.unice.fr (Dupont Christophe) writes:
:I am trying to store a large amount of data in perl hashes.
:I would like to "free" the memory used by these hashes when I finish with  
:them (I'd like to see a decrease of VSIZE and RSIZE)

Can't be done.  The system never takes back memory.  The
best you can do is return it to the malloc() arena to 
do battle another day.

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

    "I can only bend the rules so much before it starts looking like I'm breaking
    the rules." --Larry Wall


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

Date: 23 Feb 1997 00:22:43 GMT
From: Aron Griffis <agriffis@calypso.coat.com>
Subject: Re: HOW TO SPLIT A SIMPLE STRING
Message-Id: <5eo2kj$l46@NEWS.unitel.co.kr>

> I have a a six character string,
> say 012345, that I want to split into three variables, $one, $two, $three
> that would then have 01, 23, 45.  The original string has no
> delimiters, though.
>
> What's the best way to do this?  It seems like an easy task, but I can't
> figure it out.

How about...

($s1, $s2, $s3) = (($longstring =~ /(..)(..)(..)/), ($1, $2, $3));

-Aron

]=====================-------------------->
| Aron Griffis
| Burlington Coat Factory - Network Group
| aron.griffis@coat.com
| http://www.css.tayloru.edu/~agriffis
]=====================-------------------->


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

Date: 23 Feb 1997 00:47:36 GMT
From: pjtst5+@pitt.edu (Paul J Tomsic)
Subject: Opening a file to an exact location HELP?!
Message-Id: <5eo438$83b@usenet.srv.cis.pitt.edu>

I'm having a hard time opening a file and inserting information into an
exact spot into that file..

I've got something like the following.....


$FILE = "myfile.txt";

 ....

$contents{'username'};


 .......



open(MYFILE, $FILE);
seek(MYFILE,0,0);
@lines = <MYFILE>;
push(@lines, "this is $contents{'username'};
close(MYFILE);


Now in MYFILE, I've got something like this......

<big-users>

this is dave
this is pete
this is mike

</big-users>

<little-users>

this is mark
this is wayne
this is pedro

</little-users>



I want to put that username in between those tags.  Like if 'username' 
was phil, then I'd want to put "this is phil" on a line by itself, in-between
the <big-users> tags.

Any help would be great...


Thanks

Paul Tomsic




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

Date: Sat, 22 Feb 1997 15:01:11 -0600
From: jmack@p3.net
Subject: PATH and FILENAME question
Message-Id: <856644866.30869@dejanews.com>

I'd like to capture the path and the filename of an HTML file that calls a
perl script.  I have a script that I'd like to do some command line
executions in the directory and on the file which called the perl script.
Instead of hardcoding this into the perl script (and limiting the
usefulness of the script to one file) I'd like to capture the directory in
which the file is located and which file called the script.  Are there
perl variables capture this info by default?  Do I need to pass these
parameter to the script HTML side?

Thank you for any assistance.

John Mack
jmack@p3.net

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


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

Date: Sat, 22 Feb 1997 18:19:46 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: PATH and FILENAME question
Message-Id: <2f2oe5.hh1.ln@localhost>

jmack@p3.net wrote:
: I'd like to capture the path and the filename of an HTML file that calls a
: perl script.  I have a script that I'd like to do some command line
: executions in the directory and on the file which called the perl script.
: Instead of hardcoding this into the perl script (and limiting the
: usefulness of the script to one file) I'd like to capture the directory in
: which the file is located and which file called the script.  


This is a question best asked in the CGI newsgroup:

comp.infosystems.www.authoring.cgi


: Are there
: perl variables capture this info by default?  

No. Perl is not hardwired into HTTP or anything. It is a general
purpose programming language.

Perl != CGI


: Do I need to pass these
: parameter to the script HTML side?

That's what I would do.


: Thank you for any assistance.

Hope that helped. You can likely get more help with CGI specific
questions by posting to the CGI specific newsgroup...


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


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

Date: 22 Feb 1997 13:05:15 -0500
From: Jim Anderson <jander@jander.com>
Subject: Re: Perl array passing
Message-Id: <k9o0ra1w.fsf@jander.com>

tadmc@flash.net (Tad McClellan) writes:

> 
> S_Stefanis@msn.com wrote:
> : Could someone post a clear example of passing an entire array
> :  into a subroutine for a rookie?
> 
> 
> --------------
> #! /usr/bin/perl -w
> 
> @ra = qw(one two three four five);
> 
> &rasub(@ra);
> 
> 
> sub rasub {
>    my(@arg_ra) = @_;
> 
>    foreach (@arg_ra) {print "$_\n"}
> }

Or, using a reference for efficiency:

@ra = qw(one two three four five);

&rasub(\@ra);

sub rasub {
   my $ref = @_;

   foreach (@$ref) {print "$_\n"}
}

-- 
Jim Anderson			jander@jander.com
PGP Public Key Fingerprint:	0A 1C BB 0A 65 E4 0F CD
				4C 40 B1 0A 9A 32 68 44


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

Date: Sat, 22 Feb 1997 14:12:14 -0500
From: "Derek A. Crovo" <s14237dc@umassd.edu>
Subject: perl forking problem
Message-Id: <330F450E.16ABF9B2@umassd.edu>

I've written a small perl program that does a rsh to a bunch of other
machines on a lan.  The way I do it now is:
$result = `rsh $host last | grep $ARGV[0] | head -n 1`;

I want all the rsh's to happen at the same time, so I don't have to wait
so long for the output.  I tried putting each rsh into child processes,
but it seems to fork off a child, and wait for it to complete before it
forks the next one.  Any ideas?  Here's what I tried and still got the
waits:

foreach $host ("host1", "host2", etc... ) {
    if( $pid = fork ) {
	# Parent
	wait;
	exit(0);
    } elsif( defined $pid ) {
	$result = `rsh $host last | grep $ARGV[0] | head -n 1`;
	if( $result ) {
	    $result = substr( $result, 40 );
	    chop( $result );
	} else {
	    $result = "Never logged in."
	    }
	print "$host:   \t$result\n";
	exit(0);
    }
}

I think the problem is that perl waits for anything in backticks (or in
a system() call) to finish before it goes on.  But I have no idea how to
fix it.

Thanks in advance,
Derek Crovo


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

Date: Sat, 22 Feb 1997 20:02:12 GMT
From: dcon@eden.com
Subject: Re: perl help  ...
Message-Id: <330bdac4.37489613@news.eden.com>




Ohhhh.  do this:
(...perl purists will undoubtedly smash this with a one liner)

while(<>){
	$inside++ if (/^\.subckt pdp/);
	$inside=0 if (/^\.ends subckt/);
	s/^xm3/xm5/ if ($inside);
}



Of course, you'll have to open the file to write, and file to read...

-Doug Conley   - dcon@eden.com

>	I just want to replace the all "xm3" found in sub circuit
>pdp...something and change it to xm5. So I need a perl to match
>expression subckt pdp and begin replace operation until I come across
>a ends subckt. 
>
>thanks




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

Date: Sat, 22 Feb 1997 17:05:27 -0700
From: Hank LeMieux <hanklem@ibm.net>
To: bgraham@bgraham.com
Subject: Re: Perl not working as cgi on local server
Message-Id: <330F89C7.78DA@ibm.net>

Bo,

This is a simple problem to fix.  If you try to open the script directly
with Netscape, it WILL open a perl command window and execute the script
if you will tell Netscape that perl.exe is the helper application for
 .pl files (this is accomplished through the Netscape options menu).

However, that is not very useful, because you're not going to have
visitors to your web site see the script execute in a command window. 
So what you have to do is create an HTML file that calls the script (as
in <FORM ACTION="cgi-bin/yourscritpt.pl" METHOD="GET">) and have that
HTML file hosted on a cgi-capable server (which can be local on your
machine, if you wish).  Then point Netscape to that HTML file and the
script will be handled as a CGI and execute correctly.

Good Luck,

Hank

Bo Graham wrote:
> 
> Hello,
> 
> I have set up perl5 on my NT and am using Peer Web Service.  Perl runs
> fine under cmd.exe but when I put hello.pl in my cgi-bin and type in
> http://localhost/cgi-bin/hello.pl I get the "file save menu" in
> netscape.  This happens even though I have set applications/x-perl to
> run ../perl5/perl.exe
> 
> If I type hello.pl at the command line the program runs as expected.
> 
> What can I do to make this work?  I feel like I tried everything.
> 
> Thanks
> Bo Graham
> bgraham@bgraham.com
> http://bgraham.com

-- 

Hank LeMieux
Freelance Web Design/JavaScript/CGI
Santa Fe, NM, USA
(505) 986-8166
http://members.aol.com/HankWeb/




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

Date: Sat, 22 Feb 1997 14:14:47 -0600
From: Rubi Inc <billp@muscatine.org>
Subject: Re: Porting Perl from UNIX to NT
Message-Id: <330F53B4.22BD@muscatine.org>

I just got a book called CrossPlatform Perl for UNIX and Windows NT. by
Eric F.Johnson. Published M&T Books. It was $35 bucks at the University
Bookstore and includes a CD with Perl for Windows NT.

Since I just started looking at Perl, I can't say much about it other
than it looks pretty good.

Bill Parks


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

Date: Sat, 22 Feb 1997 18:00:07 -0500
From: Nathanael F Hardt <hardtnf@nextwork.rose-hulman.edu>
Subject: Re: really really Simple Question
Message-Id: <330F7A77.669F@nextwork.rose-hulman.edu>

Evan Wise wrote:
> 
> Howdy, this is a little problem I am having with a PERL script I am doing right
> now. It is a little matter of just not matching the correct text and it is
> driving me up the wall. There probably exists a really simple solution to this
> that I am just blind to it after staring at this too long.
> 
> here is the line that I am trying to search and replace :
> 
> <!--- e3 ---><TD bgcolor = 00,00,00><image border = 0 src = blacksq.gif></TD>
> 

> I am trying to replace the blacksq.gif (not always blacksq.gif can be other
>  .gif files...) with some other text.  I just cant get the proper replace
> line.....!

I'm not sure if I understand your situation, but I assume that you have
a web doc that you want to dynamically change by running it through
a perl script. if so:
why don't you change blacksq.gif with fill-me.gif or something like
that. then you just have to pattern match the fill-me.gif and 
sbustite it with your data.

Nate


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

Date: 22 Feb 1997 19:31:19 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <5enhi7$6v2@info.uah.edu>

Following is a summary of articles spanning a 7 day period,
beginning at 14 Feb 1997 19:23:49 GMT and ending at
22 Feb 1997 07:27:07 GMT.

Notes
=====

    - A line in the body of a post is considered to be original if it
      does *not* match the regular expression /^(>|:|\S+>)/.
    - All text after the last cut line (/^-- $/) in the body is
      considered to be the author's signature.
    - The scanner prefers the Reply-To: header over the From: header
      in determining the "real" e-mail address and name.

Totals
======

Total number of posters:  483
Total number of articles: 995
Total number of threads:  436
Total volume generated:   1693.1 kb
    - headers:    621.7 kb
    - bodies:     995.0 kb (757.4 kb original)
    - signatures: 74.0 kb

Averages
========

Number of posts per poster: 2.1
Number of posts per thread: 2.3
Message size: 1742.5 bytes
    - header:     639.9 bytes
    - body:       1024.0 bytes (779.5 bytes original)
    - signatures: 76.2 bytes

Top 10 Posters by Number of Posts
=================================

         (kb)   (kb)  (kb)  (kb)
Posts  Volume (  hdr/ body/ orig)  Address
-----  --------------------------  -------

   40    71.7 ( 23.5/ 48.2/ 26.6)  Tad McClellan <tadmc@flash.net>
   39    42.3 ( 21.6/ 20.7/ 14.9)  Nathan V. Patwardhan <nvp@shore.net>
   34    57.0 ( 20.5/ 28.9/ 18.2)  Dave@Thomases.com
   24    37.4 ( 13.2/ 24.2/ 13.4)  Honza Pazdziora <adelton@fi.muni.cz>
   20    46.1 ( 15.3/ 23.3/ 15.3)  Randal Schwartz <merlyn@stonehenge.com>
   19    67.7 ( 14.5/ 50.0/ 41.3)  Tom Christiansen <tchrist@mox.perl.com>
   16    26.1 ( 12.3/ 13.8/ 10.3)  Tom Phoenix <rootbeer@teleport.com>
   16    16.6 (  9.7/  5.9/  3.2)  Jesse Glick <jesse@ginger.sig.bsh.com>
   13    23.8 (  7.5/ 12.2/  8.7)  mike@stok.co.uk
   11    15.4 (  5.9/  8.0/  8.0)  Brian L. Matthews <blm@halcyon.com>

Top 10 Posters by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Address
--------------------------  -----  -------

  71.7 ( 23.5/ 48.2/ 26.6)     40  Tad McClellan <tadmc@flash.net>
  67.7 ( 14.5/ 50.0/ 41.3)     19  Tom Christiansen <tchrist@mox.perl.com>
  57.0 ( 20.5/ 28.9/ 18.2)     34  Dave@Thomases.com
  46.1 ( 15.3/ 23.3/ 15.3)     20  Randal Schwartz <merlyn@stonehenge.com>
  42.3 ( 21.6/ 20.7/ 14.9)     39  Nathan V. Patwardhan <nvp@shore.net>
  37.4 ( 13.2/ 24.2/ 13.4)     24  Honza Pazdziora <adelton@fi.muni.cz>
  36.8 (  0.5/ 36.3/ 36.2)      1  Steven Katz <skatz@waite.mcp.com>
  29.2 (  1.4/ 27.8/ 27.0)      2  Brian Ewins <Brian.Ewins@gssec.bt.co.uk>
  26.1 ( 12.3/ 13.8/ 10.3)     16  Tom Phoenix <rootbeer@teleport.com>
  23.8 (  7.5/ 12.2/  8.7)     13  mike@stok.co.uk

Top 10 Threads by Number of Posts
=================================

Posts  Subject
-----  -------

   18  Pig Latin
   12  difference btw s/// & tr///
   11  PROGRAM: how to check for nice/valid email address
   11  regexp's in XEmacs vs. Perl
   11  Regexp to do minimal email validation
   10  Need help for 2 easy PERL questions, please
   10  debugging perl & html
    9  efficiency of many fixed strings vs one regex
    9  Class library to make C++ more Perlish?
    8  Perl on Windows 95

Top 10 Threads by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Subject
--------------------------  -----  -------

  36.8 (  0.5/ 36.3/ 36.2)      1  IN THE ZONE February 1997 - Vol. 2, No. 2
  30.2 ( 11.6/ 16.8/ 11.3)     18  Pig Latin
  28.0 (  7.1/ 19.9/ 14.6)     11  Regexp to do minimal email validation
  27.6 (  0.8/ 26.8/ 26.3)      1  REMOTE DEBUGGER was Re: debugging perl & html
  27.4 (  7.5/ 18.7/ 14.9)     11  PROGRAM: how to check for nice/valid email address
  23.0 (  5.8/ 16.6/ 14.3)     10  Need help for 2 easy PERL questions, please
  22.4 (  7.1/ 13.9/  9.1)      9  Class library to make C++ more Perlish?
  20.5 ( 11.7/  6.9/  4.0)     11  regexp's in XEmacs vs. Perl
  18.9 (  0.5/ 18.3/ 17.9)      1  Perl-Users Digest, Issue: 968 Volume: 7
  18.3 (  5.9/ 11.9/  8.9)     10  debugging perl & html

Top 10 Targets for Crossposts
=============================

Articles  Newsgroup
--------  ---------

      30  comp.lang.perl.modules
      18  comp.lang.perl
      12  comp.lang.perl.tk
      11  comp.emacs.xemacs
      10  comp.lang.c++
       8  comp.databases
       6  comp.os.linux.misc
       5  comp.mail.sendmail
       5  comp.mail.misc
       5  de.comp.os.sinix

Top 10 Crossposters
===================

Articles  Address
--------  -------

      15  Markus Fleck <fleck@informatik.uni-bonn.de>
       5  Bryan O'Sullivan <bos@serpentine.com>
       5  Hans Schrader <hans.schrader@geol.uib.no>
       4  Henry Whyte <hwhyte@translation-plus.co.uk>
       4  Tom Christiansen <tchrist@mox.perl.com>
       4  Anne Hilllebrand <annehillebrand@worldnet.att.net>
       4  Randal Schwartz <merlyn@stonehenge.com>
       3  Chris Schoenfeld <chris@ixlabs.com>
       3  David Richards <dr@ripco.com>
       3  Chris Nandor <pudge@pobox.com>


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

Date: Sat, 22 Feb 1997 12:52:56 -0600
From: Craig Votava <craig@lucent.com>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Strange pack/unpack behavior
Message-Id: <330F4088.41C6@lucent.com>

Tom Phoenix wrote:
> 
> On Fri, 21 Feb 1997, Craig Votava wrote:
> 
> > perl -e 'print "ret=", unpack("H1",pack("B2","10")), "\n";'
> >
> > The returned value is 8, the correct value is 2.
> 
> When you say 'pack("B2", "10")', you're asking perl to return to you a bit
> vector with the first two bits set to 1 and 0. When you ask to unpack with
> "H1", you're asking to unpack four bits, so two extra (zero) bits are
> added, to fill the gap. So, unpack is working on binary 1000, and gets 8.

I wonder if it might be better for unpack to assume it should prepend
any needed fill zeros, instead of appending them. If there are cases to
be made for doing both, maybe the user could be allowed to specify?

In the mean time, here's how I thought to solve the problem, any
suggested improvements would be appreciated!

        $xbits = "0001011";

        # Prepend 0's to fill out to a nibble boundary (if needed)...
        if(length($xbits)%4) {
                $xbits = "0" x (4 - (length($xbits)%4)) . $xbits;
        }

Thanks!

-Craig

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


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

Date: 22 Feb 1997 20:09:16 GMT
From: mpanfilo@newstand.syr.edu (Maksym Panfilov)
Subject: syntax error
Message-Id: <5enjpc$qh0@newstand.syr.edu>

I just could not come up with that simple suyntax error problem. Perl
says: syntax error in file cg.cgi at line 30, next 2 tokens "]["

But I don't get what's wrong with that line.
Line 30 is: $grade[$j][$quiz] = $score;
And here is a part of the program with that line.

I will really appreciate any help. Thanks in advance.

Please, reply to my e-mail: mpanfilo@syr.edu
Max.

---------------------------------------
open(GRADES,$grades_file_) || die;
while(<GRADES>) {
        ($id, $quiz, $score) = split(/\ /);
        $j = 0;
        while ($j < $count) {
                if ($netid[$j] eq $id) { last; }
                $j++;
        }
        $grade[$j][$quiz] = $score;
}
close GRADES;
--------------------------------------


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

Date: 23 Feb 1997 01:04:38 +0100
From: Tom Grydeland <tom@geronimo.uit.no>
Subject: What happens if you use a -l switch without -[np]?
Message-Id: <ofbd8tse6ax.fsf@geronimo.uit.no>


I was garbage collecting my head, and recalled a discussion from a
while back whether you needed

while (defined($a = <>))

instead of simply

while ($a = <>)

(The camel books (and perlsyn man page) use the latter.)

Before finding the answer to that particular question on DejaNews, I
had gotten myself into some speculations on what kind of input could
blow up the shorter form prematurely.

As the camels say, perl doesn't chomp off your record separator, so
even empty fields will contain a "\n", and will be true.  The problem
was with records(lines) containing a single "0".  Now, "0\n" is true,
so the input lines have to be chomped for that to be true, right?

Well, the -l flag tells perl to chomp off the record separator.  A
perl script with -l and a while ($a = <>) loop could surely break on a
line with a single "0", or what?

well, watch the following: (the '%' is the shell prompt in all cases)

% tryme tryme 
'#!/usr/local/bin/perl -wl

while ($a = <>) {
    print "'$a'";
}

__END'D'__
0

D'D'o we ever see this line?

'D% 

And if I remove the __END__ and everything following it, I get

% tryme tryme 
'#!/usr/local/bin/perl -wl

while ($a = <>) {
    print "'$a'";
}

'A% 

I know for sure that I don't understand what's happening here.

I would expect the -l flag to set $\ = $/ == "\n", and that I would
get every single line sans newline in $a.  I'd also expect them to be
printed out surrounded by single quotes and every line terminated with
a newline.  That's obviously not happening.  And where do those 'D's
and 'A's come from?

running perl -lwde 1 into the debugger and dumping the symbol table
with 'V %::' gives me (together with screenfulls of other variables)

$\ = ''

$/ = '
'

What did I miss?

--
//Tom Grydeland <tom@nospam.eiscat.no>  remove 'nospam.' to mail me


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

Date: Sat, 22 Feb 1997 16:58:24 -0700
From: Hank LeMieux <hanklem@ibm.net>
To: Paul Delys <paul@gi.alaska.edu>
Subject: Win95 can't always do this! ( Was: Re: Perl on Windows 95)
Message-Id: <330F8820.6F48@ibm.net>

The subject is whether you can test your perl/CGI scripts by setting up
a local server on Win95.

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
perl script that uses BLAT to email the results of a form submission. 
You can get this script to work from the command line, BLAT included. 
But if you go into your browser and access an HTML page on your local
server, and that page calls the cgi script, BLAT will fail to open a
port to send the mail.

So keep this in mind.  It will save you hours of debugfrustration.

Hank
-- 

Hank LeMieux
Freelance Web Design/JavaScript/CGI
Santa Fe, NM, USA
(505) 986-8166
http://members.aol.com/HankWeb/




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

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 V7 Issue 993
*************************************

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