[8423] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2040 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Mar 6 08:18:04 1998

Date: Fri, 6 Mar 98 05:01:14 -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           Fri, 6 Mar 1998     Volume: 8 Number: 2040

Today's topics:
    Re: $0: which OSes? (O'Shaughnessy Evans)
    Re: $0: which OSes? <zenin@best.com>
        ANNOUNCE: Math::MagicSquare 1.00 module <pivari@geocities.com>
        Calling a Perl Script via a hyperlink <adam@pacific-artists.demon.co.uk>
    Re: Calling a Perl Script via a hyperlink <etmgero@etm.ericsson.se>
    Re: Calling a Perl Script via a hyperlink <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: Connecting to a Database with Perl <akil1@mindspring.com>
        How to double sort a hash of hashes???? <aahanson@students.uiuc.edu>
        How to get list of 'my' variables? (Andrew Arensburger)
    Re: How to get list of 'my' variables? <tchrist@mox.perl.com>
    Re: Length of an array? (David Waring)
    Re: Newbie's question about package <dformosa@st.nepean.uws.edu.au>
    Re: Passing Formats? <ebohlman@netcom.com>
    Re: passing wildcard file args to NT perl script (Martin Vorlaender)
    Re: passing wildcard file args to NT perl script (Gurusamy Sarathy)
    Re: Perl Script count lines of c/c++ code <raconway@atos-group.com>
    Re: Problem with "goto" in Perl <dformosa@st.nepean.uws.edu.au>
        Problems compiling perl 5.004_04 on Unixware - seeking  <sr@pc-plus.de>
    Re: Question for Tom Christiansen <dformosa@st.nepean.uws.edu.au>
    Re: QUIZ: answer and hash slice tutorial <dformosa@st.nepean.uws.edu.au>
    Re: Running a perl script on Windows 95 <adam@pacific-artists.demon.co.uk>
    Re: Script for RTrimming Fields <dformosa@st.nepean.uws.edu.au>
    Re: sockets to webservers (Kaj Hejer)
    Re: sockets to webservers <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: sockets to webservers (Kaj Hejer)
        Sort a hash table by it's values <alexs@online.emap.com>
    Re: Summing Up Array Values - How Do I? <dformosa@st.nepean.uws.edu.au>
    Re: Two questions about POD (M.J.T. Guy)
        Using pod2html.pl on Win32 <rthorne@netscape.com>
    Re: Using strings as filehandles (M.J.T. Guy)
    Re: What is PERL? Learn JAVA instead? (Bart Lateur)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 6 Mar 1998 07:38:04 GMT
From: shaug@gromit.callamer.com (O'Shaughnessy Evans)
Subject: Re: $0: which OSes?
Message-Id: <6do94s$84t$1@ha1.rdc1.occa.home.com>

In article <34ffaf37.41141913@news.gate.net>, Michael Kelly <mkelly99@NOSPAMgate.net>'s keyboard spewed forth
thus:
>On Wed, 04 Mar 1998 11:58:08 GMT, Bill Jones
><webmaster@fccjmail.fccj.cc.fl.us> wrote:
>
>>Very interesting.
>>Maybe on Solaris the $0 become a local assignment
>>and does not propagate?
>
>Perhaps the /proc filesystem Linux uses is the link between the
>app, $0 and ps?  Just a wild guess as I believe /proc is unique
>to Linux.

:r! uname -rsp
SunOS 5.5.1 sparc

:r! ls -ld /proc
dr-xr-xr-x   2 root     root       16064 Mar  5 23:32 /proc
-- 
- O'Shaughnessy Evans
- http://www.callamerica.net/shaug/


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

Date: 6 Mar 1998 12:42:31 GMT
From: Zenin <zenin@best.com>
Subject: Re: $0: which OSes?
Message-Id: <889188486.820152@thrush.omix.com>

O'Shaughnessy Evans <shaug@gromit.callamer.com> wrote:
: In article <34ffaf37.41141913@news.gate.net>, Michael Kelly <mkelly99@NOSPAMgate.net>'s keyboard spewed forth  thus:
	>snip<
: >Perhaps the /proc filesystem Linux uses is the link between the
: >app, $0 and ps?  Just a wild guess as I believe /proc is unique
: >to Linux.
:
: :r! uname -rsp
: SunOS 5.5.1 sparc
:
: :r! ls -ld /proc
: dr-xr-xr-x   2 root     root       16064 Mar  5 23:32 /proc

	byron@thrush $ uname -rs 
	FreeBSD 2.2.5-STABLE
	(/usr/home/byron)
	byron@thrush $ ls -ld /proc
	dr-xr-xr-x  78 root  wheel  512 Mar  6 04:45 /proc
	(/usr/home/byron)
	byron@thrush $ 

	Almost everyone has it, but the exact formats are different.

-- 
-Zenin
 zenin@best.com


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

Date: Fri, 06 Mar 1998 10:50:21 +0000
From: Fabrizio Pivari <pivari@geocities.com>
Subject: ANNOUNCE: Math::MagicSquare 1.00 module
Message-Id: <34FFD4ED.C57025F6@geocities.com>

What is Math::MagicSquare module?
The first purpose of this PERL module is to help you to check your
Square, to answer these questions
Is it a Semimagic Square?
Is it a Magic Square?

The second purpose of this PERL module is to help you to print your
Square.
At the moment the method available is 'print' that prints the square on
STDOUT.
I'd like to add
- printhtml (to print the square in HTML format)
- pringif     (to print the square in a GIF image)
- prinpdf   (to print the square in PDF format)

What is a Magic Square?
Do you like Magic Square?
Do you want to know more information about Magic Square?
Try to visit

A very good introduction on Magic Square
http://www.astro.virginia.edu/~eww6n/math/MagicSquare.html

A whole collection of links and documents in Internet
http://www.pse.che.tohoku.ac.jp/~msuzuki/MagicSquare.html

A good collection of strange Magic Square
http://www.geocities.com/CapeCanaveral/Lab/3469/examples.html

The only Magic Square checker and gif maker in Internet (I think)
http://www.geocities.com/CapeCanaveral/Lab/3469/squaremaker.html

Where can I find it?
http://www.geocities.com/CapeCanaveral/Lab/3469/Math-MagicSquare.html
is the primary location
You also can find it at CPAN archive

Enjoy it!

Send me your suggestions.

--
Fabrizio Pivari
mailto:pivari@geocities.com
http://www.geocities.com/CapeCanaveral/Lab/3469/
Member of ANFACE Software
http://www.geocities.com/CapeCanaveral/Hangar/4794/





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

Date: Fri, 6 Mar 1998 12:08:21 -0000
From: "Adam Carden" <adam@pacific-artists.demon.co.uk>
Subject: Calling a Perl Script via a hyperlink
Message-Id: <889186262.4138.0.nnrp-01.c2de97e4@news.demon.co.uk>

Please do not have a go at me, I think the answer to my question is going to
be very simple.
However I cannot find the answer below.

If you think this question is silly, is in the wrong group etc etc. Please
do not e-mail telling me this I will only be posting this the "ONCE".

My question is:
I have a database search script which searches a tab delimited text file,
The user enters the data on a form then presses the submit button and the
data is sent by "POST". However I would like yo call the script from a url.
e.g.
http://www.nightflightinternational.co.uk/cgi-bin/product-search.cgi?action=
search&Keywords=access

Can anyone help? (Answers by e-mail appreciated)

Adam Carden
adam@pacific-artists.demon.co.uk




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

Date: Fri, 06 Mar 1998 13:22:44 +0100
From: Geert Roovers <etmgero@etm.ericsson.se>
Subject: Re: Calling a Perl Script via a hyperlink
Message-Id: <34FFEA94.6767@etm.ericsson.se>

Adam Carden wrote:
> 
> Please do not have a go at me, I think the answer to my question is going to
> be very simple.
> However I cannot find the answer below.
> 
> If you think this question is silly, is in the wrong group etc etc. Please
> do not e-mail telling me this I will only be posting this the "ONCE".
> 
> My question is:
> I have a database search script which searches a tab delimited text file,
> The user enters the data on a form then presses the submit button and the
> data is sent by "POST". However I would like yo call the script from a url.
> e.g.
> http://www.nightflightinternational.co.uk/cgi-bin/product-search.cgi?action=
> search&Keywords=access
> 
> Can anyone help? (Answers by e-mail appreciated)
> 
> Adam Carden
> adam@pacific-artists.demon.co.uk

Hi,

Ehhhm... well, isn't that the way to do it then? Only, you have to get
the info via the environment variabele QUERY_STRING, but there arte
CGI-scripts to do that, well... about everywhere I guess... More info
can be found here, but I don't know if they have the script code
available:

http://hoohoo.ncsa.uiuc.edu/cgi/env.html

~Geert


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

Date: 06 Mar 1998 13:27:59 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
To: adam@pacific-artists.demon.co.uk
Subject: Re: Calling a Perl Script via a hyperlink
Message-Id: <7x90qoxauo.fsf@beavis.vcpc.univie.ac.at>

Re: Calling a Perl Script via a hyperlink, Adam
<adam@pacific-artists.demon.co.uk> said:

Adam> My question is: I have a database search script which
Adam> searches a tab delimited text file, The user enters
Adam> the data on a form then presses the submit button and
Adam> the data is sent by "POST". However I would like yo
Adam> call the script from a url.  e.g.

So you want to use GET as well as POST.  Which software are
you using to grab the CGI input?  If you use CGI.pm then
you're laughing because it is trivial to handle both GET and
POST.

    perldoc CGI

hth
tony

-- 
Tony Curtis, Systems Manager, VCPC,      | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, AT | http://www.vcpc.univie.ac.at/

"Everything I am, I learned on the back of cereal boxes" ~ RJ, "Over the Hedge"


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

Date: Fri, 6 Mar 1998 06:50:14 -0500
From: "Kevin Bass" <akil1@mindspring.com>
Subject: Re: Connecting to a Database with Perl
Message-Id: <6doo35$chv@camel18.mindspring.com>

Aditya Mishra:

The FAQ has been read and the method(s) used to connect to the database
using Perl do(es) not work on my system.  In computer programming within any
language, there are alternative methods to perform a task.  Books and FAQ
newletters are a start but not always a solution to learning.  Learning
methods and technics from persons within the field is the best method of
learning (when backed up by reviewing the information that a person is
looking).  It's called respect for experience!!

Get going!!

Kevin



Mishra, Aditya wrote in message <6dng6e$2gd0@ljcqs003.cnf.com>...
>This question has been asked a million times here.
>
>If you read the FAQ you would not ask this question...
>
>Get DBI.(www.perl.com/CPAN-local/modules/by-module/DBI)
>Get Oracle DBD (www.perl.com/CPAN-local/modules/by-module/DBD/)
>
>get going!
>
>Adi
>
>




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

Date: Fri, 06 Mar 1998 06:02:45 -0600
From: Aaron Hanson <aahanson@students.uiuc.edu>
Subject: How to double sort a hash of hashes????
Message-Id: <34FFE5E5.3D5F@students.uiuc.edu>

Hi all.  I am in dire need of a solution to my problem.  I have a hash
of hashes in this one program, and I want to sort the hash by one
variable, and then by another.  I had tried this:

foreach $var (sort 
	{$data{$b}{$key1} <=> $data{$a}{$key1}}
	(sort
		{$data{$b}{$key2} <=> $data{$a}{$key2}}
		keys %data)) {
print $var;
}

I did this in hopes of sorting the hash by greatest $key1, and any ties
settled by the sort of $key2.  Why did this not work?  Is there any way
of double sorting?  It seems to sort by $key2, and then forget that
sort, and move on to sort by $key1.  Is there a way to get it to
remember its first sort (the sort of $key2)???  Please email me if you
can help me...

Aaron Hanson
aahanson@students.uiuc.edu


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

Date: 6 Mar 1998 06:30:12 GMT
From: arensb@umiacs.umd.edu (Andrew Arensburger)
Subject: How to get list of 'my' variables?
Message-Id: <6do55k$mra$2@walter.cs.umd.edu>

	If I have a function name (as returned by "caller", for
example), is it possible to get a list of that function's "my" and
"local" variables, and their values?

	Thanks,

-- 
Andrew Arensburger, Systems guy		Center for Automation Research
arensb@cfar.umd.edu			University of Maryland
Federal Expresso:  When you absolutely, positively have to stay up all night.


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

Date: 6 Mar 1998 12:09:31 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to get list of 'my' variables?
Message-Id: <6dop1r$q8a$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    arensb@umiacs.umd.edu (Andrew Arensburger) writes:
:	If I have a function name (as returned by "caller", for
:example), is it possible to get a list of that function's "my" and
:"local" variables, and their values?

No.  

Functions don't get "local" variables by using local().  They're actually
globals except in cases too esoteric to contemplate.  You can find what
globals exist in a symbol table, but that doesn't help with knowing
whether local() was called on them.  And "my" variables aren't in the
symbol table at all, so you can't find them.

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


Sometimes when you fill a vacuum, it still sucks.   --Rob Pike


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

Date: 6 Mar 1998 07:46:03 GMT
From: dwaring@nwsr.com (David Waring)
Subject: Re: Length of an array?
Message-Id: <dwaring-0503982347310001@blv-lx103-ip33.nwnexus.net>

Keith L. Miller wrote:
> 
> If I have a string stored in $_ and I split it into an array, how can I
> know what the length of the array (how many fields there are in the
> array)?

In article <34FF0EE8.6DE905A8@prilnari.com>, Steve Wells
<steve@prilnari.com> wrote:

> You should read the FAQ but since this is so easy...
> 
> $length = @fields; 
> 
It is interesting how many people say read the FAQ in response to
questions that are not in the FAQ. Yes this question is covered in the
books but I could not find it in the FAQ.

David

******************************
*  
*  David Waring
*  Freelance Web Developer
*  HTML, Perl/CGI, Graphics etc.
*  dwaring@nwsr.com
*  http://www.nwsr.com
*  
******************************


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

Date: 6 Mar 1998 10:16:48 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: Newbie's question about package
Message-Id: <889179408.134521@cabal>

In <6dmfpj$qho$1@nnrp1.dejanews.com> xrfang@technologist.com writes:

[...]

>At first, I think perl modules are quiet similar to Turbo pascal's unit (As
>far as I don't use oop).  But there're still some thing that I got confused:

>1. Is @ISA used only in oop or not? I wrote a simple module and if I do not
>write @ISA=qw(Exporter) all my fuctions are not usable. Why?

Well thay are useable but not directly.  The functions are limmited to the
moduls name space.  Its like haveing a unit with nothing in the interface
section.

>2. Why should I use "qw"? can I use @EXPORT=(suba,subb,subc...)???

Because perl will try to guess what suba is and may not get it right.  If
you wish to do it write you would have to do

@EXPORT=('suba','subb','subc',...)

qw is more convent.

>3. Many other questions (may be silly ones), the most important is, where to
>find document for such things as @ISA, @EXPORT, @EXPORT_OK etc. Especially
>that I read from the perltoot or other man pages that there's a "Exporter" man
>page and a "AutoLoader" man page, but when I typed man Exporter, the system
>said no such man pages.  Where to find them???

On my system /usr/lib/perl5/man/man3/Exporter.3  your sysadmin may have
not set up the defult man path correctly.  Try using 'locate' to find the
location of the man pages and adding that path to your MANPATH.

--
Please excuse my spelling as I suffer from agraphia see the url in my header. 
Never trust a country with more peaple then sheep. 
Support NoCeM http://www.cm.org/                   
I'm sorry but I just don't consider 'because its yucky' a convincing argument


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

Date: Fri, 6 Mar 1998 06:41:31 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Passing Formats?
Message-Id: <ebohlmanEpDx97.7Eq@netcom.com>

Dave Hightower <hightowr@usa.net> wrote:
: So, off I went, and created a text file "formats" in which it only
: contains format definitions.  No package name, no exporter, nothing like
: that.

: So how do I get my module to read the format?  Is there any way to get
: perl to just take a file and paste it in-place, much like an #include
: directive?

perldoc -f require



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

Date: Fri, 06 Mar 1998 05:52:00 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: passing wildcard file args to NT perl script
Message-Id: <34ff80f0.524144494f47414741@radiogaga.harz.de>

jason@dtlweb.com wrote:
: Is there a solution to the doublequote problem, or am I better off just
: setting my PERL5OPT variable and remembering to turn it off when I run into
: trouble?

You can as well do it the other way around: Don't set PERL5OPT, and add the
switch '-MWild' to your command line when you need to glob arguments.

cu,
  Martin
--
                          | Martin Vorlaender | VMS & WNT programmer
 Ceterum censeo           | work: mv@pdv-systeme.de
 Redmondem delendam esse. |       http://www.pdv-systeme.de/users/martinv/
                          | home: martin@radiogaga.harz.de


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

Date: 6 Mar 1998 06:26:23 GMT
From: gsar@engin.umich.edu (Gurusamy Sarathy)
Subject: Re: passing wildcard file args to NT perl script
Message-Id: <6do4uf$5hu@srvr1.engin.umich.edu>

  [ mailed and posted ]

In article <6dnf8h$15$1@nnrp1.dejanews.com>,  <jason@dtlweb.com> wrote:
>I'm worried, though, about having wild.pm included in every invocation of my
>perl interpreter--I came across a posting (pasted at bottom) where someone had
>found that it gets you into trouble one in a while, and it would be a hard
>thing to track down.
[...]
Someone else had written:
>This causes the following problems
>
>Use of uninitialized value at C:\PERL\lib/File/DosGlob.pm line 112.
>Subroutine doglob redefined at C:\PERL\BIN/perlglob.bat line 30.
>Subroutine glob redefined at C:\PERL\BIN/perlglob.bat line 112.
>Subroutine import redefined at C:\PERL\BIN/perlglob.bat line 114.
>t\quoted-print.t t\base64.tWriting Makefile for MIME::Base64

These are considered bugs in perlglob.bat (they're gone in 5.004_05-tobe).
I posted the fix in a followup to the message you've quoted, IIRC.

The only time putting something in PERL5OPT would be a problem would
be when you do something mildly antisocial, like setting @INC inside the
script to a path that doesn't have material that PERL5OPT needs.  The
perl testsuite does this, for example.

 - Sarathy.
   gsar@umich.edu



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

Date: Fri, 6 Mar 1998 09:14:29 +0100 
From: "R. Allen Conway" <raconway@atos-group.com>
Subject: Re: Perl Script count lines of c/c++ code
Message-Id: <14953E9BAF17D111926800805FA66B710239DA0A@hermes.atos-group.com>

Well, it all depends on what you mean by "lines of ... code". If this does
not include comments the wc is not going to be enough, and I don't
think that dropping comments from the calculation is all that trivial.

Uri Guttman a icrit dans le message ...
>gip <gibson@doitnow.com> writes:
>
>> Does someone have a script that counts lines of C and/or C++ code?  Yeah
>> I know I can write it, but I thought it may have already been done ;}
>
>wc *.c
>
>strip empty lines
>
>grep -v '^$' *.c | wc
>
>
>who needs perl :-)
>
>uri
>
>--
>Uri Guttman                     SYStems ARCHitecture and Software
Engineering
>uri@sysarch.com                                          Have Perl, Will
Hack
>http://www.sysarch.com                (781) 643-7504 x*2  FAX: (781)
643-2710
>Try the Best Search Engine on the Net -------->
http://www.northernlight.com



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

Date: 6 Mar 1998 10:58:15 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: Problem with "goto" in Perl
Message-Id: <889181895.179417@cabal>

In <34F74AC4.6486@interport.net> Angy <angyny@interport.net> writes:

>I have a problem with goto in Perl. It looks alike perl can only "goto"
>back to previous lines, but not afterwards lines (correct me if I'm
>wrong).

Perl will not allow you to goto into code that the optimiser has removed.
The best solution to this is to remove your need for goto's.

> My perl code has 3 parts. In 1st part, I check some error
>conditions, and if true, I need to exit 1st part. Actually I'd rather
>use "goto" to exit 1st part and directly go into 2nd part.

Set your your parts as subrouteens and simply call them when thay are
needed.

--
Please excuse my spelling as I suffer from agraphia see the url in my header. 
Never trust a country with more peaple then sheep. 
Support NoCeM http://www.cm.org/                   
I'm sorry but I just don't consider 'because its yucky' a convincing argument


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

Date: Fri, 06 Mar 1998 12:32:12 +0100
From: Stephen Riehm <sr@pc-plus.de>
Subject: Problems compiling perl 5.004_04 on Unixware - seeking help
Message-Id: <34FFDEBC.41C6@pc-plus.de>

Hi,

I tried to install perl 5.004_4 on the unixware 2.0 machine today,
and the compiler seemed to have quite a few difficulties. I tried hand
configuring it, but also to no avail.

Does anyone have a config.sh which works on unixware? (perl5.003 would
also be acceptable)

Thanks in advance,

PS: I read in Deja-News about a Unixware Developer's FAQ, but I couldn't
find it - does anyone have a URL for the beast perhaps?

Thanks in advance,

Steve
//   __________________________ ._ o  ________________________________
\\\\ Stephen Riehm             /  //\.        Stephen.Riehm@pc-plus.de
//// pc-plus                  '  \>> |         Phone: +49 89 45566 148
  \\ 81675 Munich, Germany        \\ `           Fax: +49 89 45566 113


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

Date: 6 Mar 1998 11:16:03 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: Question for Tom Christiansen
Message-Id: <889182963.685561@cabal>

In <6dfifk$469@acme.sb.west.net> jbc@west.net (John Callender) writes:

>Brian L. King (blk@redneck.intel.com) wrote:
> 
>: Given some of the recent threads in this newgroup, I'd bet a buck that
>: Tom has killfiled ($subject =~ /Tom Christiansen/i) postings.... 

>You're on. I bet he reads them all--and I'll gladly mail you the $1 if Tom
>confirms that you're correct.

But there is no brackets in that match, $1 is undef. 

--
Please excuse my spelling as I suffer from agraphia see the url in my header. 
Never trust a country with more peaple then sheep. 
Support NoCeM http://www.cm.org/                   
I'm sorry but I just don't consider 'because its yucky' a convincing argument


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

Date: 6 Mar 1998 11:07:29 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: QUIZ: answer and hash slice tutorial
Message-Id: <889182449.719721@cabal>

In <34FD9000.734@world.northgrum.com> Charles Margolin <cmargoli@world.northgrum.com> writes:

>Uri Guttman wrote:
> 
>> @array{ @array } = ( [ @array ] ) x @array ;

>Is there a reason to copy the original array into an anonymous array?
>Why not use a reference to @array?

Yes,  if you mod the anon array it will effect the original.  This may not
be what you want.

--
Please excuse my spelling as I suffer from agraphia see the url in my header. 
Never trust a country with more peaple then sheep. 
Support NoCeM http://www.cm.org/                   
I'm sorry but I just don't consider 'because its yucky' a convincing argument


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

Date: Fri, 6 Mar 1998 12:35:06 -0000
From: "Adam Carden" <adam@pacific-artists.demon.co.uk>
Subject: Re: Running a perl script on Windows 95
Message-Id: <889188074.4807.1.nnrp-01.c2de97e4@news.demon.co.uk>

Why not asscoiate the file type with windows?

Thieu wrote in message <34F4BE7E.17275026@ca.ibm.com>...
>I have a Perl script that is running fine on UNIX. I now want to run it
>on Windows 95 but it is not being executed at all. I am suspecting that
>it cannot even find the Windows version Perl interpreter that I
>installed. What is the Windows equivalent of the first line used for
>UNIX (#!/usr/local/bin/perl) that tells where the Perl interpreter is?
>Any other details that I should pay attention to as well? Thanks.
>




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

Date: 6 Mar 1998 11:24:23 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: Script for RTrimming Fields
Message-Id: <889183463.700201@cabal>

In <34FEC427.43C5@prenhall.com> Byron Lee <byron_lee@prenhall.com> writes:

>Hello,

>Does anyone out there have a script for trimming spaces from
>the end of a string?

what is wrong with s/(.*?)\s*$/$1/  (Add flags to the end of sub
depeanding on what you think the string is)?

>  I suppose I could write one, but I'm taking the lazy approach today. :)

You not being lazy in the right way.


--
Please excuse my spelling as I suffer from agraphia see the url in my header. 
Never trust a country with more peaple then sheep. 
Support NoCeM http://www.cm.org/                   
I'm sorry but I just don't consider 'because its yucky' a convincing argument


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

Date: Fri, 06 Mar 1998 10:45:38 +0100
From: kaj.hejer@usit.uio.no (Kaj Hejer)
Subject: Re: sockets to webservers
Message-Id: <kaj.hejer-0603981045380001@macusit21.uio.no>

In article <6cagh0$89j$1@csnews.cs.colorado.edu>, tchrist@mox.perl.com
(Tom Christiansen) wrote:

> :socket(SOCK,PF_INET,SOCK_STREAM,$proto);
> :connect(SOCK,$paddr);
> :
> :And I know that the paddr is fine. I'm stumped!
> 
> It won't hang forever.  I don't see you checking the
> return value or revealing errno.  See the webget
> program in perlipc, but also read perlfaq9.



Hi!

I have the same problem with IO::Socket::INET

The following code is mostly cut and paste from
ftp://sunsite.uio.no/pub/languages/perl/CPAN/doc/FAQs/FAQ/PerlFAQ.html#How_do_I_flush_unbufer_a_fileha

I'm trying to connect to the echo-server (port 7) and send some text and
read it back.

#!/local/bin/perl5

    use IO::Socket;         
    print "after use:$!:\n";
    $sock = IO::Socket::INET->new(PeerAddr => 'morgoth.uio.no',
                                  PeerPort => 7,
                                  Proto    => 'tcp');

    print "after new socket:$!:\n";

    die "$!" unless $sock;

    $sock->autoflush();
    print "after autoflush:$!:\n";

    print "timeout: ", $sock->timeout, ":\n";
    $sock->timeout(4);
    print "after timeout:$!:\n";
    print "timeout: ", $sock->timeout, ":\n";

    $sock->print('Hi!\n\n');
    print "after print:$!:\n";

    print $sock->getline);
    print "after getline:$!:\n";

    print "DOC IS: $document\n";


It just hangs after "after print::". I'm using using 5.004_04 and Solaris/IRIX.

The same from telnet works just fine:

kajh@ernst~> telnet morgoth.uio.no 7
Trying 129.240.201.201...
Connected to morgoth.uio.no.
Escape character is '^]'.
Hi!
Hi!


Am I doing something stupid, is there something strange with
IO::Socket::INET or is there some other explanation? Thanks in advance for
any help!



-kaj :)


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

Date: 06 Mar 1998 10:54:41 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
To: kaj.hejer@usit.uio.no
Subject: Re: sockets to webservers
Message-Id: <7x1zwgkuu6.fsf@beavis.vcpc.univie.ac.at>

Re: sockets to webservers, Kaj <kaj.hejer@usit.uio.no>
said:

Kaj>     $sock->autoflush();

I think you want autoflush(1) here.

Look for autoflush in the perlvar doc.

tony

-- 
Tony Curtis, Systems Manager, VCPC,      | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, AT | http://www.vcpc.univie.ac.at/

"Everything I am, I learned on the back of cereal boxes" ~ RJ, "Over the Hedge"


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

Date: Fri, 06 Mar 1998 12:12:42 +0100
From: kaj.hejer@usit.uio.no (Kaj Hejer)
Subject: Re: sockets to webservers
Message-Id: <kaj.hejer-0603981212420001@macusit21.uio.no>

In article <7x1zwgkuu6.fsf@beavis.vcpc.univie.ac.at>, Tony Curtis
<Tony.Curtis+usenet@vcpc.univie.ac.at> wrote:

> Re: sockets to webservers, Kaj <kaj.hejer@usit.uio.no>
> said:
> 
> Kaj>     $sock->autoflush();
> 
> I think you want autoflush(1) here.
> 
> Look for autoflush in the perlvar doc.


Hi!

Thanks for your answer! I tried autoflush(1) now, but it didn't help.



-Kaj


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

Date: Fri, 06 Mar 1998 12:55:04 +0000
From: Alex Schajer <alexs@online.emap.com>
Subject: Sort a hash table by it's values
Message-Id: <34FFF227.7E2E67BD@online.emap.com>

Hi,

I have hash table with numbers in them. I want to order the hash table
by their values

ie

$TEAM{'alex'} = 4
$TEAM{'perl'} = 2
$TEAM{'unix'} = 5

I would like to rank these and get the results:

$TEAM{'unix'} = 5
$TEAM{'alex'} = 4
$TEAM{'perl'} = 2

or even ordered the other way.

Any ideas?

Thanks,
Alex



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

Date: 6 Mar 1998 11:32:55 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: Summing Up Array Values - How Do I?
Message-Id: <889183975.435129@cabal>

In <34FE3852.1B48323A@coos.dartmouth.edu> Chipmunk <rjk@coos.dartmouth.edu> writes:

[...]

>map in void context != schwartzian

Perhaps Abigailian?

--
Please excuse my spelling as I suffer from agraphia see the url in my header. 
Never trust a country with more peaple then sheep. 
Support NoCeM http://www.cm.org/                   
I'm sorry but I just don't consider 'because its yucky' a convincing argument


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

Date: 6 Mar 1998 09:24:42 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Two questions about POD
Message-Id: <6dofcq$chr$1@lyra.csx.cam.ac.uk>

Martien Verbruggen <mgjv@comdyn.com.au> wrote:
>In article <Ep0HCt.J6r@rna.nl>,
>	Gerben_Wierda@RnA.nl writes:
>
>>>=head1 DIAGNOSTICS
>>>
>>>=over 4
>>>
>>>=item Usage: gord_use.pl [--verbose=i] [--user=s] (active|inactive|test)
>> 
>> I get
>> 
>>>DIAGNOSTICS
>>>(active|inactive|test)
>>>     Usage: gord_use.pl [--verbose=i] [--user=s]
>
>I don't.
>
>% cat a.pod
>=head1 DIAGNOSTICS
>
>=over 4
>
>=item Usage: gord_use.pl [--verbose=i] [--user=s] (active|inactive|test)
>% pod2text a.pod
>DIAGNOSTICS
>    Usage: gord_use.pl [--verbose=i] [--user=s] (active|inactive|test)
>%

There certainly are bugs in pod2man in this area.   (Or is it the
particular implementation of man / nroff?)    I think they are
sensitive to line length.   Here are a couple of samples taken from
"perldoc perldiag".    I seem to recall that the POSIX man page is also
bad.

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

     Send on closed socket
         (W) The filehandle you're sending to got itself closed
         sometime before now.  Check your logic flow.

incomplete extension (?. See the perlre manpage.
     Sequence (? incomplete (F) A regular expression ended with an

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

package `%s'
     Stub found while resolving method `%s' overloading `%s' in
         (P) Overloading resolution over @ISA tree may be broken
         by importation stubs.  Stubs should never be implicitely
         created, but explicit calls to can may break this.

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



Mike Guy


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

Date: Fri, 06 Mar 1998 00:43:19 -0800
From: Rob Thorne <rthorne@netscape.com>
Subject: Using pod2html.pl on Win32
Message-Id: <34FFB726.F0716F1B@netscape.com>

I have written some Perl modules, in which I've included POD
documentation.  The modules now work, but I'm having trouble getting
HTML out of the .PM files.

I've gone through the Perlpod page, and I've also read the stuff inside
pod2html.pl.  It looks like I should be able to do something like this,
and get out HTML:

perl pod2html.pl < MyModule.pm > MyModule.html

MyModule.html will contain the single line:

Extracting pod2html (with variable substitutions)

Obviously this isn't what I want.

Has anyone gotten this to work on the Win32 distribution of 5.004, and
if you did, how did you do it?

Thanks,
Rob




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

Date: 6 Mar 1998 08:21:24 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Using strings as filehandles
Message-Id: <6dobm4$aa8$1@lyra.csx.cam.ac.uk>

In article <6d06e8$doc@sjx-ixn7.ix.netcom.com>,
Luis J. Martinez <luis@utdallas.edu> wrote:
>Is there a way to use very large strings as files?

You could do this using the tie facilities, see "Tying Filehandles"
in the perltie man page.    Note that these are not completely
implemented in Perl 5.004_04.

OTOH strings are easier to access than files, so it would seem
simpler not to wrap them up like this.


Mike Guy


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

Date: Fri, 06 Mar 1998 12:17:01 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: What is PERL? Learn JAVA instead?
Message-Id: <3502e8fd.7252681@news.tornado.be>

Evan Kirshenbaum <evan@garrett.hpl.hp.com> wrote:

>On second thought, it appears that I may be being to charitable.  A
>reading of perlobj points out that yes, there is true garbage
>collection going on, but it happens *only* at interpreter shutdown (by
>running a mark/sweep).  A test confirms that this appears to be what
>happens.  This does guarantee that destructors are (eventually)
>called, but it also means that a program that needs to repeatedly
>build large temporary graphs is still going to find itself rapidly
>growing and/or running out of memory due to uncollected garbage.

It seems like letting the programmer manually invoking the (full)
garbage collector, just like happens at interpeter shutdown, might be a
worthwile addition to the Perl kernel.

In the meantime, a workaround might be manually breaking the circular
chain, once you know you're through.


In another part of this thread, Evan Kirshenbaum
<evan@garrett.hpl.hp.com> wrote:

>By introspection, my litmus test for "true" garbage collection is
>roughly "if I try to allocate a block of memory and there is a larger
>block of garbage in a compatible heap, the allocation should succeed".

Well, yes. If Perl runs out of memory, the full GC should be invoked
too. (Doesn't this already happen?)

This would be slow, but far better than the script just crashing.

	Bart.


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

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

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