[10630] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4222 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Nov 15 04:07:19 1998

Date: Sun, 15 Nov 98 01:00:19 -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           Sun, 15 Nov 1998     Volume: 8 Number: 4222

Today's topics:
        'Broken Pipe' error running MacPerl_WebServer on Linux <nmarino@home.com>
    Re: 64-bit Perl? (Ilya Zakharevich)
    Re: [PLEASE HELP]: Eliminate spaces at end of string (Peter J. Kernan)
    Re: [PLEASE HELP]: Eliminate spaces at end of string <uri@sysarch.com>
        allowed index variables in foreach loops <ghira@mistral.co.uk>
    Re: download never finishes (Peter J. Kernan)
    Re: Hard to match string (Peter J. Kernan)
        Help Wanted:  Perl CGI Programming, etc. <alsoft@cybercomm.net>
    Re: Help Wanted:  Perl CGI Programming, etc. (Ethan H. Poole)
    Re: HTML editor for perl? <mp@mkt2mkt.com>
    Re: iis 4 problem with perl .... <perlguy@technologist.com>
        need help with dbmopen() <jjpark@home.com>
        Newbie getopts() questions (Jang Choe)
    Re: Perl at Webjump - lonely perler! <mp3@howcoolitis.com>
    Re: Q: are symbolic refs really needed (was Re: Modific <uri@sysarch.com>
    Re: Q: pod inside data structures <zenin@bawdycaste.org>
    Re: Q: pod inside data structures (Ilya Zakharevich)
    Re: Reference returned by tie <hansmu@xs4all.nl>
        Setting a <SELECT> field's value using Perl <stephent@jps.net>
    Re: Setting a <SELECT> field's value using Perl (Alastair)
    Re: Win32, Samba and file tailing (Matt Knecht)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Sun, 15 Nov 1998 03:50:08 GMT
From: "Nick" <nmarino@home.com>
Subject: 'Broken Pipe' error running MacPerl_WebServer on Linux
Message-Id: <Qbs32.1557$QQ2.10010009@news.rdc1.pa.home.com>

I'm trying to run Clay Kasow's MacPerl_WebServer, a nifty little all-perl
http server, on my RedHat Linux 5.2 system, but it only runs for a little
while before it crashes with the final message "Broken Pipe". I'm assuming
that the IO::Socket module causes this. Does anyone know how to fix this?





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

Date: 15 Nov 1998 05:53:28 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: 64-bit Perl?
Message-Id: <72lq8o$eb8$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Berend Ozceri
<berend@istanbul.engr.sgi.com>],
who wrote in article <72l98k$9fvmr@fido.engr.sgi.com>:
> I appreciate all the input about additional packages for large integer support, 
> but that really is not what I am interested in. I have an application where 
> calling XXXX->new("YYYYY") everytime you need a new 64-bit constant is not 
> acceptable.
> 
> I know Perl can be compiled 64-bit native on systems that have a native "long" 
> type of 64-bits and that there is efforts to clean up the code so "long long" 
> types can be used on systems that have 32-bit longs in C. What I am asking is 
> what the status of that effort is? Can I compile Perl with native 64-bit 
> integers on a system with 32-bit int's and 64-bit long long's?

We all understood what you asked.  However, to get an answer to your
question you are in the same position as we all: search

 http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters

Ilya


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

Date: 15 Nov 1998 02:37:26 GMT
From: pete@localhost.localdomain (Peter J. Kernan)
Subject: Re: [PLEASE HELP]: Eliminate spaces at end of string
Message-Id: <72lep6$5u9$1@alexander.INS.CWRU.Edu>

In article <72l3ko$3m3$1@nnrp1.dejanews.com>,
	dannyboyvod@my-dejanews.com writes:
> If anyone knows how to do this, please email me back at
> baumbadj@flyernet.udayton.edu
> 
> All I need to know is how I can take out any spaces at the end of 
> a string.
> I have a cgi form set up that takes a person's email address, name 
> and other
> stuff.  But, if the user hit the space bar after entering his/her 
> name, I need
> to get rid of those spaces.  Does anyone know how to do this?
here is one way to do it

$s="  spaces    "; 
$n = '';
for ($i = length $s;; $i--) {
  $c = substr($s,$i,1);
  next if ($c eq " " and !$n);
  $n .= $c;
  unless ($i>0) {$s = reverse $n;last} 
} 

-- 
open SIG, "<$ENV{HOME}/.sig"         or die       "sigless!     $!"; 
$sig = do {local $/; <SIG>};         close SIG && print<<"$sig SIG";
        Pete Kernan  CWRU Physics and Statistics Depts
        http://theory2.phys.cwru.edu/~pete
$sig SIG


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

Date: 15 Nov 1998 01:35:52 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: [PLEASE HELP]: Eliminate spaces at end of string
Message-Id: <x7sofl5upj.fsf@sysarch.com>

>>>>> "PJK" == Peter J Kernan <pete@localhost.localdomain> writes:

  PJK> In article <72l3ko$3m3$1@nnrp1.dejanews.com>,
  >> name, I need
  >> to get rid of those spaces.  Does anyone know how to do this?
  PJK> here is one way to do it

  PJK> $s="  spaces    "; 
  PJK> $n = '';
  PJK> for ($i = length $s;; $i--) {
  PJK>   $c = substr($s,$i,1);
  PJK>   next if ($c eq " " and !$n);
  PJK>   $n .= $c;
  PJK>   unless ($i>0) {$s = reverse $n;last} 
  PJK> } 

i do hope you are being silly here with that code. if you are serious
that this is a good way to do blank stripping, you need to learn some
more perl. :-)

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
uri@sysarch.com  ------------------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: 15 Nov 98 08:17:55 +0000
From: "Adam Atkinson" <ghira@mistral.co.uk>
Subject: allowed index variables in foreach loops
Message-Id: <1197.623T2762T4975487@mistral.co.uk>

I've only just noticed that you can't do something like this:

foreach $a[0] (1..$n) {
print $a[0];
}

it says the foreach line is a syntax error

but

foreach (1..$n) {
$a[0]=$_;
print $a[0];
}

seems to be fine.

I've looked in the llama and the camel (and the FAQ) and they say
that the loop variable needs to be a scalar. well, $a[0] may be an
element of an array, but it IS a scalar value, surely?

Obviously, this isn't a real problem since I can use a normal foreach
loop and assign to my array element inside the loop.

Still, I'm curious.. am I missing something here? Is this a design
decision? Or am I doing something wrong?

(I have a set of nested foreach loops, each of which controls one
element in an array. Then in the middle, the array is checked for a
property I'm interested in. I originally wanted each foreach loop to
say

foreach $a[3] (@list3) {
 ...

}

I have various @list arrays containing lists of permitted values for
each element of the array.

Presumably I can't use hash entries as foreach control variables
either.

-- 
Adam Atkinson (ghira@mistral.co.uk)
What's purple and commutes? An abelian grape.



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

Date: 15 Nov 1998 02:57:32 GMT
From: pete@localhost.localdomain (Peter J. Kernan)
Subject: Re: download never finishes
Message-Id: <72lfus$5u9$2@alexander.INS.CWRU.Edu>

In article <72kg79$8uh$1@sun4000.casema.net>,
	"Casema" <ours@casema.net> writes:
> how come when printing HTML to a browser, using PERL
> the gauge meter never stops?
> I mean, "document done" is a message that seems never to appear....
> 
> print "content-type: text/html", "\n\n";
> print "<HTML><BODY>\n";
> print "TEST";
> print "</BODY></HTML>";
> 

worked fine on my server. if "TEST" is a bunch of stuff you may want
$|++;

before your first (logical) print statement
to autoflush stdout.

-- 
open SIG, "<$ENV{HOME}/.sig"         or die       "sigless!     $!"; 
$sig = do {local $/; <SIG>};         close SIG && print<<"$sig SIG";
        Pete Kernan  CWRU Physics and Statistics Depts
        http://theory2.phys.cwru.edu/~pete
$sig SIG


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

Date: 15 Nov 1998 01:59:37 GMT
From: pete@theory2.phys.cwru.edu (Peter J. Kernan)
Subject: Re: Hard to match string
Message-Id: <72lci9$j6j$1@alexander.INS.CWRU.Edu>

In article <72kjcl$8sn$1@news.monmouth.com>,
	"Matt" <splinter@monmouth.com> writes:
> I have the part I want starting with a <STA datehere> lots of html and
> symbols and crap here <datehere END>
> 
the problem is not specified unambiguously and some sample data would
help here but

perl -ne 'print if /^<START/ .. /^<[^>]*END>/' [html file]

might be a beginning towards a solution (assumes your new tags
are each at the beginning of a line)

if they rather bracket the line (on the same line)
perl -ne 'print if /^<START.*<[^>]*END>/' [html file]

may be preferred, and if they...
-- 
open SIG, "<$ENV{HOME}/.sig"         or die       "sigless!     $!"; 
$sig = do {local $/; <SIG>};         close SIG && print<<"$sig SIG";
        Pete Kernan  CWRU Physics and Statistics Depts
        http://theory2.phys.cwru.edu/~pete
$sig SIG


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

Date: Sun, 15 Nov 1998 00:28:07 -0800
From: "Alex Libman" <alsoft@cybercomm.net>
Subject: Help Wanted:  Perl CGI Programming, etc.
Message-Id: <72loks$u67$1@ostrich.cybercomm.net>

 Hello!  My name is Alex Libman (a.k.a. a_Thinker), I am the founder of
"ThinkTank Online Services" - a group of web-designers and programmers
dedicated to the construction of the ThinkTank website.  Several of our
members were recently forced to leave our group due to lack of free time,
and we now require new recruits.  If you are a programmer (CGI / PERL / Java
/ C++32 / etc), web-designer (HTML / etc), or an artist (web-ready graphics
/ etc); and you would like to join our profit-free group, please read on!


ABOUT OUR WEBSITE:
 The philosophy behind our website is based on many things. Our website's
main goal is to offer our users an accessible, easy, spam-free way to
communicate on many intellectual topics.  We will also offer many
CGI/Java-based services.  So far, all our members were members of the "AL's
Software" programming group (Oct 1995 - May 98).  That group was based on
functionalism and evolutionism - the ideas that it is the goal of everyone
to contribute to his/.her community.  The ThinkTank Project is our attempt
to create a great free website which will (in some way, no matter how bit or
how small) make the Internet Community better.  Our site is currently %100
profit-free, and for the first few weeks will be hosted by
"http://www.hypermart.net/".  If you are only interested in earning money,
you will not be interested in our offer.  If, however, you are looking for a
friendly group of programmers, which will help you create something
positive, put it online, and make it popular; you will greatly benefit from
partnership with us.  We will also help you make friends, improve your
skills, learn to work in groups, and you'll have something to mention in
your resume =).
 The main feature of our site will be a collection of about 130 sections
(grouped by into 13 topics).  For each section, there will be a message
forum and a chat-room.  The topics would include: "Intellectual Hobbies",
"Homework Exchange", "Sciences", "Programming", "Advanced Computing",
"General Politics", "Business and Economy", "Religion & Mortality", "Moral /
Social / Human Topics", "History / Mythology / Anthropology", "Language and
Literature", "Current Events", and "Misc."!  Right now me and my colleague
are working on a CGI script to handle the forums on our site.  Some of the
sections will be flagged as "debate sections" which will work like a survey
poll, but the voters will be able to attach comments to their votes.  Later,
we may add more "stuff" to each section, such as a Links page, etc.  A
3rd-Party Java Applet will be used for the chat-rooms.
 In addition to the discussion area (which is our first priority), our site
will offer many other services.  Another service which is already started is
"my ThinkTank" - a constantly-updated homepage (the users will be
recommended to make that page their browser's default start-up page).  The
search JavaScript module for this page is already almost finished - it will
let the user search any search engine, file archive, entertainment site,
etc; from one place.  It will also contain the links to headline
news/articles in many categories.  Those articles will be located on other
sites, such as CNN.COM or Yahoo.COM.
 We have many other ideas for the services we can offer.  There are many
websites out there which are based on a simple CGI script, and they
are -very-successful.  Some of our biggest future projects are:
 * "Today In History" - this CGI would display info on     events that
happened on the current day, or any other day of the year.  We have a
authorization to use a huge pre-compiled database of daily events.
 * A statistics report similar to the one offered by
"http://www.showstat.com/".
 * An anti-crack protection CGI script (and modules for several windows
programming languages), which would make it possible for windows programmers
to make applications that are completely piracy/crack-proof.
 * There are just the basic super-detailed descriptions of some of our
planned projects.  I snipped out about 10 smaller projects.  Feel free to
send us some of your ideas.  We need -YOU- to help us turn them into
reality.  Please consider giving us a hand with those projects.  If you
wish, your work can be distributed as a ThoughtWare product.   ThoughtWare
is the name of our programming group, the sister company of the ThinkTank
website.


CONDITIONS:
        Our group is obligation-free, no forms to fill out.  It is more like
a circle of friends than a programming group.  We welcome you to give us a
hand on some of our projects.  You will be given full credit for your work -
your name will be listed on the credits section of our site.  Please give us
a hand in any way you can.
 If you are interested, please e-mail me at "alsoft@cybercomm.net", or ICQ:
10281018.  Include as much info about you and your skills as you can,
including real name and career history.  Also, please mention how much time
will you be able to dedicate to us. If you have a pre-typed resume, please
attach it.
 I will get back to you within 8 hours.  We will chat on IRC or ICQ.  I will
introduce you to some of my co-workers, answer your questions, talk to you
about our projects, etc.  Then, if you are still interested, you can select
a method of contributing to our website that you are interested it.



 THANKS A LOT!

 Talk To You Later,
 -Alex Libman'





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

Date: Sun, 15 Nov 1998 07:27:06 GMT
From: ehpoole@ingress.com (Ethan H. Poole)
Subject: Re: Help Wanted:  Perl CGI Programming, etc.
Message-Id: <env32.1542$Y77.11116@news12.ispnews.com>

In article <72loks$u67$1@ostrich.cybercomm.net>, alsoft@cybercomm.net says...
> * An anti-crack protection CGI script (and modules for several windows
>programming languages), which would make it possible for windows programmers
>to make applications that are completely piracy/crack-proof.

Nothing like asking for the impossible, aye?

-- 
Ethan H. Poole              | Website Design and Hosting,
                            | CGI Programming (Perl & C)..
========Personal=========== | ============================
* ehpoole @ ingress . com * | --Interact2Day--
                            | http://www.interact2day.com/



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

Date: Sat, 14 Nov 1998 21:28:15 -0700
From: madame philosophe <mp@mkt2mkt.com>
Subject: Re: HTML editor for perl?
Message-Id: <364E5858.256AC2E3@mkt2mkt.com>

If you are on a mac try BBEdit:

http://www.barebones.com

It has good search and replace features, concatenation of files, and
other goodies.

MP

Clarence Hsu wrote:
> 
> I tried to use Frontpage to edit the HTML webpage
> inside a perl file, but it won't work. Is there
> a software that I can use?
> 
> Please email me: chsu@edfax.com
> Thanks.

-- 
madame philosophe
mp@mkt2mkt.com
"Have you thought lately?"


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

Date: Sat, 14 Nov 1998 20:46:38 -0600
From: Brent Michalski <perlguy@technologist.com>
Subject: Re: iis 4 problem with perl ....
Message-Id: <364E408E.1A1531C@technologist.com>

George Statis wrote:
> 
> I installed ActiveWare's perl on an NT server machine runing options pack 4
> .....
> 
> I have tryed to test perl by puting the script bellow on the cgi-bin
> directory of the server ...
 ..SNIP..
> the script works fine if i run it from the command prompt
> but if I try to run it from the server I get the following msg ...
> 
> ----------------------------------------------------------------------------
> CGI Error
> The specified CGI application misbehaved by not returning a complete set of
> HTTP headers. The headers it did return are:
> 
> hello
> ----------------------------------------------------------------------------
> what could be wrong ????????
> can anybody help me with that ???

You need to set up IIS to recognize Perl.

Go to: http://www.access.digex.net/~jurlwin/ and look under the "Hints
to get CGI under NT/95 running" section.

Good luck!
Brent
-- 
Java?  I've heard of it, it is what I drink while hacking Perl! -me
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$            Brent Michalski             $
$         -- Perl Evangelist --          $
$    E-Mail: perlguy@technologist.com    $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$


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

Date: Sun, 15 Nov 1998 02:58:52 GMT
From: Justin Park <jjpark@home.com>
Subject: need help with dbmopen()
Message-Id: <364E4432.40B66926@home.com>

ok, thanks for your input on my last question.
but i decided to use dbm instead of normal file

can someone tell me what's wrong with this code?

----
dbmopen(%users, '/usr/home/polar/html/usersfile', 0666) or die (print
$!);

#what ever goes here

dbmclose(%users);
---

i created the 'usersfile' before manually, and set it to 666.
currently the 'usersfile' is empty
the error message i get is no such file or directory


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

Date: 15 Nov 1998 05:21:32 GMT
From: gt6786b@acmez.gatech.edu (Jang Choe)
Subject: Newbie getopts() questions
Message-Id: <72locs$e59@catapult.gatech.edu>

I'm using the module Getopt::Std for this. The filename is "tep"
and this is basically my code:

use Getopt::Std;
getopts('h');
if (defined($opt_h) && $opt_h)
{
   ##do stuff here
}


Now, when I type "tep -h" it will do the ##do stuff here part. but if I 
type something like "tep -asdf" it gives me error messages like "Unknown
option: a" which you guys probably know it would.  But how would I write my
code so it won't give me the error messages when I run the program with an
unknown option?  Thanks.

--
That he is mad, 'tis true: 'tis true 'tis pity;
And pity 'tis 'tis true.  --Shakespeare, Hamlet, II, 2 

Quote of the day:  "





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

Date: Sun, 15 Nov 1998 11:37:35 +1100
From: "MP3" <mp3@howcoolitis.com>
Subject: Re: Perl at Webjump - lonely perler!
Message-Id: <72ld1i$odm$1@reader1.reader.news.ozemail.net>

But if you set the color, similar to what your background image is then you
should already have set the font color to cater for that.

i.e Mostly black background image, set color to Black.

Quite simple really isnt it :)

Have fun,

David
search@searchcentral.net

Eric Bohlman wrote in message ...
>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: 15 Nov 1998 01:22:07 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Q: are symbolic refs really needed (was Re: Modification of a read-only??)
Message-Id: <x71zn579ww.fsf@sysarch.com>

>>>>> "Z" == Zenin  <zenin@bawdycaste.org> writes:

  Z> Bart Lateur <bart.mediamind@ping.be> wrote:
  Z> : Uri Guttman wrote:
  Z> : >  BL> Can't you do that using eval?
  Z> : >  BL> 	eval "\$$Packagename\::$VarName = \"Some Value\"";
  Z> : >too slow! can't do that for all imports.
  Z> :
  Z> : Are you guessing, or do you have evidence to back you up?

i was making an educated guess and it seems like i was right from your
figures. i figured eval's parse would be much slower than just the  symbol
table munging required by a softref.

i wonder if you think i meant softrefs were slower than eval. i said the
opposite. 

  Z> 	Benchmark: timing 30000 iterations of Eval, SoftRef...
  Z> 	    Eval: 11 secs (11.95 usr  0.05 sys = 12.00 cpu)
  Z> 	 SoftRef:  1 secs ( 0.75 usr  0.00 sys =  0.75 cpu)

  Z> 	Yes, we do.  Mainly for safer black magic, but we do need them.

if so, why not make the default strict refs, like i proposed. if you
know how to hack symbol table black magic you know enough to enable
them. the newbies who think that softrefs are the way to build data
structures by name instead of hashes (and HoH) are the problem.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
uri@sysarch.com  ------------------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: 15 Nov 1998 01:00:35 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Q: pod inside data structures
Message-Id: <911091560.352811@thrush.omix.com>

Uri Guttman <uri@sysarch.com> wrote:
	>snip<
: a decent workaround and i will probably use it unless something better
: comes along. but it is not a proper answer to why it fails. i was
: drinking with randal tonight and he says it has to do with the parser
: expecting an expression token next. 

	Yep.  Personally, I think throwing the pod away in a preprocessing
	operation would be better then trying to have the parser deal with
	it inline, although that might make line number debug statements
	harder... 

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: 14 Nov 1998 22:31:12 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Q: pod inside data structures
Message-Id: <72l0bg$nem$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Uri Guttman 
<uri@sysarch.com>],
who wrote in article <x7af1u7m46.fsf@sysarch.com>:
> a decent workaround and i will probably use it unless something better
> comes along. but it is not a proper answer to why it fails. i was
> drinking with randal tonight and he says it has to do with the parser
> expecting an expression token next. 

What fails?  The initial version of embedded POD allowed PODs
everywhere.  I asked Larry to rework it, so that

foo
=bar(1,4,5);

works as expected.  Nowadays I do not know whether making it a fatal
error in 5.000 would be a better solution (so that near 5.004 we could
enable it).

Ilya


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

Date: 13 Nov 1998 22:58:12 GMT
From: Hans Mulder <hansmu@xs4all.nl>
Subject: Re: Reference returned by tie
Message-Id: <72idi4$9l3@news.euro.net>

"Jerome O'Neil" <jeromeo@atrieva.com> wrote:
>I am curious about the reference returned by 'tie.'  The docs state that
>'...the tie function returns a reference to the object.'  But I am not
>groking what object the reference points at.  Is it a reference to the
>tied data, or a 'tied object' that is something else?  

The tie function call a method in the class you're tying to
(TIEHASH or TIESCALAR, or TIEARRAY, depending on what you're tying).
That method must return a reference.  The tie funtion than does its
thing to that reference, and returns it to its caller.

>Some quick tests show that is is something else.  If this is the case,
>are there useful things I can do with it?  

If you tied something to a class you wrote yurself, then you should
know whether your class implements any interesting methods besides
the STORE and FETCH and such that perl is going to invoke.  If so,
then you'll want to invoke those methods by sending messages to
this object.

-- HansM


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

Date: Sat, 14 Nov 1998 21:05:58 -0800
From: Stephen Tang <stephent@jps.net>
Subject: Setting a <SELECT> field's value using Perl
Message-Id: <364E6134.8559CAF2@jps.net>

Hi,
   I have the following HTML tags in my form:
<SELECT NAME="TEST" SIZE="1">
                     <OPTION VALUE="1"> 1
                     <OPTION VALUE="2"> 2
                     <OPTION VALUE="3"> 3
                     <OPTION VALUE="4"> 4
                     <OPTION VALUE="5"> 5
                     <OPTION SELECTED VALUE="6"> 6
</SELECT>
I capture which option the user selected using a hash:
# code to split up the input into name-value pairs
$form{$name} = $value;

Suppose the user did not fill out the form completely.  I have my script
reprinting the form, but I am at a loss as to how to restore the values
of my <SELECT> tag.
In the code above, if the user chose '4' I would like the script to
reprint the form with the '4' selected, as if I wrote this.
<SELECT NAME="TEST" SIZE="1">
                     <OPTION VALUE="1"> 1
                     <OPTION VALUE="2"> 2
                     <OPTION VALUE="3"> 3
                     <OPTION SELECTED VALUE="4"> 4
                     <OPTION VALUE="5"> 5
                     <OPTION VALUE="6"> 6
</SELECT>

How do I get that selected parameter into the reprinted form?  I am
probably missing something simple here.

Thank you for your time.

Stephen Tang
stephent@jps.net




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

Date: Sun, 15 Nov 1998 02:55:33 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Setting a <SELECT> field's value using Perl
Message-Id: <slrn74sgjh.5a.alastair@calliope.demon.co.uk>

Stephen Tang <stephent@jps.net> wrote:
>
>Suppose the user did not fill out the form completely.  I have my script
>reprinting the form, but I am at a loss as to how to restore the values
>of my <SELECT> tag.
>In the code above, if the user chose '4' I would like the script to
>reprint the form with the '4' selected, as if I wrote this.
[snip]

I think you want 'sticky' behaviour. I do this using the CGI.pm Perl module -
check the docs at ;

http://www.genome.wi.mit.edu/~lstein/

Perhaps using a module is easier.

-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: Sun, 15 Nov 1998 06:40:08 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Re: Win32, Samba and file tailing
Message-Id: <cHu32.32744$%X2.4645697@news3.voicenet.com>

Matt Knecht <hex@voicenet.com> wrote:
>I have a Samba device mounted on an NT machine.
 ...
>When $line becomes undef, because we've hit the end of the file, I dump
>my debugging info.  Everything looks as it should: POSITION = OFFSET =
>SIZE and eof = TRUE.  After a while, new information get written to the
>file.  At that point, POSITION = OFFSET, but they don't match SIZE
>(Which, of course, is larger).  EOF still returns TRUE, even though
>there is more data to read.  I've tried closing the filehandle and
>seeking on it.
>
>The only thing I can think of is that this is a problem with Samba.
>Does anybody have any clues as to what else could be the problem?

After a few days of muddling with this problem, trying all sorts of
different solutions, I've come to the conclusion that this definitly is
a Samba problem.

Although the apparant size of the file seems to change (even to the -s
test), the information isn't there yet.  I can't pin Samba down to a
specific time to when the information will actually get there, either.

I worked around this problem by writing my information out in buffered
chunks, with the final line being a pointer to the next filename.  This
way, the process on the NT side won't ever have to worry about tailing
the file.  It just reads in full files at a time, and waits for the next
one to be written.  It's a poor workaround, but until Samba gets a
little more robust, I see little else that can be done.  Samba users,
beware!

-- 
Matt Knecht - <hex@voicenet.com>


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

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

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