[13309] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 719 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Sep 5 18:07:24 1999

Date: Sun, 5 Sep 1999 15:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 5 Sep 1999     Volume: 9 Number: 719

Today's topics:
    Re: "Use <module>" Decide at run-time? <robert.l.flaugherREMOVE@trw.com>
        "use lib" should work differently (Michael Schilli)
    Re: APi519e.exe and Win98??? <rayj00@ameritech.net>
        Diffs between scalar and hash variables? (Jeffrey Epstein)
    Re: do 'file' for config file and use strict <ltl@rgsun40.viasystems.com>
    Re: do 'file' for config file and use strict <hfader@hotpop.com>
    Re: do 'file' for config file and use strict <hfader@hotpop.com>
    Re: Dos Perl and System command <palincss@his.com>
    Re: File handles, forks, objects and scope (Jeffrey Epstein)
    Re: How to Process MULTIPLE select values <bigsleep@dircon.co.uk>
    Re: How to Process MULTIPLE select values (Sam Holden)
    Re: How to Process MULTIPLE select values <bigsleep@dircon.co.uk>
    Re: HTML Code read from file not being interpreted <ppith@my-deja.com>
    Re: Looking for tools. <gellyfish@gellyfish.com>
        Looking good CGI programmer <mcarpen@ix.netcom.com>
        msdos console window under windows 95 <bigdreamer@prodigy.net>
    Re: msdos console window under windows 95 <bobkolker@usa.net>
    Re: Newbie: Perl DOS Window Runs Too Fast <rayj00@ameritech.net>
        perl mail filter? <revjack@radix.net>
        Platform <mukundmc@hotmail.com>
        problem with errormessages. <baal@c2i.net>
        problems with "Learning Perl on Win32 Systems" CD <lldwood@xmission.com>
    Re: problems with "Learning Perl on Win32 Systems" CD <carvdawg@patriot.net>
    Re: Routine for normalising file paths (Alan Barclay)
    Re: Routine for normalising file paths (Benjamin Franz)
        Subscribing to p5p <jll@enterprise.newedgeconcept>
    Re: testing scripts <phony@nospam.com>
        un-importing names (Bill Moseley)
    Re: Why doesn't my undef an array? (Kai Henningsen)
    Re: Why doesn't my undef an array? <rra@stanford.edu>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Sun, 05 Sep 1999 13:02:14 -0700
From: Robert F <robert.l.flaugherREMOVE@trw.com>
To: joern@netcologne.de
Subject: Re: "Use <module>" Decide at run-time?
Message-Id: <37D2CC46.8B8E394@trw.com>

Thank you for this suggestion.  However, when I implement it, I get an error
which says

"Too many arguments for HandleError: handleError at driver line 8, near
"DHCPGlobalParameters)".

I'm lost.  I think I'm in over my head using this advanced feature.


Joern Reder wrote:

> Robert F wrote:
>
> > sub handleError() {
> >     use $_[0];                          # <= I want to do this but can't
> > because it's not known until run-time
>
> Try this:
>
>         require $_[0];
>         $_[0]->import;
>
> This is approximately what "use Module" does (the use statement is
> implicitly put in a BEGIN{} block and calls the import method), but the
> name of the module is resolved at runtime.
>
> You'll not need the import method call if your module does not export
> symbols to the callers namespace.
>
> Joern
>
> --
> Joern Reder -- joern@netcologne.de
> supporting:   http://www.zyn.de/
> unbelievable: http://www.netcologne.de/~nc-joernre/



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

Date: 5 Sep 1999 17:32:56 GMT
From: schilli@tep.e-technik.tu-muenchen.de. (Michael Schilli)
Subject: "use lib" should work differently
Message-Id: <7qu9g8$ahm$1@sparcserver.lrz-muenchen.de>

Hey folks,

I don't think "use lib" is doing what it's supposed to 
do -- please take a minute and read through the following:

If you want a new module in a non-standard location (e.g.
because the Sysad won't let you install it in /usr/lib/perl5),
installing it with a installation prefix, like

    perl Makefile.PL PREFIX=/home/mike/myperl

it's probably gonna put it somewhere in

    /home/mike/myperl/lib/perl5/site_perl/5.005

On the other hand, if you want to use the module,
according to the documentation (perlmodinstall.pod),
you're supposed to say

    use lib "/home/mike/myperl/lib/perl5/site_perl";

which -- as of perl 5.005_03 -- only appends
/home/mike/myperl/lib/perl5/site_perl to @INC -- which of
course doesn't work. And, by the way, you should
just have to say 

    use lib "/home/mike/myperl";

and the internals should be smart enough to do the right
thing.

"use lib NAME" should append 4 (four) additional paths to
@INC, according to 

    $Config{'installsitearch'}
    $Config{'installsitelib'}
    $Config{'installarchlib'}
    $Config{'installprivlib'}

For example, this could be

push(@INC,
    '/home/mike/myperl/lib/perl5/site_perl/5.005/i686-linux',
    '/home/mike/myperl/lib/perl5/site_perl/5.005'
    '/home/mike/myperl/lib/perl5/5.00503/i686-linux'
    '/home/mike/myperl/lib/perl5/5.00503');

As a (sloppy) sample implementation, here's some code that's doing
what I think "use lib" really should do:

BEGIN {
    use Config;
    my $newlib = "/home/mike/test_modules/lib/perl5";

    push(@INC,
    map { s#$Config{prefix}/lib/perl5#$newlib#; $_ }
    map { $Config{$_} } qw(installarchlib installsitearch
                           installprivlib installsitelib));};
}

What do you guys think?

--
Mike 

--------------------------------------------------------------------------
  Mike Schilli                     More Info:   http://perlmeister.com
--------------------------------------------------------------------------


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

Date: Sun, 05 Sep 1999 11:48:51 -0500
From: Ray Jender <rayj00@ameritech.net>
Subject: Re: APi519e.exe and Win98???
Message-Id: <37D29EF3.A600DB79@ameritech.net>

This is a multi-part message in MIME format.
--------------1AD3D02FE67B5456F387AB03
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Thanks Richard,

As I found out. After aborting the install twice,
I just left it run the third time. I'm not sure
how long it took, as I went to bed. I'm sure it
took at least 3 hours though. All install steps
seemed to work properly, just that it took soooo
darn long..

I have yet to try Perl though, so that will be the
true test whether it installed properly.

Ray Jender

"Richard S. Kowalski" wrote:
> 
> Yes.  I loaded it on my 486 on "steroids" (as one help desk person told
> me) last night.  It took a long time and there were periods that it
> appeared nothing was happening.  It did eventually load, and it works
> fine.
> 
> Richard
> 
> Ray Jender wrote:
> 
> > I have downloaded twice.
> >
> > After double clicking on the file APi519.exe,
> > it goes through the Setup InstallShield then
> > nothing. Absolutely nothing. My PC is slowed
> > to a crawl. (PII/400Mhz/128mb ram/12gig hd).
> >
> > Doing a CNTRL-ALT-DEL shows the file in the
> > list as well as a file called _inst or similar.
> > I take it this is the install process.
> >
> > Anybody have success with build 519 and Win98?
> >
> > Ray
--------------1AD3D02FE67B5456F387AB03
Content-Type: text/x-vcard; charset=us-ascii;
 name="rayj00.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Ray Jender
Content-Disposition: attachment;
 filename="rayj00.vcf"

begin:vcard 
n:Jender;Ray
x-mozilla-html:FALSE
url:http://4starweb.com
org:4Star Web
adr:;;;Aurora;Illinois;60504;USA
version:2.1
email;internet:rayj00@ameritech.net
fn:Ray
end:vcard

--------------1AD3D02FE67B5456F387AB03--



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

Date: 5 Sep 1999 21:43:16 GMT
From: epsteinj@equity.wharton.upenn.edu (Jeffrey Epstein)
Subject: Diffs between scalar and hash variables?
Message-Id: <7quo5k$oj7$1@netnews.upenn.edu>

I am having what *should* be a tiny problem, but it is driving me a 
bit crazy.  If you have a moment, I'd appreciate any tips you might 
have.  Thank you.
--------------------

Below is a very simple script that, when uncommenting the last 
line, causes the following error:

   String found where operator expected at main2.pl line 15, near "} 
   "Printing from hash...\n""
           (Missing operator before  "Printing from hash...\n"?)
   syntax error at main2.pl line 15, near "} 
   "Printing from hash...\n""
   Execution of main2.pl aborted due to compilation errors.

What must be done to store FILE_POINTER into a hash variable and 
then use it later?  Why does it work when putting it into the 
scalar variable?  It seems like it should behave exactly the 
same...

--
Jeff
jeffy@wharton.upenn.edu
http://equity.wharton.upenn.edu/~epsteinj

Programmer Analyst
Wharton School
University of Pennsylvania


---------------------------------------------v------------------
The source.  Notice the couple of comments...
---------------------------------------------------------------
#!/bin/perl

  $my_hash={};

  $my_hash->{"my_string"} = "value_of_my_string";
  print $my_hash->{"my_string"}."\n";

# THIS SHOULD ALL BE ON ONE LINE...
# PUT IN A VALID PATH FOR YOUR MACHINE...
   open(FILE_POINTER, ">>[...PATH-TO-LOG...]test.log")  || 
die("Parameters valid, but the file was not found, or could 
not be opened.");

  print FILE_POINTER "Printing directory from file handle\n";

  $filePointer = \*FILE_POINTER;
  print $filePointer "Printing from scalar...\n";

  $my_hash->{"filePointer"} = \*FILE_POINTER;
#  print $my_hash->{"filePointer"} "Printing from hash...\n";
---------------------------------------------------------------


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

Date: 5 Sep 1999 16:08:04 GMT
From: lt lindley <ltl@rgsun40.viasystems.com>
Subject: Re: do 'file' for config file and use strict
Message-Id: <7qu4h4$du1$1@rguxd.viasystems.com>

Hugh Fader <hfader@hotpop.com> wrote:
:>I am trying to set up a config file which sets perl variables as
:>suggested in the perl man pages. I also want to use strict. I can't get
:>both of these to work together. Here is what I have:

:>---f1.pl---
:>#! /usr/bin/perl
:>use strict;
:>my $v1;
:>do 'f2.pl' or die "can't do f2.pl";

:>---f2.pl---
:>$v1 = "123";
:>---------


use vars qw/$v1 $v2/; # etc.

Read the section on 'strict vars' in `perldoc strict`.
Also, Keep reading about scoping.  The lexical scope of your config
file is different than the lexical scope of the file where you
use "do".

-- 
// Lee.Lindley   /// Programmer shortage?  What programmer shortage?
// @bigfoot.com  ///  Only *cheap* programmers are in short supply.
////////////////////    50 cent beers are in short supply too.


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

Date: Sun, 05 Sep 1999 21:48:48 GMT
From: Hugh Fader <hfader@hotpop.com>
Subject: Re: do 'file' for config file and use strict
Message-Id: <37D2E540.6E59BC64@hotpop.com>

Thanks Sam. This was incredibly helpful. Good luck with your studies!

Sam Holden wrote:

> On Sun, 05 Sep 1999 15:15:25 GMT, Hugh Fader <hfader@hotpop.com> wrote:
> >I am trying to set up a config file which sets perl variables as
> >suggested in the perl man pages. I also want to use strict. I can't get
> >both of these to work together. Here is what I have:
> >
> >---f1.pl---
> >#! /usr/bin/perl
> >use strict;
> >my $v1;
> >do 'f2.pl' or die "can't do f2.pl";
> >
> >---f2.pl---
> >$v1 = "123";
> >---------
> >
> >If I don't use strict everything works as expected. If I use strict,
> >then I need to declare my $v1 or I get an error. If I declare my $v1,
> >then it uses the local copy of $v1 not what is set in f1.pl.
> >
> >Anybody know a workaround for this?
>
> Did you bother to read the documentation that comes with perl before
> deciding to bother everyone else.
>
> What does 'perldoc strict' tell you about strict. It mentions three ways to
> use variables under 'use strict'. Using 'my' is only one of the ways. The first
> way listed might be of interest to you, but you would know that if you could
> be bothered reading the documentation that comes with perl.
>
> How could you be using something from the man pages, and then not bother
> looking them up when you have a problem...
>
> --
> Sam
>
> You are bordering on ridiculous if you think you need to support your
> premises.  Such an argument is an infinite regression.
>         --George Reese in <wv0O1.1521$Ge.4809664@ptah.visi.com>



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

Date: Sun, 05 Sep 1999 21:50:40 GMT
From: Hugh Fader <hfader@hotpop.com>
Subject: Re: do 'file' for config file and use strict
Message-Id: <37D2E5AF.D6024A24@hotpop.com>

Thanks Lee. I understood about the lexical scoping problem, but overlooked
use vars. That does the trick.

lt lindley wrote:

> Hugh Fader <hfader@hotpop.com> wrote:
> :>I am trying to set up a config file which sets perl variables as
> :>suggested in the perl man pages. I also want to use strict. I can't get
> :>both of these to work together. Here is what I have:
>
> :>---f1.pl---
> :>#! /usr/bin/perl
> :>use strict;
> :>my $v1;
> :>do 'f2.pl' or die "can't do f2.pl";
>
> :>---f2.pl---
> :>$v1 = "123";
> :>---------
>
> use vars qw/$v1 $v2/; # etc.
>
> Read the section on 'strict vars' in `perldoc strict`.
> Also, Keep reading about scoping.  The lexical scope of your config
> file is different than the lexical scope of the file where you
> use "do".
>
> --
> // Lee.Lindley   /// Programmer shortage?  What programmer shortage?
> // @bigfoot.com  ///  Only *cheap* programmers are in short supply.
> ////////////////////    50 cent beers are in short supply too.



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

Date: Sun, 05 Sep 1999 17:57:39 -0400
From: Steve Palincsar <palincss@his.com>
Subject: Re: Dos Perl and System command
Message-Id: <37D2E753.CE7C1678@his.com>

Nim Chu wrote:
> 
> "George M. Pieri" <george.pieri@mci.com> wrote:
> 
> >Has anyone successfully used the system command or back ticks
> >to execute a command from a DOS perl script ?
> >system "dir " ; or=20
> >`dir`
> >produces no results.
> 
> If you store the result in a variable, then you can see it. E.g.
> 
> $r=`dir`;
> print $r;

Sure depends on which DOS perl George is using.
If he's using the IlyaZ OS/2 perl for DOS, AFAIK
nothing will help, since you can't run an external
program or system from it.  

If that's the case, the Laszlo Molnar Perl 5 port
is the answer, and backticks work fine.


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

Date: 5 Sep 1999 21:47:47 GMT
From: epsteinj@equity.wharton.upenn.edu (Jeffrey Epstein)
Subject: Re: File handles, forks, objects and scope
Message-Id: <7quoe3$oj7$2@netnews.upenn.edu>

So what is the *right* way to do this?

Tom Christiansen (tchrist@mox.perl.com) wrote:
: In comp.lang.perl.misc, sjones@icubed.com writes:

: :Should I be able to use file handle GLOBs across object
: :namespaces?

: You can.

: :  # in the parent, just prior to forking
: :  $child->{wh} = \*WRITE;                             
: :  pipe($rh, WRITE) or croak "Can't create pipes: $!";

: :  my $wh = $this->{wh};
: :  open(STDOUT, ">&=$wh) or croak "Can't dupe write handle";

: What do you expect open() to do with arguments of 

:     open(STDOUT,">&=GLOB(0x80d41e4)")

: The dup syntax of open() permits a file descriptor number or a file
: handle name, but you provided it with neither.

: People make this mistake a great deal.  I don't know why.

: --tom
: -- 
: "All my possessions for a moment of time."
: 				- Elizabeth I, last words

--
Jeff
jeffy@wharton.upenn.edu
http://equity.wharton.upenn.edu/~epsteinj

Programmer Analyst
Wharton School
University of Pennsylvania



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

Date: Sun, 5 Sep 1999 21:34:34 +0100
From: "Andrew Whitaker" <bigsleep@dircon.co.uk>
Subject: Re: How to Process MULTIPLE select values
Message-Id: <37d2d404_2@newsread3.dircon.co.uk>


WebMan wrote in message ...
>I have a form that has a <SELECT MULTIPLE NAME="FOO"> defined in it and I
>want to process the multiples.  My program ends up placing only the last
>selected option value in the hash no matter what.

Try
$Hash{$Key} .= "," if defined $Hash{$Key};
$Hash{$Key} .= "$Value";

look at the input stream, it contains multiple lines of the same key.

Andy Whitaker
Cimexmedia Ltd.





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

Date: 5 Sep 1999 20:38:52 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: How to Process MULTIPLE select values
Message-Id: <slrn7t5l6s.iv9.sholden@pgrad.cs.usyd.edu.au>

On Sun, 5 Sep 1999 21:34:34 +0100,
	Andrew Whitaker <bigsleep@dircon.co.uk> wrote:
>
>WebMan wrote in message ...
>>I have a form that has a <SELECT MULTIPLE NAME="FOO"> defined in it and I
>>want to process the multiples.  My program ends up placing only the last
>>selected option value in the hash no matter what.
>
>Try
>$Hash{$Key} .= "," if defined $Hash{$Key};
>$Hash{$Key} .= "$Value";
>
>look at the input stream, it contains multiple lines of the same key.

Not very useful if you have values like :

'fred'
'bill'
'fred,bill'


-- 
Sam

This was for Linux, but since we all know that "platform independent"
means "runs on both BSD and Linux", this should be ok. :-)
	-- Tom Christiansen in <37cf3d16@cs.colorado.edu>



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

Date: Sun, 5 Sep 1999 22:01:45 +0100
From: "Andrew Whitaker" <bigsleep@dircon.co.uk>
Subject: Re: How to Process MULTIPLE select values
Message-Id: <37d2da64_1@newsread3.dircon.co.uk>


Sam Holden wrote in message ...
>Not very useful if you have values like :
>
>'fred'
>'bill'
>'fred,bill'
>


I agree, but its *a* solution and also explains the problem.




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

Date: Sun, 05 Sep 1999 18:49:55 GMT
From: Howard Jow <ppith@my-deja.com>
Subject: Re: HTML Code read from file not being interpreted
Message-Id: <7que0h$9rc$1@nnrp1.deja.com>

Try using Perl's eval function for lines that contain the symbols "->"
(use a regular expression to filter for that).  BTW, shouldn't you be
starting out your script with:

print "Content-type:text/html\n\n";

?????

In article <7qtmds$qck@newssrv2.hrz.uni-oldenburg.de>,
  "Hendrik Holtmann" <Hendrik.Holtmann@pmnet.uni-oldenburg.de> wrote:
> Hi,
>
> I want to read HTML-Code from an extern file called text.html and sent
it to
> a browser. I try this by the following algorithm:
>
> open(INFILE,"test.hmtl");
> WHILE (<INFILE>) {
> print $_;
> }
>
> The HTML-Code contains parts, that I want perl to be interpreted. For
> example data->{titel} is an access to an HASH containing data from an
> SQL-database. Unfortunately perl sends only data->{titel} to the
browser as
> text and not the interpreted from, which would mean the data from the
> SQL-database. If I copy the HTML-Code into the perl-script everything
works
> fine.
> I tried thinks like print "$_"; and print qq! $_ !; but had no
success. The
> data read from the HTML_File is never interpreted.
> Is there any way to do it.
>
> Any help is highly appreciated,
>
> Hendrik
>
>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 5 Sep 1999 10:52:16 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Looking for tools.
Message-Id: <7qti10$2d9$1@gellyfish.btinternet.com>

[The useless alt.perl and the non-existent comp.lang.perl removed]

In comp.lang.perl.misc Sidney Orret <orret@wmn.net> wrote:
> Hello
> 
> What are the best enviroment and tools for PERL's programming??????????????
> 

I refer you to perlfaq1 for the proper usage of 'Perl'.

In order to forestall the inevitable and boring editor advocacy perhaps
you might care to look at:

   <http://reference.perl.com/query.cgi?editors>

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sun, 5 Sep 1999 12:13:19 -0700
From: "Mike Carpenter" <mcarpen@ix.netcom.com>
Subject: Looking good CGI programmer
Message-Id: <7qufbg$sur@dfw-ixnews21.ix.netcom.com>

Looking for good, fast CGI programmer. Preferably in the Seattle area.
Please e-mail me if you are available
Mike




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

Date: Sun, 5 Sep 1999 14:43:27 -0400
From: <bigdreamer@prodigy.net>
Subject: msdos console window under windows 95
Message-Id: <7qudrs$3b56$1@newssvr04-int.news.prodigy.com>

i'm running active perl on windows 95... just working with some simple perl
development.  anyway, i need to know how to keep the console window open
after the app completes execution and the window it was running in is no
longer active.  right now it just exits and closes the window all in the
blink of an eye.  a stupid little wait for keypress at the end of my app
solves this but i figured there's got to be a better way to keep the window
showing.  i thought i would try this group first.  thanks a bunch to all.

steve




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

Date: Sun, 05 Sep 1999 18:00:44 -0400
From: "Robert J. Kolker" <bobkolker@usa.net>
Subject: Re: msdos console window under windows 95
Message-Id: <37D2E80C.51872EAD@usa.net>



bigdreamer@prodigy.net wrote:

> i'm running active perl on windows 95... just working with some simple perl
> development.  anyway, i need to know how to keep the console window open
> after the app completes execution and the window it was running in is no
> longer active.  right now it just exits and closes the window all in the
> blink of an eye.  a stupid little wait for keypress at the end of my app
> solves this but i figured there's got to be a better way to keep the window
> showing.  i thought i would try this group first.  thanks a bunch to all.
>

Run your perl program from an open MS_DOS window.

perl -w  <your perl program>

The window is open before the perl command and it stays open during
and after the perl command is executed.


Bob Kolker


>
> steve



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

Date: Sun, 05 Sep 1999 12:18:18 -0500
From: Ray Jender <rayj00@ameritech.net>
Subject: Re: Newbie: Perl DOS Window Runs Too Fast
Message-Id: <37D2A5DA.BC079010@ameritech.net>

This is a multi-part message in MIME format.
--------------C27E48C040AF5E13FFF7E21C
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Try opening an MS Dos window then running your
program from there. The window should remain open.

Ray

David wrote:
> 
> I just bought a "Perl 5 How To" book with a CD-ROM.  It says I have to
> have access to a server with Perl on it, but I want to run it on my
> Windows 98 machine first.  The problem I'm running into is that there is
> a version of Perl32.exe on my PC on which I am running the book's
> scripts, BUT the trouble is that a MS-DOS window opens up to run the
> script and then closes so quickly that I can't see what the script
> does.  When I eventually tailor one of these scripts or write my own, I
> want to test it on my PC before uploading it to the cgi-bin on the
> server.
> 
> What am I doing wrong, and what should I be doing?
> 
> Thanks in advance.
--------------C27E48C040AF5E13FFF7E21C
Content-Type: text/x-vcard; charset=us-ascii;
 name="rayj00.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Ray Jender
Content-Disposition: attachment;
 filename="rayj00.vcf"

begin:vcard 
n:Jender;Ray
x-mozilla-html:FALSE
url:http://4starweb.com
org:4Star Web
adr:;;;Aurora;Illinois;60504;USA
version:2.1
email;internet:rayj00@ameritech.net
fn:Ray
end:vcard

--------------C27E48C040AF5E13FFF7E21C--



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

Date: 5 Sep 1999 20:27:47 GMT
From: revjack <revjack@radix.net>
Subject: perl mail filter?
Message-Id: <7qujo3$q43$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight

Just curious, has anyone here ever written their own procmail-style 
e-mail filter using perl? I keep getting these suicidal impulses to 
do this every six months or so, and I was wondering if anyone had any 
success/failure stories or advice.



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

Date: Sun, 05 Sep 1999 13:51:04 -0700
From: Mukund M Chandak <mukundmc@hotmail.com>
Subject: Platform
Message-Id: <37D2D7B8.6ED785A6@hotmail.com>

hi!!

I wanted to know if there is a way to find the platform on which a user
is working on, like win32, sun sparcstation and so on. Is there any
command or function available for this.

thanks

Mukund



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

Date: Sun, 05 Sep 1999 18:13:51 GMT
From: "[L] Vicious!" <baal@c2i.net>
Subject: problem with errormessages.
Message-Id: <zpyA3.1782$6g7.175859@juliett.dax.net>

I have a problem with my recent program, I run win98 & activestate. This is
my errormessage:

Use of uninitialized value at C:/perl/site/lib/Tk.pm line 367
Use of uninitialized value at C:/perl/site/lib/Tk.pm line 367

Well, the program itself has no problem to get up and run, but if I use the
button $startbutton when I enter the program it crashes & gives me the
errormessage:

Error: Runtime exception

BUT, however, if I use the enterkey to call the very same function,
everything workes fine. Even the button $startbutton works fine after the
sub has been run once. Can this be related to the first errormessage? Have I
defined the $startbutton wrong?

This is my program very shortified:


use Tk;
use Win32;

sub longrunning {
  ...   ###
}

$top = MainWindow->new();
$aplicationframe =
$top->Frame()->pack(-side=>"bottom", -expand=>"yes", -fill=>"both");
$hframe = $aplicationframe->Frame()->pack(-side=>"right", anchor=>"no");

$startbutton =
$hframe->Button(-text=>"search", -command=>sub{startsearch()})->pack(-fill=>
"x", -side=>"top");
$top->bind("<KeyPress-Return>"=>sub{startsearch()});

MainLoop;





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

Date: Sun, 5 Sep 1999 15:17:48 -0600
From: "Lawrence Damewood" <lldwood@xmission.com>
Subject: problems with "Learning Perl on Win32 Systems" CD
Message-Id: <7qumhd$fma$1@news.xmission.com>

    Just bought this CD, but the exercises aren't working, or I'm doing
something wrong.  Beginning with Chapter 1, section 1.6.2, the results
aren't what I'm told they should be.  After writing these examples exactly
as they appear, I execute them.  An MS-DOS window opens, text appears, then
the MS-DOS window closes, all in a fraction of a second -- too fast to read
the text.
    Also, I'm wondering what that squiggly line is in front of the name
variable.  It looks like either a dollar sign or an ampersand.  I've tried
both; neither work.
    Hope I'm not wasting everybody's time with what is an annoying problem
with a simple solution I've overlooked.

Thanks
Lawrence




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

Date: Sun, 05 Sep 1999 17:38:21 -0400
From: "Harlan Carvey, CISSP" <carvdawg@patriot.net>
Subject: Re: problems with "Learning Perl on Win32 Systems" CD
Message-Id: <37D2E2CD.3DA52191@patriot.net>

The problem is with how you are executing them...they are run from the command
line:
perl myscript.pl

You DO NOT double-click the icon for the file in order to execute it...

The 'squiggly' line is a dollar sign.

Lawrence Damewood wrote:

>     Just bought this CD, but the exercises aren't working, or I'm doing
> something wrong.  Beginning with Chapter 1, section 1.6.2, the results
> aren't what I'm told they should be.  After writing these examples exactly
> as they appear, I execute them.  An MS-DOS window opens, text appears, then
> the MS-DOS window closes, all in a fraction of a second -- too fast to read
> the text.
>     Also, I'm wondering what that squiggly line is in front of the name
> variable.  It looks like either a dollar sign or an ampersand.  I've tried
> both; neither work.
>     Hope I'm not wasting everybody's time with what is an annoying problem
> with a simple solution I've overlooked.
>
> Thanks
> Lawrence



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

Date: Sun, 05 Sep 1999 16:21:26 GMT
From: gorilla@elaine.drink.com (Alan Barclay)
Subject: Re: Routine for normalising file paths
Message-Id: <936548743.972498@elaine.drink.com>

In article <slrn7t54la.v6.sholden@pgrad.cs.usyd.edu.au>,
Sam Holden <sholden@cs.usyd.edu.au> wrote:
>The first because it has a meaning already, and the second I guess because
>strings in C are implemented in such a stupid way that allowing it would
>annoy lots of C programmers...

Actually, it's more likely to be that the kernel calls which could create
or use a filename with a \0 in it are defined to be passed null terminated
strings. By definition, that means that without alternative kernel calls,
there is no way to pass a filename containing a null.


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

Date: Sun, 05 Sep 1999 17:09:01 GMT
From: snowhare@long-lake.nihongo.org (Benjamin Franz)
Subject: Re: Routine for normalising file paths
Message-Id: <NsxA3.168$eb1.6147@typhoon01.swbell.net>

In article <936548743.972498@elaine.drink.com>,
Alan Barclay <gorilla@elaine.drink.com> wrote:
>In article <slrn7t54la.v6.sholden@pgrad.cs.usyd.edu.au>,
>Sam Holden <sholden@cs.usyd.edu.au> wrote:
>>The first because it has a meaning already, and the second I guess because
>>strings in C are implemented in such a stupid way that allowing it would
>>annoy lots of C programmers...
>
>Actually, it's more likely to be that the kernel calls which could create
>or use a filename with a \0 in it are defined to be passed null terminated
>strings. By definition, that means that without alternative kernel calls,
>there is no way to pass a filename containing a null.

And the kernel is defined to use null terminated strings because....
It is usually written mostly in C. 

IOW your detour to the kernel still derives the problem with strings 
containing null characters from C. I happen to agree that it was an 
extraordinarily _bad_ decision to make strings null terminated in C 
rather than explicitly store their length. A few bytes saved to gain 
years of programming hack arounds...Hmmm...Sounds like another famous
problem caused by programmers 'saving' a few bytes.....

-- 
Benjamin Franz


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

Date: 05 Sep 1999 14:49:07 +0200
From: Jean-Louis Leroy <jll@enterprise.newedgeconcept>
Subject: Subscribing to p5p
Message-Id: <m3iu5pbk1o.fsf@enterprise.newedgeconcept>

How can I subscribe to the perl5-porters mailing list? I've been on
that list several times before, but right now I can't find the right
incantation for subscribing, they used to be on the old www.perl.org,
but not anymore it seems. And the old summons I found in my files
don't seem to work anymore...

JL


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

Date: 5 Sep 1999 18:41:21 GMT
From: "Bart Simpson" <phony@nospam.com>
Subject: Re: testing scripts
Message-Id: <7qudgh$3bb$0@216.39.133.36>


PPost Webmaster <petpost@earthlink.net> wrote in message
news:37D22F62.29F4E667@earthlink.net...
> Hi,
>
> I have a newbie question.  I have just written a Perl script and
> uploaded it into my cgi-bin on the server.  Can I test this script
> without having to put together an HTML page that corresponds with it?
> And if so, how?
>

If it uses GET, and not POST, then you can just type the url into the
browser.

i.e.,
http://www.yourdomain.com/cgi-bin/filename.cgi




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

Date: Sun, 5 Sep 1999 14:32:32 -0700
From: moseley@best.com (Bill Moseley)
Subject: un-importing names
Message-Id: <MPG.123c814fac5ed4d9989705@nntp1.ba.best.com>

use CGI qw/:standard :html3/;           # import symbols

I forgot how to say "but, don't import symbol 'sub'".

Where is it in the docs?

Thanks,

-- 
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.


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

Date: 05 Sep 1999 21:07:00 +0200
From: kai-asstr-news=7OIcF3rlayB@khms.westfalen.de (Kai Henningsen)
Subject: Re: Why doesn't my undef an array?
Message-Id: <7OIcF3rlayB@khms.westfalen.de>

rra@stanford.edu (Russ Allbery)  wrote on 01.09.99 in <ylhfle421r.fsf@windlord.stanford.edu>:

> Ala Qumsieh <aqumsieh@matrox.com> writes:
> > Ian Smith <iansmith@pepper.ncinter.net> writes:
>
> >> Ugh.  The defined function does ugly things with arrays indeed.
>
> > Not ugly. Useful :)
>
> defined on aggregates is not useful.  It's sufficiently unuseful that it's
> likely to be deprecated in future versions of Perl.  It doesn't tell you
> any useful information; it gives you information about irrelevant and
> unpredicatable internal state of the Perl interpretor.

But why are we talking about defined() at all?

The original example does not call defined().

The revised example does not call defined(), either.

Look at this(slightly more revised) example:

#!/usr/bin/perl -w
use strict;
sub test {
  my $yn = shift;
  my @array;
  @array = ( 'A','B','C','D' ) if $yn;
  print "$yn : $array[2]\n" if defined @array;
#  return \@array;
}
my $x=test(0); my $y=test(1); my $z=test(0);

Would you expect the output of this script to differ when you remove the  
"#" before the return?

Because that's what happens. (See the thread for the exact output.)

Why?

To me, it looks like a bug - probably a bad optimization.

Oh, this is tested with 5.00[45].

Kai
--
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
  - Russ Allbery (rra@stanford.edu)


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

Date: 05 Sep 1999 13:50:14 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Why doesn't my undef an array?
Message-Id: <yl906lgk1l.fsf@windlord.stanford.edu>

Kai Henningsen <kai-asstr-news=7OIcF3rlayB@khms.westfalen.de> writes:

> But why are we talking about defined() at all?  The original example
> does not call defined().  The revised example does not call defined(),
> either.

Well, your example certainly calls defined:

> Look at this(slightly more revised) example:

> #!/usr/bin/perl -w
> use strict;
> sub test {
>   my $yn = shift;
>   my @array;
>   @array = ( 'A','B','C','D' ) if $yn;
>   print "$yn : $array[2]\n" if defined @array;
                                 ^^^^^^^^^^^^^^
> #  return \@array;
> }
> my $x=test(0); my $y=test(1); my $z=test(0);

> Would you expect the output of this script to differ when you remove the
> "#" before the return?

Yes.  For that matter, I'd expect it to vary based on the phase of the
moon.  The output varies on the basis of a check of whether an aggregate
is defined.  The result of that check is completely nondeterminate from a
language specification standpoint.  It depends on gory implementation
details that are highly unpredictable.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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 V9 Issue 719
*************************************


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