[7120] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 745 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jul 19 07:07:12 1997

Date: Sat, 19 Jul 97 04:00:24 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 19 Jul 1997     Volume: 8 Number: 745

Today's topics:
     Re: $1 vs \1 <schae006@nelle.mc.duke.edu>
     Re: Back button (Abigail)
     Re: Canonical List of One-Liners (Abigail)
     Character Limitation Sub-Routine <done@npt.com>
     Extensions and static data <rroy@wildfire.com>
     Re: function pointer dereferencing <rootbeer@teleport.com>
     Re: How to round numbers in perl <pdcawley@aladdin.net>
     inherit AUTOLOAD from the SUPER class (Christian Roy)
     Re: milli-second and html file on remote server <jhi@alpha.hut.fi>
     Re: Null file handle: Is it the angle operator's ignora (Even Holen)
     Perl and frontpage personal web server <stuartg@plus-two.co.uk>
     Perl Conference San Jose: ROOM SHARE?? (Marc A. Smith)
     Re: problem with perl cgi script <keys@babylon5fan.corn.on.the.cob>
     Problem with Perl DES (Aviel Rubin)
     Re: References and Objects <zenin@best.com>
     Re: Retrieving multiple hash elements at once (M.J.T. Guy)
     Re: round off scalar values <rootbeer@teleport.com>
     Sorting Multiple Arrays (Daniel G. Drumm)
     Re: Subsecond time in perl (a la gettimeofday(2)) (dave)
     Tables with CGI.pm?? <rockwell@mcsjaz.shr.dec.com>
     Re: Text file cutoff (Phil Freed)
     Re: Uploading a file without using Net::FTP <deforres@acs.ucalgary.ca>
     Re: webfinder script needed <rootbeer@teleport.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Fri, 18 Jul 1997 20:05:38 -0400
From: "Stephen P. Schaefer" <schae006@nelle.mc.duke.edu>
To: TechMaster Pinyan <jefpin@bergen.org>
Subject: Re: $1 vs \1
Message-Id: <33D004D2.60FC019D@nelle.mc.duke.edu>

Just to confuse things even more deeply, look what I found:

perl -de 1
  DB<1> $foo='<a name="toc_chapter_1">Chapter 1</a>'."\n"

  DB<2> p ($foo=~/\<a name\=\"toc_chapter_([0-9]+)\"\>Chapter $1\</)

  DB<3> p ($foo=~/\<a name\=\"toc_chapter_([0-9]+)\"\>Chapter \1\</)
1

Does that mean $1 doesn't work on the left hand side?  But it does
sometimes.  Could someone clue me in?  My perl:

Summary of my perl5 (5.0 patchlevel 3 subversion 0) configuration:
  Platform:
    osname=linux, osver=2.0.27, archname=i586-linux
    uname='linux porky.redhat.com 2.0.27 #1 tue dec 3 15:02:19 est 1996
i586 '
    hint=recommended, useposix=true, d_sigaction=define
  Compiler:
    cc='cc', optimize='-O2', gccversion=2.7.2.1
    cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include'
    ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include'
    stdchar='char', d_stdstdio=define, usevfork=false
    voidflags=15, castflags=0, d_casti32=define, d_castneg=define
    intsize=4, alignbytes=4, usemymalloc=n, randbits=31
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lndbm -lgdbm -ldb -ldl -lm -lc
    libc=/lib/libc.so.5.3.12, so=so
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

@INC: /usr/lib/perl5/i386-linux/5.003 /usr/lib/perl5
/usr/lib/perl5/site_perl/i586-linux /usr/lib/perl5/site_perl .



TechMaster Pinyan wrote:
> 
> Ok... I have asked this before, and I am baffled by the CPAN
> documentation on this issue!
> 
> Using Perl5, I can type something like:
>         $string =~ s/\d{2}(\d{2})\d{2}\d/\1\2/;
> 
> HOWEVER, the CPAN documentation reads:
> 
> Note the use of $ instead of \ in the last example. Unlike sed, we use the
> \<digit> form in only the left hand side. Anywhere else it's $<digit>.
> 
> Now, it doesn't EXPLICITLY say you can't use \1 on the right, but it sort
> of hints it!
> 
> But it works perfectly for me... anyway... is there any MAJOR problem in
> using the \1 and \2 if it works?  If it works, it works, so why switch?
> 
> ----------------
> | "You care... but I don't care."
> |       - Ken Mayers
> ----------------
> Jeff "TechMaster" Pinyan | http://www.bergen.org/~jefpin
> HTML/CGI Designer and Consultant and JavaScripter
> jefpin@bergen.org | TechMasterJeff@juno.com
> Got a JavaScript/CGI/Perl question or problem?  Let me know!
> webXS - the new eZine for WebProgrammers! webXS@juno.com
> Visit us @ http://www.bergen.org/~jefpin/webXS


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

Date: Fri, 18 Jul 1997 16:48:12 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Back button
Message-Id: <EDIxCC.MMC@nonexistent.com>

Joelle D'Antin & Nicolas Gregoire (dantin@icp.grenet.fr) wrote on 1415
September 1993 in <URL: news:33CC83A9.23B8@icp.grenet.fr>:
++ Hi,
++ here a question that a lot of people asked before me but:
++ How to do a back button (like the one in Netscape, not a href) in my
++ HTML page.

You don't. See <URL: http://www.ny.fnx.com/abigail/HTML/Misc/back_button.html?


Abigail  --  Followups set.
-- 
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=$]*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'


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

Date: Fri, 18 Jul 1997 16:56:54 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Canonical List of One-Liners
Message-Id: <EDIxqv.6B@nonexistent.com>

Clark Dorman (clark@s3i.com) wrote on 1416 September 1993 in
<URL: news:den8yedun.fsf@s3i.com>:
++ 
++ Greetings fellow Perl'ers,
++ 
++ 	I've recently found a need for one-line Perl scripts (?
++ commands).  There are lots of neat things you can do, and I've been
++ trying to spread the word about Perl.  I get questions like, "Oh yah,
++ but can it do ______?".  The answer, of course, is "Yes", but I'd like
++ a list of one liners so I don't have to remember them all the time.  
++ 

A one line random image displayer:
perl -we 'print "Location: http://www.foo.com/images/image_${\int rand 100}.gif\n\n"'


Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=$]*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'


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

Date: Fri, 18 Jul 1997 12:17:08 -0500
From: Don Engelmeyer <done@npt.com>
Subject: Character Limitation Sub-Routine
Message-Id: <33CFA514.6838@npt.com>

Hello,

I need a sub-routine that counts the number of characters from a user's
post. Specifically, limiting their post to 200 characters
when they type in a text area.

Please Email if you have this or can explain how to do it.

TIA,
	Don


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

Date: Fri, 18 Jul 1997 13:33:12 -0400
From: Randy Roy <rroy@wildfire.com>
Subject: Extensions and static data
Message-Id: <33CFA8D8.4F400346@wildfire.com>

Can anyone tell my how a dynamically loaded perl extension gets its
static data initialized?  Thanks.

--rdr



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

Date: Wed, 16 Jul 1997 22:20:46 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Steven Elliot Pav <pav@LAS.alfred.edu>
Subject: Re: function pointer dereferencing
Message-Id: <Pine.GSO.3.96.970716220329.18795D-100000@kelly.teleport.com>

On 16 Jul 1997, Steven Elliot Pav wrote:

> can anybody think of some good reason(s) why perl shouldn't allow
> function pointer dereferencing in a way similar to the `shortcut'
> dereferencing for array and hash references?

A good question. In fact, it's so good that Randal mentioned the idea on
the #perl IRC channel a few months back. When Chip heard this, he whipped
out a patch to implement the idea. (Actually, Chip whips out _every_
patch. In the heyday of development on 5.004, a patch from Chip would
often follow within an hour of a bug report, often within minutes. I think
that, instead of making a diff from an updated file, he simply made up a
diff in his head and typed it directly into his mail program.  :-) 

But back to the story. I was talking to Randal on the phone and I
mentioned this new syntax to him, and he said that the idea was only
intended as a joke! It was certainly not a feature he was asking to be
introduced just before 5.004 would be released. But the patch was already
out the door, and it was too good to take back. So, this syntax is now a
feature in version 5.004.

    $result = $coderef->($parameter, $another);

There's a moral to this story: Never underestimate the effect Randal's
jokes can have. :-)

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

Date: 18 Jul 1997 10:59:16 +0100
From: Piers Cawley <pdcawley@aladdin.net>
Subject: Re: How to round numbers in perl
Message-Id: <54zprk1y17.fsf@gunnar.aladdin.net>

Andrew Johnson <ajohnson@gpu.srv.ualberta.ca> writes:
> Brand and Karina Hilton wrote:
> > In article <5qg7l7$bhn@lyra.csx.cam.ac.uk>,
> > M.J.T. Guy <mjtg@cus.cam.ac.uk> wrote:
> > >
> > >In article <5qg1ih$j0j$9@nntp2.ba.best.com>, Zenin  <zenin@best.com> wrote:
> > >>
> > >>      Boy, you work to hard...
> > >>
> > >>      $Float      = 1.2;
> > >>      $RoundInt   = int ($Float + 0.5);
> > >
> > >And you work inaccurately.   Think about negative numbers.
> > 
> > Unfortunately, your solution doesn't do much better for negative numbers.
> > (e.g., round -1.7 returns -1 and round -2.7 returns -2)
> > 
> > Like the FAQ says, printf and sprintf are best.  Specifically:
> > 
> >    sprintf "%1.0f", $myfloat
> > 
> 
> actually, my copy of perlfaq4 says 'sprintf() or printf()
> is usually the easiest route' not that they are *best*...
> for rounding to a specified number of digits, in this case to
> an integer, a specific method is almost certainly more
> efficient timewise:
> 
> sub round {
> 	my $int=shift;
> 	$int=int($int<0?$int-.5:$int+.5);
> }
> should perform better than the sprintf() version---though, for
> programmer efficiency, its more difficult to change it to round
> to some other number of digits. But if I know the data, and I'm going
> to do a lot of processing, I'd pick the custom version.

Also handy if you're going to be picky about

round(1.5) == 2
round(2.5) == 2

which is the strictly correct version. (okay so it doesn't come up
often, but since when did pedantry have anything to do with frequency?)


-- 
Piers Cawley -- Systems Genie for Aladdin
If a `religion' is defined to be a system of ideas that contains
unprovable statements, then Godel taught us that mathematics is not
only a religion, it is the only religion that can prove itself to be
one. -- John Barrow


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

Date: Fri, 18 Jul 1997 19:42:34 GMT
From: roychri@total.net (Christian Roy)
Subject: inherit AUTOLOAD from the SUPER class
Message-Id: <33cfc447.948669576@news.total.net>

I'm trying to inherit AUTOLOAD from the SUPER class, but don't know
how to go about it.

I want to overload the AUTOLOAD of the Default package.
since I don't want to copy and paste it in my overloaded AUTOLOAD, I
want to be able to call it...

It looks like the when I do     return $self->SUPER::AUTOLOAD(@_);
then the $AUTOLOAD variable in the default package is empty...

Maybe their is another way to do that...
Thanks!


Here is what I have :
Default.pm
A.pm
B.pm
t.pl

----------------------------
Default.pm
----------------------------
package Default;
use Carp;
use vars qw($AUTOLOAD);  # it's a package global
sub new {
  my($class) = shift;
  my(%param) = @_;
  my $HashRef = \%Fields;
  my($self) = { "_permitted"=>$HashRef,%Fields};
  bless $self,$class;
  return($self);
}

sub Permitted {
  my $self = shift;
  my(%Fields) = @_;
  my %Permitted = %{$self->{'_permitted'}};
  my %H = (%Permitted,%Fields);
  $self->{'_permitted'} = \%H;
  my %J = %{$self};
  %{$self} = (%J,%Fields);
}

sub Set {
  my($self) = shift;
  my(%param) = @_;
  foreach $Key (keys(%param)) {
    $self->$Key($param{$Key});
  }
}

sub AUTOLOAD {
  my $self = shift;
  my $type = ref($self)
             or croak "$self is not an object";
  my $name = $AUTOLOAD;
  $name =~ s/.*://;   # strip fully-qualified portion
  if($name eq "_permitted") {
    if (@_) {
      return $self->{$name} = shift;
    } else {
      return $self->{$name};
    }
  }
  unless (exists $self->{_permitted}->{$name} ) {
    croak "Can't access `$name' field in class $type";
  }
  if (@_) {
    return $self->{$name} = shift;
  } else {
    return $self->{$name};
  }
}


1;
======================================
----------------------------
A.pm
----------------------------
package A;
use B;
use Carp;
use vars qw($AUTOLOAD);

use Default;
@ISA = ('Default');
%Allowed = ("View"=>undef);

sub new {
  my($class) = shift;
  my(%Fields) = ("Equip"=>undef);
  my($self) = $class->SUPER::new;
  bless $self,$class;
  $self->Permitted(%Fields);
  $self->Set(%param);
  return $self;
}

sub AUTOLOAD {
  my $self = shift;
  my $type = ref($self)
             or croak "$self is not an object";
  my $name = $AUTOLOAD;
  $name =~ s/.*://;   # strip fully-qualified portion
  my(%TheAllowed) = %A'Allowed;
  if(exists($TheAllowed{$name})) {
 #   print "You can proccedd with $name<BR>\n";
      my $b = new B;
      return $b->$name(@);
  } else {
#    print "Call the parent AUTOLOAD<BR>\n";
    return $self->SUPER::AUTOLOAD(@_);
  }
}

1;

======================================
----------------------------
t.pl
----------------------------
use A;

$a = new A;

$a->Equip;
$a->View;


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

Date: 18 Jul 1997 21:20:30 +0300
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: milli-second and html file on remote server
Message-Id: <oeehgdste6p.fsf@alpha.hut.fi>


: I am new to this newsgroup, but I've read almost all FAQs about
: Perl and CGI on the web. (I said "almost", so don't blame me if 
: these two questions do exist in a FAQ at a corner of the web :-)

I blame you.

CPAN exists at 70+ sites at the web -- many of which are certainly not
'corners' like ftp.digital.com, uiarchive.uiuc.edu, 

: Q1: Can perl display current time in milli-second? With a small
: C program, it can be done easily. But how about Perl?

http://www.perl.com/CPAN/modules/by-module/Time/Time-HiRes-01.10.tar.gz

: Q2: Can I use perl to get the content of a html file on a remote
: server? Like I use open to get a file content on my own server.

http://www.perl.com/CPAN/modules/by-module/WWW/libwww-perl-5.10.tar.gz

-- 
$jhi++; # http://www.iki.fi/~jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen


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

Date: 18 Jul 1997 16:34:09 GMT
From: evenh@ra.pvv.ntnu.no (Even Holen)
Subject: Re: Null file handle: Is it the angle operator's ignorance or mine?
Message-Id: <slrn5sv6kg.na6.evenh@ra.pvv.ntnu.no>

In article <xz267uaumth.fsf@uebemc.siemens.de>, Ronald Fischer wrote:
>I use the following program 'cols' to compute the size of the longest
>line in a set of files:
[snipped]
>This works fine as long as I do not supply a filename starting with a
>'+'. But when I write (for example)
>    cols +foo
>I get the output
>    Can't open +foo: No such file or directory
>although
>    cols ./+foo
>and
>    cols <+foo
>work as expected. It looks to me as if the '+' has a special
>significance (like turning off some options), but I don't see andy
>relationship to the <> operator.

If you look into the documentation you will find the explanation of
this... It's kind of interesting. Lets cut and paste from the docs.

A little snippet from `man perlop`:
     The null filehandle <> is special and can be used to emulate
     the behavior of sed and awk.  Input from <> comes either
     from standard input, or from each file listed on the command
     line.  Here's how it works: the first time <> is evaluated,
     the @ARGV array is checked, and if it is null, $ARGV[0] is
     set to "-", which when opened gives you standard input.  The
     @ARGV array is then processed as a list of filenames.  The
     loop

         while (<>) {
             ...                     # code for each line
         }

     is equivalent to the following Perl-like pseudo code:

         unshift(@ARGV, '-') if $#ARGV < $[;
         while ($ARGV = shift) {
             open(ARGV, $ARGV);
             while (<ARGV>) {
                 ...         # code for each line
             }
         }

     except that it isn't so cumbersome to say, and will actually
     work.  It really does shift array @ARGV and put the current
     filename into variable $ARGV.  It also uses filehandle ARGV
     internally--<> is just a synonym for <ARGV>, which is
     magical.  (The pseudo code above doesn't work because it
     treats <ARGV> as non-magical.)

>From this one can conclude with that when you`re using +foo as filename
it actually does a:
   open (ARGV, "+foo")

And if we read from `man perlfunc`:
   open FILEHANDLE
    ...
             If the filename begins with '<' or nothing, the file
             is opened for input.  If the filename begins with
             '>', the file is truncated and opened for output.
             If the filename begins with '>>', the file is opened
             for appending.  You can put a '+' in front of the
             '>' or '<' to indicate that you want both read and
             write access to the file; thus '+<' is almost always
             preferred for read/write updates--the '+>' mode
             would clobber the file first.  The prefix and the
             filename may be separated with spaces.  These
             various prefixes correspond to the fopen(3) modes of
             'r', 'r+', 'w',


So it seems like it tries to open +foo with both read and write
permissions and that fails... Do also read in `man perlfunc` about other
not wise characters to have in front...

To the guru-guys: Is this the way it's actually are supposed to behave?
  Or should the expansion of <> be somewhat more like:
       open (ARGV, " $ARGV")
  instead of
       open (ARGV, $ARGV)
  to prevent this from happening? I'm feeling like saying that this a bug
  or feature...

Regards,
Even Holen
-- 
<><   Even Holen, evenh@pvv.ntnu.no, http://www.pvv.ntnu.no/~evenh/   :-)


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

Date: Fri, 18 Jul 1997 16:33:18 +0100
From: Stuart Green <stuartg@plus-two.co.uk>
Subject: Perl and frontpage personal web server
Message-Id: <33CF8CBE.2860@plus-two.co.uk>

I'm a bit of a perl newbie and have to test my scripts by uploading via 
telephone to our ISP.
I there a way ,maybe using microsoft personal web server that I can run
perl scripts locally from my browser and still acsess the enviromentle
varibles.

Please Help

Matthew


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

Date: Fri, 18 Jul 1997 21:24:18 GMT
From: smithm@nicco.sscnet.ucla.edu (Marc A. Smith)
Subject: Perl Conference San Jose: ROOM SHARE??
Message-Id: <5qom97$7ci@mtinsc04.worldnet.att.net>


Hello!

I plan on attending the O'Reilly Perl Conference Aug 19-21.  If anyone
is interested in a room share for the conference, please let me know!

Regards,

MArc Smith
   _________________________
 /______________________    | University of California, Los Angeles 
|    _________________ /|   | Department of Sociology
|   | |_______________|_|   |         
|   |/______________________| Email: smithm@ucla.edu
|__________________________/  http://www.sscnet.ucla.edu/soc/csoc



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

Date: Fri, 18 Jul 1997 18:41:54 -0600
From: Keys <keys@babylon5fan.corn.on.the.cob>
Subject: Re: problem with perl cgi script
Message-Id: <33D00D52.71E8D43C@babylon5fan.corn.on.the.cob>

benjamin j snyder wrote:
> 
> I am writing a cgi script in perl that is supposed to create three web pages
> from input it receives from the web browser.  When I run the script from the
> command line it appears to hang as if stuck in an infinte loop.  When I use the
> browser to run the script I get a message that the files couldnt be opened (a
> check I put in the script myself), but this message is not displayed when ran
> from the script.
> 
> To open the files I am using the foolowing command:
> 
> open (CHECK, "> [path and file name to be opened])
> 
> I am doing the check I mentioned earlier at this point with the following type
> of line:
> 
> if (!(open (CHECK, "> [filename]"))) {
>     ### display error message
>     exit(1);
> }
> 

Did you remember to close the file when you're done?


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

Date: 18 Jul 1997 15:01:25 -0400
From: rubin@quip.eecs.umich.edu (Aviel Rubin)
Subject: Problem with Perl DES
Message-Id: <5qoei5$2o3$1@quip.eecs.umich.edu>

I am using Eric Young's Perl DES library, des.pm. Running on a 64 bit
machine, I ran into a problem. Has anyone heard of this?

Some code that I wrote that uses Perl des.pm produces different
output for Perl version 5.003 than it does for 5.004. Has anyone
had this experience too? Any idea what's happening?

Thanks,
Avi

*********************************************************************
Aviel D. Rubin                                 rubin@research.att.com
Secure Systems Research Dept.                Adjunct Professor at NYU
AT&T Labs - Research
180 Park Avenue                   http://www.research.att.com/~rubin/
Florham Park, NJ 07932-0971                    Voice: +1 973 360-8356
USA                                            FAX:   +1 973 360-8809

   --> Check out http://www.clark.net/pub/mjr/websec/ for a new
       book on web security (The Web Security Sourcebook).
*********************************************************************



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

Date: 18 Jul 1997 16:55:29 GMT
From: Zenin <zenin@best.com>
Subject: Re: References and Objects
Message-Id: <5qo761$q76$1@nntp2.ba.best.com>

w.stanton@auckland.ac.nz wrote:
	>snip<
>     $self->{eval_list} = [ ]; # Associates evaluations with design spaces
> I wish to reference this array later and I expect to use the following...
>     push @$self->{eval_list}, [$evaluation, $design];
> But this does not compile. The error message is...
> Type of arg 1 to push must be array (not associative array elem) at
>  DesignSpaceList.pm line 36, near "];"
> But if I say...
>     my $ref = $self->{eval_list};
>     push @$ref, [$evaluation, $design];
> All is OK.
> Obviously I have a missunderstanding of the syntax.  But what is it?  

	Remember that @$ref is simply shorthand for @{ $ref }.
	This being the case, @$self->{eval_list} "dereferences" $self
	first an array (which it isn't, of course) and then trys to
	dereference a hash element out of it.  This, is probably not
	what you wanted to do. :)

	Deref the entire thing:

	push @{ $self->{eval_list}, [ $evaluation, $design ];

	$MyEval = $self->{eval_list}->[0]->[0];

	May I make a recomendation?  Use another hash for this
	last level as it cleans up the code (IMO anyway) and allows
	for easier scaling:

	push @{ $self->{eval_list} }, {
		Evaluation	=> $evaluation,
		Design		=> $design,
	};

	$MyEval = $self->{eval_list}->[0]{Evaluation};

	foreach $member (@{ $self->{eval_list} }) {
		$MyEval = $member->{evaluation};
	}

-- 
-Zenin
 Quake Clan After Shock (Did you feel that?)
 The Bawdy Cast - Rocky Horror Picture Show (San Jose, CA)
 zenin@best.com


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

Date: 18 Jul 1997 14:34:13 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Retrieving multiple hash elements at once
Message-Id: <5qnut5$lkh@lyra.csx.cam.ac.uk>

Chris Schleicher <chrissch@cs.uoregon.edu> wrote:
>Scott Grosch <grosch@ichips.intel.com> wrote:
>>Is there a way to do that with less typing?  For example, something like:
>>
>>@_ = $$ref{ (one, two, three) };
>
>Yup:
>
>    @_ = @_{$ref}{one,two,three};
           ^
           ^

I assume that's just a typo.   And you don't need all those {}:

     @_ = @$ref{one,two,three};


Mike Guy


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

Date: Fri, 18 Jul 1997 18:43:54 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Devin Anderson <dev@sgi.net>
Subject: Re: round off scalar values
Message-Id: <Pine.GSO.3.96.970718184305.17347P-100000@kelly.teleport.com>

On Fri, 18 Jul 1997, Devin Anderson wrote:

> I am doing some major price calculation. How can I round off correctly
> to 2 decimal places without using a printf statement to do it? 

Calculate using pennies instead of dollars, and add the decimal point when
doing output. Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

Date: 17 Jul 1997 05:19:01 GMT
From: dgd@nebula.is.rpslmc.edu (Daniel G. Drumm)
Subject: Sorting Multiple Arrays
Message-Id: <5qka05$jio@nebula.is.rpslmc.edu>

I've looked through Turqoise Camel and TC's Perl.com pages on Data
Structures, but I'm unclear on the best way to sort multiple arrays.

I have 6 arrays: @name, @time, @color, @foo, @bar, @id

Now, since I did a split() and push() in a while loop, $name[5]
corresponds to the guys's id in $id[5], etc.

I want to sort by ONE array, say @id, and not get out of sync with the
other arrays. 

--
--
Daniel G. Drumm - ddrumm@rush.edu
Rush Presbyterian St. Luke's Medical Center - Chicago, IL
Network Division - Information Services


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

Date: Fri, 18 Jul 1997 00:21:52 GMT
From: over@the.net (dave)
Subject: Re: Subsecond time in perl (a la gettimeofday(2))
Message-Id: <33ceb649.7165185@news.one.net>

Chuck Ocheret <chuck@NYC.Thinkbank.COM> wrote:

>Perhaps I'm just blind but I can't seem to find the equivalent of
>gettimeofday() in Perl.  Is it really there or is there some other
>interface to get subsecond time in Perl.

Book says that the select (among file descriptors) function can be
used without file descriptors to just get a higher res timeout but
that it may not work on all machines.  That's probably a fair
assumption for most high res timers, though isn't it?  I have yet to
try it.


Dave
|
| Please visit me at http://w3.one.net/~dlripber
|
| For reply by email, use:
| dlripber@one.net
|________


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

Date: Fri, 18 Jul 1997 11:07:31 -0500
From: dave rockwell <rockwell@mcsjaz.shr.dec.com>
Subject: Tables with CGI.pm??
Message-Id: <33CF94C3.ECB01F3A@mcsjaz.shr.dec.com>

anyone seen any examples of table generation using 
the excellent CGI.pm module (I have 2.36)?

I tried to deduce some usage from current documentation
like TR(-data=>['one','two','three']; after doing
use CGI':all' but so far have not gotten lucky....thanks


-- 
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
David T. Rockwell ( Rocky)   "Duke of URL" 
Telephone: 508-841-6079       Fax:508-841-6100 
Digital Equipment Corp   334 South St. Shrewsbury MA 01545-4195 
rockwell@mcsjaz.shr.dec.com or rocky@rocky.com  
Intranet: http://www-mcs.shr.dec.com/roxweb/  BizCard: /rocky.htm
WebSite: http://www.rocky.com/~rocky
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-


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

Date: Sat, 19 Jul 1997 03:42:41 GMT
From: phil@freed.com (Phil Freed)
Subject: Re: Text file cutoff
Message-Id: <33d034f5.3705967@newshost.cybertours.com>

>over the old file.  For some reason, it inserts the new person fine and
>continues reading the lines from the old file up until some place near
>the bottom of the file, which varies depending on the length of the
>person I inserted, and suddenly stops.  The new file isn't complete.
>Could there be some kind of memory leak?

The problem is that you're copying a file that you haven't closed yet.
Your output is being buffered by Perl, and the last bit of the file
hasn't yet been written to disk.

>   ....
>   while ($line = <FILE1>) {  #write remaining lines
>      print FILE2 ($line);
>
>   }

Try inserting:
    close FILE1;
    close FILE2;

Closing FILE2 is all you really need here, but closing all your files
is good form.

>   `copy alumni.log alumni.bak`;
>   `copy alumtemp.txt alumni.log`;
>}

Hope it helps.

--phil   <phil@freed.com>


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

Date: Fri, 18 Jul 1997 12:49:46 -0600
From: Euan Forrester <deforres@acs.ucalgary.ca>
To: "Jeffrey R. Drumm" <drummj@poa.mmc.org>
Subject: Re: Uploading a file without using Net::FTP
Message-Id: <5qodse$ndo@ds2.acs.ucalgary.ca>

On 18 Jul 1997, Jeffrey R. Drumm wrote:

> What makes you think you have to do *anonymous* FTP with Net::FTP? That
> restriction would severely limit its usefulness . . .
> 
> #!/usr/bin/perl
> 
> use Net::FTP;
> 
> $ftp = Net::FTP->new("hostname");
> $ftp->login("name","password");
> $ftp->cwd("/directory");
> $ftp->get("filename");
> $ftp->quit;
> 
> Note that you would probably want to check for return status on all the
> above methods . . . I merely (mostly) lifted the example from the
> documentation. Note the $ftp->login() method; it takes *any* name and
> password as an argument  . . . you merely need to supply valid ones for the
> system in question.

I thought of this, but wouldn't it be a bit of a security risk to let the
user have my access to the system? It's a moot point anyway, because (from
the help of another kind soul on this newsgroup) I managed to get the
application/octet-stream method to work properly. Thanks anyway, though!



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

Date: Fri, 18 Jul 1997 17:44:41 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Mark Kilarjian <mkilar@newshost.li.net>
Subject: Re: webfinder script needed
Message-Id: <Pine.GSO.3.96.970718174230.17347G-100000@kelly.teleport.com>

On 18 Jul 1997, Mark Kilarjian wrote:

> I'm a relative newcomer to perl, and need a script to locate and
> identify all of the web servers on my network. 

I think that SATAN can do that (and a lot more).

> I'd need to do a blanket scan such that port 80 is scanned on a range of
> addresses,

Web servers don't have to run on port 80. Do you want to find servers on
port 8880 or 8080 as well? 

You could use LWP to make up a utility to do this; it should take about
ten lines of code and about five minutes to write. Seriously, it's that
easy! Hope this helps! 

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

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

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