[10598] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4189 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 10 14:08:22 1998

Date: Tue, 10 Nov 98 11:00:26 -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           Tue, 10 Nov 1998     Volume: 8 Number: 4189

Today's topics:
    Re: [WOW!] Re: History Lesson... <jdporter@min.net>
    Re: attaching a jpeg <merlyn@stonehenge.com>
        Can I assign an user account to script??? <vfox@nbnet.nb.ca>
    Re: deleting spaces between fields <jdf@pobox.com>
    Re: HELP , I just can figure this out <d-edwards@nospam.uchicago.edu>
        Help to change a soft <plateforme@wanadoo.fr>
    Re: Help! : a perl script to  tranlating a file structu <jdporter@min.net>
    Re: Help, I'm stuck again (this one may push the envelo <rwilliamson@uno.gers.com>
        Holding CGI file handle in object miko@idocs.com
    Re: How can I find out... (Orlando Frooninckx)
    Re: How can I find out... dave@mag-sol.com
    Re: How to pipe a file <ours@casema.net>
        Ignore this post xaqtnr@my-dejanews.com
    Re: Is there a compiler for Perl? <dolson093@sprintmail-ns.com>
    Re: Learning Perl by video scott@softbase.com
    Re: Net::TCP (Clay Irving)
    Re: Perl at Webjump - lonely perler! <ebohlman@netcom.com>
        Perl bug? die() and DESTROY (Kevin Reid)
        Perl class question xaqtnr@my-dejanews.com
        Perl Reg Exp Hanging on NT RoyStephan@yahoo.com
        Perl, sendmail or UNIX permission problems? michalk@awpi.com
        perl, UNIX or sendmail permission problem? michalk2395@my-dejanews.com
        perl, UNIX or sendmail permission problem? michalk2395@my-dejanews.com
    Re: Perl/Win'95 <lusol@Pandora.CC.Lehigh.EDU>
    Re: Perl2exe <indy@NOSPAMdemobuilder.com>
    Re: Perl2exe <indy@NOSPAMdemobuilder.com>
        perlscriptoutput from a perlscript via cgi <info@seneca-online.de>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Tue, 10 Nov 1998 12:53:59 -0500
From: John Porter <jdporter@min.net>
Subject: Re: [WOW!] Re: History Lesson...
Message-Id: <36487DB7.63BDC7FE@min.net>

Ilya Zakharevich wrote:
> 
> > http://www.salonmagazine.com/21st/feature/1998/10/cov_13feature.html
> 
> Unfortunately, I cannot track the author on AltaVista, since the
> name is so common...

Well, given his email address from Solon's masthead (aleonard@well.com),
you can find that Deja News has exactly 8 articles archived from him.

In addition to his stint at Wired before Salon, he also appears to
have written a few articles for Web Review.  Go to the search page at
http://webreview.com/wr/pub/universal/search/search.html
to search the Web Review archives.

-- 
John "Throbblefoot" Porter

Please Don't "Courtesy CC" me.
I read this newsgroup fanatically.  You know that!
("Emailed only" is fine, though.)

"The people at the Grey Hotel
  Are either aged or unwell." -- EG


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

Date: Tue, 10 Nov 1998 16:05:16 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: attaching a jpeg
Message-Id: <8cn25z1qku.fsf@gadget.cscaper.com>

>>>>> "Gareth" == Gareth Ennis <gary.ennis@strath.ac.uk> writes:

Gareth> ## Sends email to recipient

Gareth> open (MAIL, "| mail $recip_email") ;
Gareth> print MAIL "To: $recip_email\n";
Gareth> print MAIL "From: $sender_email\n";
Gareth> print MAIL "Subject: Subject title.\n" ;
Gareth> print MAIL "$message\n\n" ;
Gareth> close (MAIL);

No.  bad code.  No.  please delete.

What if $recip_email is "fred&barney@stonehenge.com", which is a
legitimate address, or "fred & rm -rf /", which is broken but cannot
easily be distinguished from legitimate addresses without an
1800-character regular expression.

NEVER pass email addresses to a shell.

NEVER pass email addresses to a shell.

Clear now?

(Correct answers are in the FAQ.)

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Tue, 10 Nov 1998 12:16:25 -0400
From: "Vaughn Fox" <vfox@nbnet.nb.ca>
Subject: Can I assign an user account to script???
Message-Id: <729ok5$f63$1@garnet.nbnet.nb.ca>


I'm running NT 4.0, service pack 3, IIS 4, and I have a Perl script that
produces an HTML page that indexes a given directories contents.  It's very
similar to windows explorer in that when you click on a directory you see
it's contents, or click on a file and up pops the appropriate application.

When I try to get this script to access a restricted area on my Intranet it
chokes up.  I'm assuming it's got to do with the script having the proper
permissions to read the contents of the folder.

Is there a way to assign a specific user name and password to a script (with
correct permissions), or read the requesting client user name from the  NT
logon and tie access back that way?

Thanks




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

Date: 10 Nov 1998 18:19:50 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: marx@idiom.com
Subject: Re: deleting spaces between fields
Message-Id: <m3d86vv51l.fsf@joshua.panix.com>

"Marcus J. Foody" <marx@idiom.com> writes:

> I need to get rid of leading and trailing spaces between fields.

What have you tried so far, and what part of it gave you difficulty?

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: Tue, 10 Nov 1998 17:37:34 GMT
From: Darrin Edwards <d-edwards@nospam.uchicago.edu>
Subject: Re: HELP , I just can figure this out
Message-Id: <tgg1bro3dt.fsf@noise.bsd.uchicago.edu>

Tom Phoenix <rootbeer@teleport.com> writes:

> On Mon, 9 Nov 1998, John Hardy wrote:
> 
> > No matter what I do it gags at
> 
> > $CMD->Parameters("lname")->{value}=$linesin{$lname};
> 
> > The error I am now getting is use of uninitialized variable. A value
> > used as either a hard refernce or symbolic reference must be a defined
> > value. Can't use an undefined value as a Hash reference.
> 
> 	$CMD->Parameters("lname")->{value}
> 
> Now you're using that returned value as a hashref, and dereferencing it.
> Hey, could that returned value have been undef?
> 
> 	$CMD->Parameters("lname")->{value}=$linesin{$lname};
> 
> Now you're storing a value ($linesin{$lname}) into that hash. It looks as
> if the only place where that error could have appeared is if that method
> call's return value was undef. Maybe you should check to see whether the
> method call is really doing what you want. Good luck!

If the value of "exists($linesin{$lname})" were false, couldn't
that also have produced the "Use of uninitialized value at..." error?
That's one of the things that always bites me when I use the "-w"
flag.  (Of course I vastly prefer to be bitten at compile time than
run time... :))  I agree that the method is also returning undef
though, because of the "Can't use an undefined value as a HASH reference"
error.

Darrin


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

Date: Tue, 10 Nov 1998 17:11:18 +0100
From: Plate Forme Jeunes Diplomes <plateforme@wanadoo.fr>
Subject: Help to change a soft
Message-Id: <364865A6.5C0EF32E@wanadoo.fr>

Il s'agit d'un message multivolet au format MIME.
--------------A7B55A5DFD2457989C92F1BF
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

    Hello,

     I Have wrote this software but I would like to change anything and I don't
know how can I do :

    I would like to answer at the end of the soft "do you work with other file? If
yes, restart the soft, if not, stop the soft"

    Thanks for your help,

    My email : corail@compuserve.com




--------------A7B55A5DFD2457989C92F1BF
Content-Type: application/x-perl; name="anpe.pl"
Content-Transfer-Encoding: 8bit
Content-Disposition: inline; filename="anpe.pl"

#!/usr/bin/perl 
print "Traduction du fichier Partenet\n";
print "Fred. FAUCOUNEAU Criateur <fred.freudian.com>\n";
print "Entrez le chemin complet et le nom du fichier ` traiter:\n";
$entree =<STDIN>; chop($entree);
open (FILE,$entree) or die ("Impossible de trouver le fichier, vous avez du vous tromper : $!");
open (FLUTE,'>traite.html') or die ("Oups,probleme :$!");

while (<FILE>) {
   chomp;                           #Demarrage des recherches des strings
   $offre=$1 if /(Offre.*?X)/;
   $date=$1 if /(Date.*?98)/;
   $Ale=$1 if  /(Ale.*?TD)/;
   $duree=$1 if /(Recherche.*?FONT>)/;
   $descriptif= $1 if /(R><FO.*?FONT>)/;
   $lieu=$1 if /(Lieu.*?FONT>)/;
   if (/(B>H.*?FONT)/) {            # On est a la fin du record"
      $horaires =$1;
#Zoup, on demarre l'impression dans le fichier 
print FLUTE "<HTML>";
print FLUTE "<BODY>" ;
print FLUTE "&nbsp;";
print FLUTE "<TABLE BORDER COLS=1>";
print FLUTE "<TR>";
print FLUTE "<TD><FONT SIZE=1><PRE><B>$offre					<B>$date				<B>$Ale</PRE></FONT>";
print FLUTE "<BR><FONT SIZE=1><B>$duree&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp";
print FLUTE "<CENTE$descriptif</CENTER>";
print FLUTE "<FONT SIZE=1><B><PRE>$lieu                                 			      <$horaires></PRE></TD>";
print FLUTE "</TR>";
print FLUTE "</TABLE>";
print FLUTE "</BODY>";
print FLUTE "</HTML>";

   }
}

--------------A7B55A5DFD2457989C92F1BF--



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

Date: Tue, 10 Nov 1998 13:17:40 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Help! : a perl script to  tranlating a file structure (pivoting/transposing)
Message-Id: <36488344.3A388808@min.net>

Athula Herath wrote:
> 
> transform 
> 
> Col1,   Col2,   Col3
> B1,     1,      0.3
> B1,     2,      0.4
> B1,     3,      0.3
> B2,     1,      0.2
> B2,     2,      0.2
> B2,     5,      0.4
> B2,     6,      0.1
> 
> Into
> 
>         B1      B2
> 1,      0.3,    0.2,
> 2,      0.4,    0.2,
> 3,      0.3,
> 5,      ,       0.4,
> 6,      ,       0.1,


#!/usr/local/bin/perl -w
use strict;

my %data;
my %B;

<DATA>; # discard the first line.

while (<DATA>) {
  chomp;
  my @col = split /,\s*/;
  $data{$col[1]}{$col[0]} = $col[2];
  $B{$col[0]} = '';
}

print join( "\t", '', sort keys %B ),"\n";
for my $b ( sort { $a <=> $b } keys %data ) {
  print "$b,\t",
    map( ( $data{$b}{$_} || '', ",\t" ), sort keys %B ),
    "\n";
}

__DATA__
Col1,   Col2,   Col3
B1,     1,      0.3
B1,     2,      0.4
B1,     3,      0.3
B2,     1,      0.2
B2,     2,      0.2
B2,     5,      0.4
B2,     6,      0.1

-- 
John "Throbblefoot" Porter

Please Don't "Courtesy CC" me.
I read this newsgroup fanatically.  You know that!
("Emailed only" is fine, though.)

"The people at the Grey Hotel
  Are either aged or unwell." -- EG


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

Date: Tue, 10 Nov 1998 10:38:46 -0800
From: "Rusty Williamson" <rwilliamson@uno.gers.com>
Subject: Re: Help, I'm stuck again (this one may push the envelope)
Message-Id: <pI%12.190$DA6.34754@news.connectnet.com>

Hi Clay!
My brain DID trun to 'Clay' didn't it! Thanks for the example. I wonder what
other advantages/disadvantages there are of putting the whole file in an
array versus reading one record at a time besides using a lot of memory with
the former method.


Clay Irving wrote in message <729hkt$ll1@panix.com>...
>In <RqQ12.186$DA6.31938@news.connectnet.com> "Rusty Williamson"
<rwilliamson@uno.gers.com> writes:
>
>>I myself feel I deserve that.  I don't have the Llama book and I will get
>>it.  However, I've read two other Perl books and have just started a
>>third -- so much stuff and I've learned how to do a lot.  But this is only
>>my 3rd script and somehow, when faced with this simple problem my brain
>>turns to clay.
>
>Is this a bad thing? :)
>
>>I've been flipping through all my books -- I guess I open
>>the file, read all the records into an array, close the file and then loop
>>through it searching each array element for the pattern and once I find
it,
>>extract the portions I need.  Is that it?  Somehow it seems simpler to use
>>back quotes and use the one line grep/awk statement, but then I'm back
were
>>I started and that's not the reason I'm trying to learn Perl.  But thanks
>>anyway.
>
>Or you could read one line at a time.
>
>  open F, "file.txt" or die "Can't open file.txt: $!\n";
>  while ($record = <F>) {
>      chomp $record;
>      if ($record =~ /foo/) {   # match your pattern
>          print "$record\n";
>      }
>  }
>  close F;
>
>--
>Clay Irving
>clay@panix.com




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

Date: Tue, 10 Nov 1998 18:42:13 GMT
From: miko@idocs.com
Subject: Holding CGI file handle in object
Message-Id: <72a1e5$sps$1@nnrp1.dejanews.com>

I hope somebody here can help me with this issue.  I
have earnestly searched the FAQs, DejaNews, and books
for an answer.

I'm having a problem storing the file handle from a CGI
in an object. The following code is a boiled down version
which highlights the specific problem:

 1    #!/usr/local/bin/perl -wI../lib
 2    use CGI;
 3    use CGI::Carp qw(fatalsToBrowser);
 4
 5    # top of page stuff
 6    print CGI->header();
 7
 8    # set objects
 9    my ($newcan,$myquery);
 10   $newcan=DataCan->new;
 11   $myquery=CGI->new();
 12
 13   # get file handle
 14   $inputdata=$myquery->param("upfile");
 15   $newcan->{filehandle}=$inputdata;
 16
 17   $newcan->reset;
 18   #seek($newcan->{filehandle},0,0) or die "can't reset";
 19
 20
 21   #############################################
 22   # DataCan
 23   package DataCan;
 24
 25   # new
 26   sub new
 27   {
 28   return bless {};
 29   }
 30
 31   # reset
 32   sub reset
 33   {
 34   my $self=shift;
 35   seek($self->{filehandle},0,0) or die "can't reset";
 36   1;
 37   }

The intent of this code is this:
 - create a CGI object
 - create a DataCan object
 - get the file handle for an uploaded file from the
   CGI and store it in the DataCan
 - in one of the methods of the DataCan, use
   the file handle

This program fails at line 35 where it attempts to use the file
handle. What confuses me is that if you comment out line 17 (which
calls the "reset" method) and uncomment line 18 (which does the
same thing as the reset method but not within the DataCan package)
then there is no failure.

So what am I missing here?  Thank you for any help you can offer.

-miko

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 10 Nov 1998 16:21:54 GMT
From: Frook@mail.dma.be (Orlando Frooninckx)
Subject: Re: How can I find out...
Message-Id: <36496804.13767226@193.74.210.130>

The problem is I do not have a shell account, so I want the output to
go to my browser.
 ========================================================
 Orlando Frooninckx 
 - - - - - - - - - - - - - - - - -
 E:mail: of@lms.be - of@ping.be - Frook@mail.dma.be
 URL: www.ping.be/crossbreed - bewoner.dma.be/Frook
---------------------------------------------------------------------------------------------------------


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

Date: Tue, 10 Nov 1998 16:55:35 GMT
From: dave@mag-sol.com
Subject: Re: How can I find out...
Message-Id: <729r67$n4c$1@nnrp1.dejanews.com>

In article <364849cd.6031833@193.74.210.130>,
  Frook@mail.dma.be (Orlando Frooninckx) wrote:
> Hi,
>
> does anyone know how I can find out which  PERL modules my ISP has
> installed? I asked him a week ago, but still no reply, that is why I
> wanna try to find out myself...

Orlando,

I have a script that does just that. You can see it in action at:

<http://www.mag-sol.com/cgi/perl_env.pl>

If you're interested, give me a shout and I'll mail you a copy. In fact, I
should probably zip it up and make it available for download from my web page.

Dave...

--
dave@mag-sol.com
London Perl M[ou]ngers: <http://london.pm.org/>
[Note Changed URL]

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 10 Nov 1998 16:59:12 +0100
From: "Casema" <ours@casema.net>
Subject: Re: How to pipe a file
Message-Id: <729nuo$ouv$1@sun4000.casema.net>

if you're on win nt..... use ntcron  :)
Michel
Francois Desarmenien wrote in message <363CE9EF.24CE619@club-internet.fr>...
>If you're using any U*ix flavor: use cron.
>If you're not, you're on your own...
>
>Francois
>
>anonymous wrote:
>
>> Hello,
>>    I was wondering if anyone can help me write a perl script that can
>> do the following:
>>    Lets say a file is in the following directory http://www.2123.com/
>> ~username/test/. Now after 7 days I want this file to be moved automat-
>> ically to a new directory(http://www.2123.com/~username/test/archives
>> and after 30 days I want this file to be deleted automatically.
>>              Any help would be appreciated
>




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

Date: Tue, 10 Nov 1998 18:34:27 GMT
From: xaqtnr@my-dejanews.com
Subject: Ignore this post
Message-Id: <72a0vj$sgs$1@nnrp1.dejanews.com>

aaaa

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 10 Nov 1998 08:38:27 -0800
From: "Olson, D. A." <dolson093@sprintmail-ns.com>
Subject: Re: Is there a compiler for Perl?
Message-Id: <36486bf3.0@news3.uswest.net>

For WINNT, check out www.demobuilder.com (Perl2exe - $49 for lite version -
ActiveState Perl; works great).


Regards,

Dan

--
Please remove "-ns" from my reply address when responding via e-mail.
--
Peter wrote in message <364e0e22.13992984@news.flex.com.au>...
>Is there a compiler for Perl?
>
>If not, does anyone know a similar language where I can convert Perl
>to a compiled self contained .exe?
>
>Peter




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

Date: 10 Nov 1998 19:24:57 GMT
From: scott@softbase.com
Subject: Re: Learning Perl by video
Message-Id: <36489309.0@news.new-era.net>

Casper Kvan Clausen (ckc@dmi.dk) wrote:

> I agree with this, but in addition I am unable to see what good a Perl
> video would do.

Different people learn in different ways. For a good treatment of this,
read Tony Robbins' two books. He has an approachable, non-academic
explanation of all this. Basically, there are three orientations --
visual, audio, and touch -- a person may have. One usually
predominates. Another is usually secondary.

Different types of learning materials appeal to different people.  The
lack of this realization is one reason some people are not cut out for
schools as we know them. They're getting instruction, but not the right
kind for their system.

People who are predominantly audio in nature with a visual secondary
would like videos the most. They would rather hear material than
anything else.  Visual people are usually prone to like videos too,
since they are usually not the type who like to read books anyway.
Especially if their secondary quality is audio. They'd like to see
something, but not a printed page, something real and lively.
Kinesthetics, the touch-oriented people, like books.  This is what I
am. The feel, solidity, and even smell of the book is as important as
what's in it. All these overlap to an extent, and there are people for
whom one sense does not dominate. But by and large, a significant
number of people would be of an orientation that would make learning
from a video preferable to anything else.  Therefore, a Perl video
would seriously fulfill a serious need.

Scott


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

Date: 10 Nov 1998 11:13:51 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Net::TCP
Message-Id: <729onv$4eu@panix.com>

In <xn667cnu2o8.fsf@spurv.td.org.uit.no> Tobias Brox <tobias@spurv.td.org.uit.no> writes:

>I can't find Net::TCP at CPAN?

It's part of the libnet-ext Bundle:

  http://www.perl.com/CPAN/modules/by-module/Net

-- 
Clay Irving
clay@panix.com


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

Date: Tue, 10 Nov 1998 15:58:48 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Perl at Webjump - lonely perler!
Message-Id: <ebohlmanF27r21.EJ8@netcom.com>

The Tinman <an000229@anon.fun.junk.ee> wrote:
:  John Porter said in a very helpful response to my query:
: >     <BODY bgcolor="#FFE000" background="bg.gif">
: >
: > bgcolor AND background, eh?  What's the point?

: PLEASE could all html programmers start using this? You will find the
: background color is the same color as the majority of the background
: image. The reason for this is simple: There are folks out there with
: images turned off. If (for example) my text color is flouro green and my
: bgcolor not set, if you have images turned off you will not be able to
: read the text. If I set my bgcolor to black even if images are off people
: can still read my pages.

To do this right, you need to set *all* of the possible BODY colors if you
set any of them or use a background image.  In your example, you aren't
setting the text color or any link colors, so your text might be invisible
if the user has chosen a default text color close to your background but
not instructed his browser to always override author color choices. 

I suppose "html programmer" could mean someone who writes programs that 
output HTML...



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

Date: Tue, 10 Nov 1998 10:06:36 -0500
From: kpreid@ibm.net (Kevin Reid)
Subject: Perl bug? die() and DESTROY
Message-Id: <1di8g70.c9l1he1nq3fpsN@slip166-72-108-36.ny.us.ibm.net>

I think I have found a bug in Perl: die() does not print out any message
when called inside a DESTROY block.

#!perl -w

use vars qw($bb);

sub X::DESTROY {
  print "Destroying ${$_[0]}\n";
  die;
  print "Destroyed ${$_[0]}\n";
}

sub X::new {
  my ($class, $str) = @_;
 
  return bless \$str, $class;
}

$aa = X->new('a');
$bb = X->new('b');

undef $aa;

__END__

When I run this, I get:

Destroying a
Destroying b

IMHO, die() ought to print out its message in DESTROY.

-- 
  Kevin Reid.      |         Macintosh.
   "I'm me."       |      Think different.


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

Date: Tue, 10 Nov 1998 18:05:07 GMT
From: xaqtnr@my-dejanews.com
Subject: Perl class question
Message-Id: <729v8k$qrt$1@nnrp1.dejanews.com>

This is my first adventure into Perl classes and such. I have printed several
online references for this and still can't get what I want. I've checked out
'perltoot - Tom's object-oriented tutorial for perl' and all the info found at
www.stonehenge.com/merlyn/UnixReview/.

My question is this... how do you get the value of a reference if it is in
another sub-routine (not sure if my terminology is correct here?). Here is the
code I am working with:

package SystemVars;

sub new{
  my $class = shift;
  my $self = { };
  bless ($self, $class);
  $self->{df} = { };
  return $self;
}

sub df{
  my $self = shift;
  @data = `df`;
  shift(@data);

  while (@data){
    $line = shift(@data);
    $line =~ s/\s+/ /g;
    ($file_sys,$k_blocks,$used,$avail,$capacity,$mounted_on) = split (/
/,$line);
    $self->{df}->{FILE_SYS} = $file_sys;
    $self->{df}->{K_BLOCKS} = $k_blocks;
    $self->{df}->{USED} = $used;
    $self->{df}->{AVAIL} = $avail;
    $self->{df}->{CAPACITY} = $capacity;
    $self->{df}->{MOUNTED_ON} = $mounted_on;
  }
  return $self;
}

I can get a hash reference, but no value if I do the following:

#!/usr/bin/perl5

use SystemVars;

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

$vars = SystemVars->new();
$fs = $vars->df(FILE_SYS);

print"FS => $fs<br>";


This gives me the following: FS => SystemVars=HASH(0x74048)

What I really want if the value that is stored in $file_sys.

What am I doing wrong here? Any help is definitely appreciated.

Thanks in advance.
--

Shay

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 10 Nov 1998 18:43:12 GMT
From: RoyStephan@yahoo.com
Subject: Perl Reg Exp Hanging on NT
Message-Id: <364880df.11685546@news.esinet.net>

I have the following Reg Exp:

if ($Stored_html =~
s/<a\s+href="(http.*?)".*?>([^<]*?)<.*?<br>(.*?)<.*?(\d\d\d?)%.*?(\d\d)&#160.(\w\w\w)&#160.(\d\d)//si)

    {
    $childurl 	    = $1;
    $headline 	    = $2;
    $Summary        = $3;
    $relevance      = $4;
    $day            = $5;
    $month          = $6;
    $year           = $7;

   )

This is parsing through an HTML document which is the result of a CGI
query.  All of the result pages have highly specified forms so this
regular expression matches them.  It is successively called as part of
a subroutine, that is why it strips out the refrences as it goes.

  Unfortunately there are *some* html pages which cause the regular
expression to hang.  

Has anyone ever had a regular expression simply not return?  

Any idea what combination of events is causing this happen?

I am operating on Windows NT (4)  with Perl  ActiveState build 316.  

--Roy

RoyStephan@yahoo.com
Internet Analyst
SNL Securities
Charlottesville, VA


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

Date: Tue, 10 Nov 1998 18:24:33 GMT
From: michalk@awpi.com
Subject: Perl, sendmail or UNIX permission problems?
Message-Id: <72a0d1$rvr$1@nnrp1.dejanews.com>

I have a virtual domain alias such as:
@foo.com        foodaemon

an alias entry such as:
foodaemon : "|\foodir\foodatabase"

my foodatabase is a perl program that looks something like:
$dbfile = foousers.db;
tie %dweebdata, DB_File, $dbfile, O_RDWR|O_CREAT, 0640 , $DB_HASH;
@inary = split(/,/,$dweebdata{$user});

Now the program normally runs as user bin and group bin from sendmail.
When I run it manually by first "su - bin" everything works.  If it
is invoked by sendmail, it will not retrieve the database entries, and
@inary is empty.  Yes, the script is being executed, as I see it doing
its thing in the log file.

I have tried suid with no success.
I have removed all of the permission restrictions on the script and the
database files with no success.  I also did that for the directories.

I have done $ENV in the perl script to emulate the environment from
when I su to bin.  That didn't work.

I can't tell if it's a permission problem in the commands perl uses
to access the database.  The methods are hidden.

I'm at a loss.  Any help is appreciated.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 10 Nov 1998 18:18:52 GMT
From: michalk2395@my-dejanews.com
Subject: perl, UNIX or sendmail permission problem?
Message-Id: <72a02d$rgg$1@nnrp1.dejanews.com>

I have a virtual domain alias such as:
@foo.com	foodaemon

an alias entry such as:
foodaemon : "|\foodir\foodatabase"

my foodatabase is a perl program that looks something like:
$dbfile = foousers.db;
tie %dweebdata, DB_File, $dbfile, O_RDWR|O_CREAT, 0640 , $DB_HASH;
@inary = split(/,/,$dweebdata{$user});

Now the program normally runs as user bin and group bin from sendmail.
When I run it manually by first "su - bin" everything works.  If it
is invoked by sendmail, it will not retrieve the database entries, and
@inary is empty.  Yes, the script is being executed, as I see it doing
its thing in the log file.

I have tried suid with no success.
I have removed all of the permission restrictions on the script and the
database files with no success.  I also did that for the directories.

I have done $ENV in the perl script to emulate the environment from
when I su to bin.  That didn't work.

I can't tell if it's a permission problem in the commands perl uses
to access the database.  The methods are hidden.

I'm at a lost.  Any help is appreciated.


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 10 Nov 1998 18:18:53 GMT
From: michalk2395@my-dejanews.com
Subject: perl, UNIX or sendmail permission problem?
Message-Id: <72a02e$rgh$1@nnrp1.dejanews.com>

I have a virtual domain alias such as:
@foo.com	foodaemon

an alias entry such as:
foodaemon : "|\foodir\foodatabase"

my foodatabase is a perl program that looks something like:
$dbfile = foousers.db;
tie %dweebdata, DB_File, $dbfile, O_RDWR|O_CREAT, 0640 , $DB_HASH;
@inary = split(/,/,$dweebdata{$user});

Now the program normally runs as user bin and group bin from sendmail.
When I run it manually by first "su - bin" everything works.  If it
is invoked by sendmail, it will not retrieve the database entries, and
@inary is empty.  Yes, the script is being executed, as I see it doing
its thing in the log file.

I have tried suid with no success.
I have removed all of the permission restrictions on the script and the
database files with no success.  I also did that for the directories.

I have done $ENV in the perl script to emulate the environment from
when I su to bin.  That didn't work.

I can't tell if it's a permission problem in the commands perl uses
to access the database.  The methods are hidden.

I'm at a lost.  Any help is appreciated.


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 10 Nov 1998 16:33:37 GMT
From: "Stephen O. Lidie" <lusol@Pandora.CC.Lehigh.EDU>
Subject: Re: Perl/Win'95
Message-Id: <729pt1$1mha@fidoii.cc.Lehigh.EDU>

Erik <eln@cyberhighway.net> wrote:
> In article <3647236E.D763E906@patriot.net>,
> 	Marquis de Carvdawg <carvdawg@patriot.net> writes:
>> Perl runs on both 95/98 and NT.  For the latest version of Perl for the
>> 32-bit Windows (ie, Win32) platforms, go to:
>> 
>> http://www.activestate.com

> Bad, bad, bad.  Win32 perl is included in the perl standard distribution,
> and it's a lot more likely to work with standard perl stuff (modules and
> such) than activestate's abomination.  You can pick up binaries for it
> at www.perl.com if you don't have a C compiler.

No, sir, ActiveState's Perl is what you want - it's the union of the "old"
ActiveState perl and the standard, and is now the win32 standard.


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

Date: Tue, 10 Nov 1998 14:01:49 -0500
From: "Indy" <indy@NOSPAMdemobuilder.com>
Subject: Re: Perl2exe
Message-Id: <72a25h$qo7$1@nntp2.uunet.ca>

The latest version of Perl2Exe is now compatible with the current ActivePerl
release 5.005 build 506.

It can be found at www.perl2exe.com

Indy



PS. When I post one message to a newsgroup, two copies end up on the
newgroup.  Anyone know why?


J|rgen Ibelgaufts wrote in message <3646A825.6023891D@gfc-net.de>...
>Hi,
>
>as far as i know perl2exe is not (yet?) compatible with perl 5.005 because
this
>version of perl uses system-dependent path names while perl 5.004 does not.
i
>currently see 3 possible ways out of this: 1. wait for a new version of
perl2exe
>:-( , 2. use the win32 binary distribution of perl 5.004 (not so good if
you need
>to use tk version 8) or copy all the perl files into a 5.004-compatible
directory
>tree (but this would probably be a lot of work and surely is far away from
a
>standard distribution).
>somewhere i read that perl2exe works with active state perl 5.005, but i
have not
>tried it.
>
>hope this helps
>
>juergen ibelgaufts
>
>-------------------------------------------------------------------
>
>Chris Liley schrieb:
>>
>> Trying to use Perl2exe I keep getting the error message:
>>
>> Warning: module Carp not found
>> Make sure that the perl\bin directory is in your path
>>
>> My path is as follows:
>>
PATH=C:\PERL\5.005\BIN\MSWIN32-X86-OBJECT;C:\PERL\5.005\BIN;C:\WINDOWS;C:\WI
>> NDOWS\COMMAND
>>
>> Which I think includes the relevant perl\bin !
>>
>> Further the script runs fine prior to compiling so Perl knows where to
find
>> the modules.  The modules are included via the "USE" statement.
>>
>> Is the directory your are in when calling perl2exe relevant ?  I am
calling
>> it from the directory I keep the script in, should I be in the BIN
directory
>> ?
>>
>> Any help appreciated,
>>
>> Chris Liley




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

Date: Tue, 10 Nov 1998 14:01:49 -0500
From: "Indy" <indy@NOSPAMdemobuilder.com>
Subject: Re: Perl2exe
Message-Id: <72a296$qp6$1@nntp2.uunet.ca>

The latest version of Perl2Exe is now compatible with the current ActivePerl
release 5.005 build 506.

It can be found at www.perl2exe.com

Indy



PS. When I post one message to a newsgroup, two copies end up on the
newgroup.  Anyone know why?


J|rgen Ibelgaufts wrote in message <3646A825.6023891D@gfc-net.de>...
>Hi,
>
>as far as i know perl2exe is not (yet?) compatible with perl 5.005 because
this
>version of perl uses system-dependent path names while perl 5.004 does not.
i
>currently see 3 possible ways out of this: 1. wait for a new version of
perl2exe
>:-( , 2. use the win32 binary distribution of perl 5.004 (not so good if
you need
>to use tk version 8) or copy all the perl files into a 5.004-compatible
directory
>tree (but this would probably be a lot of work and surely is far away from
a
>standard distribution).
>somewhere i read that perl2exe works with active state perl 5.005, but i
have not
>tried it.
>
>hope this helps
>
>juergen ibelgaufts
>
>-------------------------------------------------------------------
>
>Chris Liley schrieb:
>>
>> Trying to use Perl2exe I keep getting the error message:
>>
>> Warning: module Carp not found
>> Make sure that the perl\bin directory is in your path
>>
>> My path is as follows:
>>
PATH=C:\PERL\5.005\BIN\MSWIN32-X86-OBJECT;C:\PERL\5.005\BIN;C:\WINDOWS;C:\WI
>> NDOWS\COMMAND
>>
>> Which I think includes the relevant perl\bin !
>>
>> Further the script runs fine prior to compiling so Perl knows where to
find
>> the modules.  The modules are included via the "USE" statement.
>>
>> Is the directory your are in when calling perl2exe relevant ?  I am
calling
>> it from the directory I keep the script in, should I be in the BIN
directory
>> ?
>>
>> Any help appreciated,
>>
>> Chris Liley




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

Date: Tue, 10 Nov 1998 19:28:33 -0000
From: "Seneca" <info@seneca-online.de>
Subject: perlscriptoutput from a perlscript via cgi
Message-Id: <72a0hg$i1q@sun0.urz.uni-heidelberg.de>

Hi,
I have the following prob:
a cgi-script "calls" another perlscript I need the output from in my first
one.

example:

1) the cgi-script:

#!/usr/bin/perl
print "Content ...";
print "start<br>";
open(FILE, "secondperlscript |");
while(<FILE>) {
    print;
}
close(FILE);
print "ok!";
exit(0);

2) the other perlscript

#!/usr/bin/perl
open(TEXT, "<testtext.txt");
while(<TEXT>) {
    print;
}
close(TEXT);
exit(0);

Now the output in the Web-Browser is:
start
ok!

without the text I have in testtext.txt. If I start the first script from a
telnet I have what I want - Whats the problem with the second script ? Do I
have to create a child process or is it the problem with stdin/stdout ?

Thanx,
Stephan

email: lochner@rumms.uni-mannheim.de




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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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