[9592] in Perl-Users-Digest
Perl-Users Digest, Issue: 3186 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 17 12:17:32 1998
Date: Fri, 17 Jul 98 09:01:19 -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 Fri, 17 Jul 1998 Volume: 8 Number: 3186
Today's topics:
[CFP] On to Perl 5.005: Beta testing begins (Gurusamy Sarathy)
Re: Callling Perl script from Java app (Kevin R Falcone)
Re: clp.moderated (John Moreno)
Coding Quiz (was Re: efficiency: print<<"xxx" vs. print <simon@new-mediacom.com>
Re: Coding Quiz (was Re: efficiency: print<<"xxx" vs. p (Steve Linberg)
Re: confusing problem with perl make (M.J.T. Guy)
Re: Deactivating mod_perl <dfetter@shell4.ba.best.com>
Re: efficiency: print<<"xxx" vs. print <cwenk@syntek-usa.com>
Re: FTP between two Unix machines <Tony.Curtis+usenet@vcpc.univie.ac.at>
Re: FTP between two Unix machines (I R A Aggie)
How to interprete What Sucks/Rules? <yong@shell.com>
Hungarian Notation in Perl (Was Re: %vHash = $vScalar d (Steve Linberg)
I'm baffled.. (and an amateur:) <jeremiah@ganymede.net>
Re: Invoking a Programme from HTML. <upsetter@ziplink.net>
Re: invoking href="www.mysite.com/cgi-bin/perl_script?$ <upsetter@ziplink.net>
Re: matching problem <maierc@chesco.com>
Re: matching problem <maierc@chesco.com>
Problem with output of data to webpage (Josh Stegall)
Re: Problem with output of data to webpage (Steve Linberg)
QUE: Getting NVARCHAR data with Oraperl <mike@tech.eurodyn.com.gr>
regexp help? <radin@ews.uiuc.edu>
Re: Reliability of random numbers <Eric.Zylberstejn@wanadoo.com>
Remote login question <apadki@cisco.com>
Re: Reverse an associative array (Mark-Jason Dominus)
Re: Reverse an associative array <quednauf@nortel.co.uk>
Re: Reverse an associative array (Larry Rosler)
SDBM and locking <clint@netcomuk.co.ukXX>
Re: Silly things to do in Perl (or: is that Laptop wate (Jeffrey R. Drumm)
Re: Silly things to do in Perl (or: is that Laptop wate <Tony.Curtis+usenet@vcpc.univie.ac.at>
system() return values <gcoulomb@gpu.srv.ualberta.ca>
Re: URGENT: HELP!!!! <jgoerzen@southwind.net>
Re: URGENT: HELP!!!! <Eric.Zylberstejn@wanadoo.com>
usage of open2.pl <smalkawi@engin.umich.edu>
Variables <hvanlint@lodestar.be>
Re: Variables (David Cantrell)
Win32 and chdir problems <bruce.browning@tivoli.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 17 Jul 1998 13:53:21 GMT
From: gsar@engin.umich.edu (Gurusamy Sarathy)
Subject: [CFP] On to Perl 5.005: Beta testing begins
Message-Id: <6onl0h$52j$1@news.neta.com>
The release of Perl 5.005 is imminent, and we are in the process of testing
beta versions. Version 5.005 will be a major release that incorporates all
maintenance and development changes since the last major release, 5.004.
The 5.005 release will contain many significant changes, and the goal of
the beta test phase is to identify and fix all inadvertent incompatibilities
or bugs we may have introduced. (A brief summary of changes is included at
the end.)
If Perl is used in your organization, we urge you to strongly consider
participating in the beta test process. Wide participation helps us in
ensuring compatibility with previous releases.
You can find the beta release from any of the Comprehensive Perl Archive
Network (CPAN) sites worldwide. To select from a list of sites, go to:
http://www.perl.com/CPAN
Note the absence of a trailing `/'. The beta release can be found at:
http://www.perl.com/CPAN/authors/id/GSAR/perl5.005-beta1.tar.gz
Further updates, if needed, will be published as beta2, beta3 and so on,
and will be available at the same location.
Perl builds and runs on a bewildering number of platforms. Virtually all
known and current Unix derivatives are supported, as are VMS, DOS, OS/2,
Windows, QNX, BeOS, and the Amiga. There are also the beginnings
of support for MPE/iX. If you find that your platform is unsupported,
do let us know.
There may be known problems with this beta release on some platforms. Fixes
for platform specific problems in this release can be found as patches. For
example, VMS has a small known problem, and the fix is at:
http://www.perl.com/CPAN/authors/id/GSAR/perl5.005-beta1-VMS-1.patch
Be sure to read the comments at the top of the patch to see if it is
applicable to your particular version of that platform.
This beta release is known to build and pass all tests (with some noted
exceptions) on the following platforms:
ARCHNAME OSVER CC REMARKS
------------------------------------------------------------------------
alpha-dec_osf 4.0 cc
aix 4.1.4.0 cc
aix-thread 4.1.4.0 xlc_r
dos-djgpp DOS gcc 2.8.1 posix.t#4 fails
IP28-irix 6.2 cc -n32
IP32-irix 6.3 gcc 2.8.1
i386-bsdos 3.1 shlicc2 2.7.2.1 "make ok" doesn't work
i386-freebsd 2.2.6 gcc 2.7.2.1
i586-linux 2.0.33 gcc 2.7.2
i686-linux 2.0.34 gcc 2.7.2.1 shared libperl
i686-linux 2.0.32 gcc 2.8.1
i686-linux-thread 2.0.32 gcc 2.8.1
i86pc-solaris 2.6 gcc 2.7.2.3.f.1
i86pc-solaris-threa 2.6 gcc 2.7.2.3.f.1
MSWin32-x86 NT4.0 Visual C 5.0 posix.t#2 fails sometimes
MSWin32-x86-thread NT4.0 Visual C 5.0 posix.t#2 fails sometimes
MSWin32-x86-object NT4.0 Visual C 5.0 posix.t#2 fails sometimes
MSWin32-x86 NT4.0 Borland C 5.02
MSWin32-x86-thread NT4.0 Borland C 5.02
MSWin32-x86-object NT4.0 Borland C 5.02
MSWin32-x86 NT4.0 egcs 1.0.2 posix.t#2 fails sometimes
MSWin32-x86-thread NT4.0 egcs 1.0.2 posix.t#2 fails sometimes
ppc-linux 2.1.24 egcs 1.0.3
ppc-powerux 4.2 /bin/cc
PA-RISC1.1 10.20 cc
sparc-linux-thread 2.0.33 egcs 1.0.2 shared libperl
sun4-solaris 2.6 cc
sun4-solaris-thread 2.6 cc
sun4-solaris-thread 2.6 gcc 2.7.2.3
sun4-solaris 2.5.1 cc
sun4-solaris 2.5.1 gcc 2.8.1
sun4-solaris-thread 2.5.1 cc
sun4-solaris-thread 2.5.1 gcc 2.8.1
sun4-solaris 2.4 cc
sun4-solaris 2.4 gcc 2.7.2
sun4-solaris 2.3 cc
sun4-solaris 2.3 gcc 2.4.5 posix.t#12 fails
sun4-sunos 4.1.3 gcc 2.7.2.1
VMS_AXP V7.1 CC/DECC
VMS_AXP V7.1 CC/DECC usethreads=define
VMS_AXP V6.2 CC/DECC
Documentation may be a little thin in places. We are working on updating
all the documentation, and the final 5.005 release will cover all known
gaps. However, we do entertain your suggestions on all aspects that may
need improvement.
Be sure to read the "INSTALL" document for Unix-like platforms, and the
port-specific "README.xxx" files for others. For brief notes on what has
changed, see "pod/perldelta.pod". This document is still rather incomplete,
but what is there should give you some idea about the scope of changes that
have occurred. More specific logs can be found in the "Changes" file.
If everything went well, and all the tests passed, "make ok" will mail us
a report of your build configuration. If not, run "make nok" and describe
your problems in detail. Those two make targets run the "perlbug" utility,
located at "utils/perlbug". If "perlbug" cannot determine how to send mail
from your system, you may have to let it save the report to a file, and
mail it to us at <perlbug@perl.com>.
Being the lazy bunch we are, we have gone and written "perlbug" in
Perl, so if you are unable to build Perl at all, we apologize. Please
include the _output_ of the "./myconfig" shell script with a detailed summary
of what went wrong, and send it to <perlbug@perl.com>. If Perl built fine,
but you have been unable to install it, "perlbug" can also be run as
"./perl -Ilib utils/perlbug". The "-h" option will show you a short
usage summary.
If after having successfully installed Perl, you find any bugs or
incompatibilities that aren't already mentioned in the documentation,
please use "perlbug" to report the problem.
Once again, be sure to read the "README.xxx", "INSTALL", and
"pod/perldelta.pod" files for important information about this release.
And, in the words of Larry Wall: "Have the appropriate amount of fun."
The Perl Porters
perl5-porters@perl.org
----------------------------------------------------------------------------
BRIEF SUMMARY OF CHANGES
----------------------------------------------------------------------------
For a more detailed list, see "pod/perldelta.pod" in the source
distribution. Note that this release is NOT BINARY COMPATIBLE with
earlier releases. You'll need to recompile all XS extensions.
+ New: OS-level perl threads. *experimental*
+ New: A suite of compiler modules with various backends, for producing C or
bytecode from Perl, and for various useful diagnostics. *experimental*
+ Much revamped regular expression engine.
+ Vastly improved support for the Win32 platform.
+ Support for more platforms. (BeOS, DOS, MPE/ix.)
+ New: C++ Perl Object abstraction supported on Win32. *experimental*
+ New: Precompiled regular expressions.
+ New: Pseudo-hashes (manipulate arrays using hash syntax). *experimental*
+ More efficient, internal implementation of sort().
+ Tied arrays and handles are now fully supported.
+ Improved malloc().
+ Internals are now more reliable against unforeseen stack reallocs.
+ New: "EXPR foreach EXPR" syntax is supported.
+ Several more optimizations implemented.
+ Many security fixes.
+ Better locale support.
+ Enhanced 64-bit support. *experimental*
+ New: Reliable signals, when threading is enabled. *experimental*
+ Extended support for exception handling.
+ New: Several modules and pragmata have been added. (B, Data::Dumper,
Errno, File::Spec, ExtUtils::Packlist, Fatal, IPC::SysV, attrs, fields,
re.)
+ Newer versions of most existing modules.
+ Many additional diagnostics, some withdrawn.
------------------------------
Date: 17 Jul 1998 14:51:31 GMT
From: kevinfal@blue.seas.upenn.edu (Kevin R Falcone)
Subject: Re: Callling Perl script from Java app
Message-Id: <6onodj$2bq$1@netnews.upenn.edu>
Simon Wistow (simon@new-mediacom.com) wrote:
: I'm currently writing some back end scripts for my company that takes
: results from a Java game and emails a challenge to another person.
: Currently my script takes the email addresses and names of the
: challenger and challenged and a message from the game using POST and
: this has been tested using a web page with forms in it that simulates
: the presence of the game. The reason I am using the POST method is
: because it makes it that little bit harder for someone to use the script
: as an anonymous emailer.
: However the guy who is doing the Java coding has come up to me and asked
: me how he writes to the STDIN of my script and, being a total Perl
: newbie, I have no idea. Have any of you got any ideas or am I going to
: have use GET and a work around (authenticate the sender/encode the
: data/etc)?
: Cheers
This isn't really a perl question at all, but I'll point you in the right
direction because I just got through writing the same type of thing.
on the java end, use a URL class, a URL connection, and then just have
a pipe-stream out (there is no need to use buffered)
to talk back to the java program, just print to stdout, and make
sure that the java program has close the out connection, and is using
the in connection.
an example is available at
http://www.apl.jhu.edu/~hall/java/CGI-with-Java.html
-kevin
--
--------------------------------------------------------------------------------Kevin Falcone
kevinfal@seas.upenn.edu
"I refuse to have a battle of wits with an unarmed person"
--------------------------------------------------------------------------------
------------------------------
Date: Fri, 17 Jul 1998 10:06:53 -0400
From: phenix@interpath.com (John Moreno)
Subject: Re: clp.moderated
Message-Id: <1dcb2hj.1hedwih15qbomlN@roxboro0-002.dyn.interpath.net>
Russ Allbery <rra@stanford.edu> wrote:
> Abigail <abigail@fnx.com> writes:
>
> > He doesn't respond [1]. Now what do I do?
>
> > [1] PSInet. Worthless provider. Given the number of new groups that
> > appeared on their servers the last year, I never had any hopes
> > comp.lang.perl.moderated will be a group I can read.
>
> Find a different provider? Newsguy is extremely inexpensive for a fairly
> solid newsfeed.
Do you think it'd be reasonable to have the moderator's cross post
everything to clp.misc for the first month?
--
John Moreno
------------------------------
Date: Fri, 17 Jul 1998 16:21:59 +0100
From: Simon Wistow <simon@new-mediacom.com>
Subject: Coding Quiz (was Re: efficiency: print<<"xxx" vs. print)
Message-Id: <645CAC0140CED111AF1500805FEDDB8A51A7@ns.new-mediacom.co.uk>
> -----Original Message-----
> From: Uri Guttman [SMTP:uri@sysarch.com]
> Posted At: Friday, July 17, 1998 5:27 AM
> Posted To: misc
> Conversation: efficiency: print<<"xxx" vs. print
> Subject: Coding Quiz (was Re: efficiency: print<<"xxx" vs. print)
>
>
>
> Bonus: What is the OPPOSITE of spaghetti code?
>
[>] anti-pasta source ?
------------------------------
Date: Fri, 17 Jul 1998 11:50:39 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Coding Quiz (was Re: efficiency: print<<"xxx" vs. print)
Message-Id: <linberg-1707981150390001@projdirc.literacy.upenn.edu>
In article <x7sok1m7ai.fsf_-_@sysarch.com>, Uri Guttman <uri@sysarch.com> wrote:
> i have given this quiz to many computer people, and only a handful have
> ever gotten 3 points. average scores seem to be around 1.
Hmm! Well, let's see if I make the average, at least (having never
studied Knuth, just 20 years of blood, sweat and code :)
> 1. Who is main the PERSON you should think about while you are writing code?
The next maintainer (almost said "the user," but heck, they're lucky we
write at all, right? :)
> 2. Other than comments, what is the most important HUMAN aspect of code?
Readibility
> 3. What is the main PURPOSE of comments?
To enhance comprehensiveness
> Bonus: What is the OPPOSITE of spaghetti code?
Um... uncooked spaghetti code? :)
_____________________________________________________________________
Steve Linberg National Center on Adult Literacy
Systems Programmer &c. University of Pennsylvania
linberg@literacy.upenn.edu http://www.literacyonline.org
------------------------------
Date: 17 Jul 1998 14:19:24 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: confusing problem with perl make
Message-Id: <6onmhc$kv1$1@pegasus.csx.cam.ac.uk>
Paul McMahan <mcmahan@cs.utk.edu> wrote:
># uname -a
>SunOS foo 5.5.1 Generic_103640-21 sun4u sparc SUNW,Ultra-Enterprise
>
># make test
>[...]
>base/cond.........ok
>base/if...........ok
>base/lex..........ok
>base/pat..........ok
>base/term.........panic: corrupt saved stack index, <try> chunk 1.
>panic: corrupt saved stack index, <try> chunk 1.
>panic: corrupt saved stack index, <try> chunk 1.
>panic: corrupt saved stack index, <try> chunk 1.
>panic: corrupt saved stack index, <try> chunk 1.
>[ ...and so on... ]
>
>Can anyone help me?
Probably not without your telling us more about your environment,
and which version of Perl you were trying to build.
Please post the *output* from the ./myconfig script, as instructed
under "Reporting Problems" in the INSTALL document.
Mike Guy
------------------------------
Date: 17 Jul 1998 14:51:25 GMT
From: David Fetter <dfetter@shell4.ba.best.com>
Subject: Re: Deactivating mod_perl
Message-Id: <6onodd$j15$1@nntp1.ba.best.com>
Sascha Matzke <sascha@bespin.escape.de> wrote:
> Hello,
> is there a way to deactivate mod_perl for certain directories ??
The way it works is that you activate it for certain directories (or
files). Those directories where it is not activated don't have it
enabled.
HTH,
David.
--
David Fetter 888 O'Farrell Street Apt E1205
shackle@ren.glaci.com San Francisco, CA 94109-7089 USA
http://www.best.com/~dfetter +1 415 567 2690 (voice)
print unpack ("u*",q+92G5S="!!;F]T:&5R(%!E<FP@2&%C:V5R"@``+)
I fear that all we have done is to awaken a slumbering giant and fill him
with a terrible resolve.
Admiral Yamamoto
just after the Pearl Harbor attack
------------------------------
Date: Fri, 17 Jul 1998 11:18:20 -0400
From: Chris Wenk <cwenk@syntek-usa.com>
Subject: Re: efficiency: print<<"xxx" vs. print
Message-Id: <35AF6B3C.A8D8DB30@syntek-usa.com>
Actually, Jackson is very well known--simply older--from the 70's. (Like
Pressman, Brooks, Yourdon, et al). That's probably why his examples are in COBOL
:-).
Uri Guttman wrote:
> >>>>> "MD" == Mark-Jason Dominus <mjd@op.net> writes:
>
> MD> Have you ever read the book that this comes from, _Principles of
> MD> Program Design_? It's absolutely brilliant, but it doesn't seem
> MD> to be very well-known.
>
> MD> Jackson's theory is that the formal structure of your program
> MD> should match the structure of the input it will process. The
> MD> structure of the program should also match the structure of the
> MD> output it is required to generate. The interesting programs must
> MD> handle an input and an output that have different structures.
> MD> Jackson describes methods for recognizing this structure and
> MD> abstracting a program structure that corresponds to the input and
> MD> to the output at the same time.
>
> i have been espousing that theory of program design for years without
> having read that book. i have said a program's design should reflect its
> function, not just implement it. you can implement (via emulation, etc.)
> any functionality you want, but a design that matches the functionality
> is the most maintainable.
>
> i have much more on this topic but that is for another thread.
>
> MD> I think the book would have been a lot more well-known than it is,
> MD> except that all the examples are in COBOL.
>
> well, that is a very good way to make a book disappear into /dev/null!
> maybe it should be rewritten with perl as the example code! in fact that
> makes for an interesting topic, how to write perl that reflects a
> function and not just being hyper efficient, obscure, cute, or
> whatever. since TIMTOWTDI, which is the (subjective) best way? fastest,
> shortest code, easiest for beginners to grok, most reflective of the
> function, etc?
>
> maybe a BOF at the conference on this topic would be cool. any others
> interested in this thread?
>
> 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: 17 Jul 1998 16:59:26 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: FTP between two Unix machines
Message-Id: <7xr9zkmskx.fsf@fidelio.vcpc.univie.ac.at>
Re: FTP between two Unix machines, Ronald
<WouterR@xedv.cdcgate.dupont.com> said:
Ronald> Hi all, I need to write a perl script that will FTP
Ronald> files between a development machine and the
Ronald> production machine. Can anyone point me to an URL
Ronald> or other documentation on how to do this. Code
Ronald> examples are also welcome.
The Net::FTP module would be a good starting point.
And I realise this might be regarded as blasphemous in
c.l.p.*, but what about using cfengine or rdist for this
job?
hth
tony
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, AT | http://www.vcpc.univie.ac.at/
personal email: tony_curtis32@hotmail.com
"You see? You see? Your stupid minds! Stupid! Stupid!" ~ Eros, Plan9 fOS.
------------------------------
Date: Fri, 17 Jul 1998 11:09:50 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: FTP between two Unix machines
Message-Id: <fl_aggie-1707981109510001@aggie.coaps.fsu.edu>
In article <6onefu$95v@topgun.es.dupont.com>, "Ronald Wouters"
<WouterR@xedv.cdcgate.dupont.com> wrote:
[posted && cc'd]
+ I need to write a perl script that will FTP files between a development
+ machine and the production machine. Can anyone point me to an URL or other
+ documentation on how to do this. Code examples are also welcome.
You mean:
NAME
Net::FTP - FTP Client class
SYNOPSIS
use Net::FTP;
$ftp = Net::FTP->new("some.host.name");
$ftp->login("anonymous","me@here.there");
$ftp->cwd("/pub");
$ftp->get("that.file");
$ftp->quit;
If you happen to have the netlib bundle installed, this is available
via "perldoc Net::FTP". The netlib bundle is available at CPAN and
other fine Perl repositories.
James
------------------------------
Date: Fri, 17 Jul 1998 10:39:58 -0500
From: Yong Huang <yong@shell.com>
Subject: How to interprete What Sucks/Rules?
Message-Id: <35AF704D.37AEE347@shell.com>
At http://www.tpj.com/tpj/rules/ and
http://electriclichen.com/linux/srom.html, it talks about What
Sucks/Rules. But the article is not clear as to the criterion. Seems the
result comes from a Web search for "XXX rules" and "XXX sucks" strings
and count them. Can anybody explain? The fact that Java sucks even more
than Visual BASIC seems to counteract most people's impression.
Is the result really updated that often?
Yong Huang
Email:yong@shell.com
------------------------------
Date: Fri, 17 Jul 1998 11:31:53 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Hungarian Notation in Perl (Was Re: %vHash = $vScalar doesn't work, why?)
Message-Id: <linberg-1707981131530001@projdirc.literacy.upenn.edu>
In article <35AEB937.7A87802A@erols.com>, "Matthew O. Persico"
<mpersico@erols.com> wrote:
> BTW, I am glad to see that SOMEONE ELSE besides me uses a "hungarian
> notation" type of varialble naming. I'm sure that I'm about to get
> flamed by many, many Perl hackers who will say that you can always tell
> by the punctuation ($ or -> or {} or [], etc.) what something is.
>
> Well that may be true but when I pass
>
> $junk
>
> into a subroutine, how does the reader of my code know what junk is
> without searching for the subroutine to see how its used OR slogging
> through the previous code to find out how I defined it. A little bit of
> hungarian can be quite a bit of help.
>
> When I first started Perling, I used it all over the place. I have now
> restricted its use strictly to refs. hr for hash ref, ar for array ref.
> It may seem like overkill, but it makes debugging production problems at
> 2am a lot easier.
Yeah, I use a Hungarian Notation system in every language I write, even
Perl. I even do things like this:
$txtFoo = "a string";
$intCount = 154;
$blnFormClear = 1;
although they are of course not necessary in Perl, it helps me to remember
how the variables are meant to be used. It sure does make debugging
easier. Then you get constructions like this:
my @lArrIntCount = ();
Which says that this is a "l"ocal "Arr"ay of "Int"egers used for some
purpose called "Count". It also initializes it to nothing. Hardly any of
this is necessary, but it just makes things complete in my thinking, and I
*know* it will work, even if it's overkill.
Any code that's going to be used by anyone other than me, I usually try to
write it as if it were under a state of seige, explicitly initializing
everything, testing all variables for valid values, assuming every system
call will fail, etc. Lots of work, but many of the prime ingredients in
bulletproofing.
$$grHshStudentInfo{"txtName"} = "Tom";
A reference to a global hash of student information, with a text field for name.
Actually, I started doing this before I even knew a named system existed.
It does lead to long variable names, but it cuts down on the documentation
I need to write.
Bad Perl style perhaps, but I do feel that it's good general programming
style and greatly enhances the readability and maintainability of my code.
_____________________________________________________________________
Steve Linberg National Center on Adult Literacy
Systems Programmer &c. University of Pennsylvania
linberg@literacy.upenn.edu http://www.literacyonline.org
------------------------------
Date: Fri, 17 Jul 1998 10:00:40 -0700
From: JFR <jeremiah@ganymede.net>
Subject: I'm baffled.. (and an amateur:)
Message-Id: <35AF8338.EEA1033C@command-central.nmsd.k12.nm.us>
Greetings all..
What I've been cooking up lately is a web interfaced virtual user table
editor (this isn't really a CGI question, though. I ended up using
actual HTML code as opposed to CGI.pm functions).. The basic functions
of the editor are to add an entry, or delete an entry. The entries are
stored in a plain ascii file. I easily did the add entry feature, but
getting my delete feature to work has been quite a challenge (but that's
good, I suppose).
In order to delete an entry from the file, you would select the entry
you want to delete from a pulldown menu (1 entry on each line), then
press the Delete submit button. Once the delete button is pressed, it
should delete the appropriate line -- but it doesn't. It seems to
reload the HTML form, instead. I figured maybe my if param('action')
line is resulting false, or. . I dunno, actually. :/
I've spent several hours hacking away at my code, and I'm almost done..
I just cannot figure out wtf is the matter with my code -- it seems fine
to me. Delusions, eh.
So below is the source code; I have also attached it, in case anyone
cares to actually execute the code and see what's going (wr)on(g). Any
hints, blunt answers, or properly reassembled code is greatly
appreciated.
- J. Pratt
- - - - - - - - - - cut along the perforated line - - - - - - - - - -
#!/usr/bin/perl -w
use CGI ':standard';
$Password = "anti";
$CGI_URL = "http://dns2.ganymede.net:1500/hmm.cgi";
$BaseURL = "http://dns2.ganymede.net:1500";
$BaseDir = "/home/jeremiah/www";
$DataFile = "table.txt";
$Header = "This is my header.";
$Footer = <<'EOT';
<hr>
And this is my footer.
</body>
</html>
EOT
print header;
start_html('eh');
# Read in the datafile
open (DATA, "$BaseDir/$DataFile");
@data = <DATA>;
close DATA;
$Count = 0;
foreach $Line (@data) {
@Temp = split (/\t/, $Line);
$TableLine[$Count] = "<OPTION
value=\"$Temp[1]\">$Temp[0]\n";
$Count++;
}
# Create HTML form
print start_form;
print "<HTML>\n";
print "<HEAD>\n";
print " <TITLE>Delete Entry</TITLE>\n";
print "</HEAD>\n";
print "<BODY BGCOLOR=\"#ffffff\">\n";
print "\n";
print "<FORM method=post action=\"$CGI_URL\">\n";
print "<input type=hidden name=\"action\" value=\"delete2\">\n";
print "<P ALIGN=CENTER><IMG SRC=\"$BaseURL/Delete.gif\"
WIDTH=\"414\" H$
print "\"BOTTOM\" NATURALSIZEFLAG=\"3\"></P>\n";
print "\n";
print "<P><B><FONT SIZE=-1>To delete a use entry from the
system, selec$
print "below and hit the delete button.</FONT></B></P>\n";
print "\n";
print "<P ALIGN=CENTER><TABLE WIDTH=\"3%\" BORDER=\"0\"
CELLSPACING=\"0$
print "\"0\">\n";
print "<TR>\n";
print "<TD WIDTH=\"46%\"><P ALIGN=RIGHT><B><FONT
SIZE=-1>Password:</FON$
print "<TD WIDTH=\"54%\"><INPUT NAME=\"Password\"
TYPE=\"password\" SIZ$
print "<TR>\n";
print "<TD><P ALIGN=RIGHT><B><FONT SIZE=-1>Choose the entry to
delete:<$
print "<TD><SELECT name=\"Filename\">\n";
foreach $Table (@TableLine) {
print "$Table";
}
print "</SELECT></TD></TR>\n";
print "</TABLE>\n";
print "</P>\n";
print "\n";
print "<P ALIGN=CENTER><INPUT TYPE=\"submit\"
VALUE=\"Delete\"><INPUT \$
print "NAME=\"name\" TYPE=\"reset\" VALUE=\"Reset\"></P>\n";
print "\n";
print "<HR>";
print "</BODY>\n";
print "</HTML>\n";
print end_form;
# Check password information and delete entry from file
if ( param('submit') =~ /delete/ ) {
unlink ("$BaseDir/$in{'Filename'}");
# Now update the index file for that directory.
open(GW,"$BaseDir/$DataFile");
@lines = <GW>;
close GW;
open (GB,">$BaseDir/$DataFile");
foreach $line (@lines) {
chop $line;
@TempData = split (/\t/, $line);
if ($TempData[1] ne "$in{'Filename'}") {
print GB "$line\n";
}
}
close GB;
print "<html>\n";
print " <head>\n";
print " <title>Entry Deleted</title>\n";
print " </head>\n";
print "$Header\n";
print "<center><h1>Entry Deleted!</h1></center>\n";
print "The entry $in{'Filename'} has been deleted.<p>\n";
print "$Footer\n";
}
# Error routines
sub Error {
local($UserError) = @_;
if ($UserError eq "Information_Incomplete") {
print "<html>\n";
print " <head>\n";
print " <title>Information Incomplete</title>\n";
print " </head>\n";
print "$Header\n";
print "<center><h2>Information
Incomplete!</h2></center>\n";
print "You did not fill out all required information.
Please go$
print "$Footer\n";
print "</body>\n";
print "</html>\n";
exit;
}
if ($UserError eq "Password_Incorrect") {
print "<html>\n";
print " <head>\n";
print " <title>Incorrect Password</title>\n";
print " </head>\n";
print "$Header\n";
print "<center><h2>Incorrect Password!</h2></center>\n";
print "The password you entered was incorrect. Please
go back $
print "$Footer\n";
print "</body>\n";
print "</html>\n";
exit;
}
}
------------------------------
Date: 17 Jul 1998 15:50:10 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: Invoking a Programme from HTML.
Message-Id: <6onrri$m89@fridge.shore.net>
Michael W. Lancaster <conservative-party@iname.com> wrote:
: I have tried using three statements but to no avail;
: <!--exec cgi="/lordgovernor/cgi/script.cgi"-->
: <!--exec cgi="/full/path/to/cgi/script.cgi"-->
: <!--include virtual="/lordgovernor/cgi/script.cgi"-->
I think you need a space before the -->.
--Art
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.ziplink.net/~upsetter/ska/calendar.html
--------------------------------------------------------------------------
------------------------------
Date: 17 Jul 1998 14:39:47 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: invoking href="www.mysite.com/cgi-bin/perl_script?$var with out user click
Message-Id: <6onnnj$l1c@fridge.shore.net>
brian d foy <comdog@computerdog.com> wrote:
: In article <35AB9D92.E9A7EB79@mail.mcoe.k12.ca.us>, Joseph Norris <sirron@mail.mcoe.k12.ca.us> posted:
:>I need to invoke an href from my one perl script after I load the $var.
:>At this point, I force the user to another screen with this href line
:>and make them click on it. Is there any other way? Thanks.
: Javascript and other demons' work will do such things. Perl doesn't
: do that sort of thing.
If Javascript does something useful that Perl won't, why is it "demons'
work"?
Just wondering,
--Art
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.ziplink.net/~upsetter/ska/calendar.html
--------------------------------------------------------------------------
------------------------------
Date: Fri, 17 Jul 1998 14:00:02 GMT
From: Charles Maier <maierc@chesco.com>
Subject: Re: matching problem
Message-Id: <35AF59CE.79E5@chesco.com>
Simon Dueckert wrote:
>
> Hi All,
>
> I have a problem. In my download directory I wrote a file with the
> following content:
> filename description web-address
> example:
> test.txt Text to Test http://www.microsoftsucks.com
>
> Now I want to split it in 3 variables. I did the following (I'm new to
> perl ;^)
>
> script:
>
> #!/usr/bin/perl
>
> open INFO,"test.txt"
> while ($line=<INFO>)
> {
> print $line; --> this works fine
> ($file,$desc,$url)=(/^(\s)()(\s)$/); -->probably this looks
> very strange to you
> print $file; -->no output
> }
> So what is the right matching syntax ????
>
Untested.... but...
Try this.....
open INFO,"test.txt" or die; # or flames are massive ;o)
while ($line=<INFO>)
{
print $line; # This works fine.. cause it has a "/n" on it
chomp($line);
($file,$desc,$url)=split(/\s+/,$line,3);
print $file; # no kidding?!?!? -->no output
}
This ONLY will work if description has NO spaces! If it does.. you will
need to look
at a column linear solution.
--
Chuck Maier
CDM Consulting Services
http://www.cdmcon.com
(610) 943-2726
------------------------------
Date: Fri, 17 Jul 1998 14:04:43 GMT
From: Charles Maier <maierc@chesco.com>
Subject: Re: matching problem
Message-Id: <35AF5AE7.63F4@chesco.com>
IGNORE.. I misread the question...... ben a long morning ;o)
------------------------------
Date: Fri, 17 Jul 1998 15:07:32 GMT
From: jstegall@uu.net (Josh Stegall)
Subject: Problem with output of data to webpage
Message-Id: <35af57bf.150730812@news.alterdial.uu.net>
I wrote the following perl program to access part of a file on a unix
server from a web browser. The part of the file which needs to be
output to the browser is accessed by the command "maint-is (company
name)" from the unix prompt. The program seems to work fine when
tested from the unix prompt but when it is ran from the browser it
only sends the html tags and not the desired "maint-is" output.
If anybody can tell me how send the output of a unix command from a
perl program to a web browser I would really appreciate it.
Josh Stegall
jstegall@uu.net
>require ("../../cgi-lib.pl");
>&ReadParse;
>$select2=$in{0};
>print &PrintHeader;
>print "<html><body bgcolor=white>";
>if ($select2 == "Ascend"){
> $OUT = `maint-is ascend`;
>}
>elsif ($select2 == "Fore"){
> $OUT = `maint-is fore`;
>}
>elsif ($select2 == "Kentrox"){
> $OUT = `maint-is kentrox`;
>}
>elsif ($select2 == "Larscom"){
> $OUT = `maint-is larscom`;
>}
>else{
> print "Not a valid vendor choice"; #this should not be invoked
>}
>print "<pre>";
>print $OUT;
>print "</pre></body></html>";
>
------------------------------
Date: Fri, 17 Jul 1998 11:45:42 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Problem with output of data to webpage
Message-Id: <linberg-1707981145420001@projdirc.literacy.upenn.edu>
In article <35af57bf.150730812@news.alterdial.uu.net>, jstegall@uu.net
(Josh Stegall) wrote:
> I wrote the following perl program to access part of a file on a unix
> server from a web browser. The part of the file which needs to be
> output to the browser is accessed by the command "maint-is (company
> name)" from the unix prompt. The program seems to work fine when
> tested from the unix prompt but when it is ran from the browser it
> only sends the html tags and not the desired "maint-is" output.
>
> If anybody can tell me how send the output of a unix command from a
> perl program to a web browser I would really appreciate it.
Your printing is fine. Don't use == to equate strings; use "eq".
> >if ($select2 == "Ascend"){
^^
should be:
if ($select2 eq "Ascend"){
(or, if you want to be safe about case:)
if (uc($select2) eq "ASCEND"){
_____________________________________________________________________
Steve Linberg National Center on Adult Literacy
Systems Programmer &c. University of Pennsylvania
linberg@literacy.upenn.edu http://www.literacyonline.org
------------------------------
Date: Fri, 17 Jul 1998 16:18:41 +0300
From: Mihalis Tsoukalos <mike@tech.eurodyn.com.gr>
Subject: QUE: Getting NVARCHAR data with Oraperl
Message-Id: <35AF4F31.5A131DB5@tech.eurodyn.com.gr>
Hi to everyone.
I have a question to make to all of you. If you can, please help.
I am using Oraperl to access an Oracle 8.0.4 database on a Solaris
machine.
I want to get NVARCHAR data [unicode data] using the following way:
while ( ($var1,$var2,$var3) = &ora_fetch($csr) )
{
# $var2 contains the NVARCHAR data
# print them on screen
}
The problem is that $var2 variable prints on screen question marks [?]
instead of a letter.
If anyone knows the answer please tell me what to do.
many thanks in advance,
mihalis.
PS. Please cc the answer to my email address as well, because the news
server does not work all the time.
------------------------------
Date: Fri, 17 Jul 1998 10:07:33 -0500
From: Dave Radin <radin@ews.uiuc.edu>
Subject: regexp help?
Message-Id: <Pine.GSO.3.96.980717100244.8366A-100000@eesn32.ews.uiuc.edu>
Hi all. I'm kind of new to Perl, and I was wondering if anyone could help
with this. I'm trying to match any commas that appear within quotes in a
string. For example,
,"Radin, Dave", --> match the comma right after 'Radin'
,"gold, silver, bronze", -> match the commas after gold and silver
,"blue, red, orange",nothing,something,"Radin, Dave" --> match after blue,
red, and Radin
I've tried this:
open(IN, "file.txt");
open(OUT,">out.txt");
while (<IN>)
{
s/(".+),(.+")/$1,,$2/g;
print OUT $_;
}
but it doesn't work...con anyone help, please?
Thanks...
------------------------------
Date: Fri, 17 Jul 1998 17:07:49 +0200
From: Eric Zylberstejn <Eric.Zylberstejn@wanadoo.com>
To: David Hamilton <hamilton@melbpc.org.au>
Subject: Re: Reliability of random numbers
Message-Id: <35AF68C5.9D9E246C@wanadoo.com>
Hello,
David Hamilton wrote:
>
> Can someone who has been working with Perl for a while tell me whether
> the following code is "trustworthy" for giving out a random number, or
> is it prone to one number or another:
>
> srand(time ^ $$);
> $a=int(rand(15))+1;
Call srand once only.
You may want to take a look at CPAN's Math::TrulyRandom.
Eric
------------------------------
Date: Fri, 17 Jul 1998 08:28:51 -0700
From: Anu Padki <apadki@cisco.com>
Subject: Remote login question
Message-Id: <35AF6DB3.C83258D2@cisco.com>
Is there a way to login on a remote machine thru perl
apart from telnet and rsh?
------------------------------
Date: 17 Jul 1998 10:18:16 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Reverse an associative array
Message-Id: <6onmf8$5ot$1@monet.op.net>
Keywords: amra dicotyledon spatterdock wean
In article <35AF5260.333CE2E@emw.ericsson.se>,
Clas <qmwclka@emw.ericsson.se> wrote:
>My task is to reverse an associative array.
>Say I've got an array like this:
>
> %ages = ("Angie ", 39,
> "Dirty ", 34,
> "Michael ", 27,
> "Willy ", 21 );
>
>How should I do to reverse this?
>So Willy will be the first name in the associative array.
Associative arrays do not allow you to specify an order; Perl arranges
the order the way it wants to for greatest efficiency. In this case,
Willy is already the first key. (Print out `keys %ages' and you will
see that this is so.)
You use an associative array to specify an association between the
keys and the values. If you want items in a specific order, you
should use a regular array.
If you can explain what you are really trying to accomplish here,
someone may be able to suggest a solution.
------------------------------
Date: Fri, 17 Jul 1998 14:33:07 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: Reverse an associative array
Message-Id: <35AF5293.BD1852DB@nortel.co.uk>
Clas wrote:
>
> Hello!
>
> I am a beginner...
> My task is to reverse an associative array.
...or hash, blabla, better, blabla...
>
> Say I've got an array like this:
>
> %ages = ("Angie ", 39,
> "Dirty ", 34,
> "Michael ", 27,
> "Willy ", 21 );
>
> How should I do to reverse this?
> So Willy will be the first name in the associative array.
Please see the documentation on hashes, 'perldata'. Then proceed to the
perlfaq.
perlfaq4: data manipulation.
How do I look up a hash element by value?
How do I sort a hash (optionally by value instead of key)?
How can I make my hash remember the order I put elements into it?
After that you will know more. In theory.
--
____________________________________________________________
Frank Quednau
http://www.surrey.ac.uk/~me51fq
________________________________________________
------------------------------
Date: Fri, 17 Jul 1998 08:03:21 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Reverse an associative array
Message-Id: <MPG.101907874a95861b989756@nntp.hpl.hp.com>
In article <6onmf8$5ot$1@monet.op.net> on 17 Jul 1998 10:18:16 -0400,
Mark-Jason Dominus <mjd@op.net> says...
> In article <35AF5260.333CE2E@emw.ericsson.se>,
> Clas <qmwclka@emw.ericsson.se> wrote:
> >My task is to reverse an associative array.
> >Say I've got an array like this:
> >
> > %ages = ("Angie ", 39,
> > "Dirty ", 34,
> > "Michael ", 27,
> > "Willy ", 21 );
> >
> >How should I do to reverse this?
> >So Willy will be the first name in the associative array.
...
> You use an associative array to specify an association between the
> keys and the values. If you want items in a specific order, you
> should use a regular array.
Or, if you want to retain the desirable property of the hash (quick
retrieval of a value via its key), expand the contents of the hash into a
sorted list when you want to use them that way:
foreach (reverse sort keys %ages) { print "$_ $ages{$_}\n" }
will print:
Willy 21
Michael 27
Dirty 34
Angie 39
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 17 Jul 1998 16:21:27 +0100
From: "Clinton Gormley" <clint@netcomuk.co.ukXX>
Subject: SDBM and locking
Message-Id: <6onq65$13a$1@taliesin.netcom.net.uk>
I'm using SDBM with IIS on an NT 4 server cos I haven't figured out UNIX
yet.
If I want to put read or write locks onto my datafile should I do it like
this :
Read :
open (db,$dbfile);
flock (db,LOCK_SH);
tie (%hash,SDBM_File,$dbfile,O_RDONLY,0666);
$temp=%hash{key};
untie (%hash);
flock (db,LOCK_UN);
close (db);
Write:
open (db,$dbfile);
flock (db,LOCK_EX);
tie (%hash,SDBM_File,$dbfile,O_RDWRT,0666);
%hash{key}=$temp;
untie (%hash);
flock (db,LOCK_UN);
close (db);
or am i duplicating things with flock and tie? or is it insufficient?
or should i be sacrificed to the camel?
yes i know it would be easier to use the berkley db, and i will get there,
but later. i need asnweres to this now.
thanks
clint
------------------------------
Date: Fri, 17 Jul 1998 15:01:15 GMT
From: drummj@mail.mmc.org (Jeffrey R. Drumm)
Subject: Re: Silly things to do in Perl (or: is that Laptop waterproof?)
Message-Id: <35af666b.15392162@news.mmc.org>
[ posted to comp.lang.perl.misc and a courtesy copy was mailed to the cited
author ]
On Fri, 17 Jul 1998 13:59:45 +0100, "F.Quednau" <quednauf@nortel.co.uk> wrote:
>Jonathan Stowe wrote:
>>
>> >> Oh *shish*, you're all a bunch of perfectionists :)
>> >
>> >That's *sheesh*, not *shish*. :)
>> >
>> A right kebabing if I ever saw one.
>
>Neither Websters dictionary nor the jargon file tell me what that is
>supposed to mean. HELP!
Think "skewered meat". (and keep it clean!)
Never been kebabed? Shish!
--
Jeffrey R. Drumm, Systems Integration Specialist
Maine Medical Center - Medical Information Systems Group
drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented!" - me
------------------------------
Date: 17 Jul 1998 17:17:01 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Silly things to do in Perl (or: is that Laptop waterproof?)
Message-Id: <7xpvf4mrrm.fsf@fidelio.vcpc.univie.ac.at>
Re: Silly things to do in Perl (or: is that Laptop
waterproof?), F <quednauf@nortel.co.uk> said:
F> Jonathan Stowe wrote:
>> >> Oh *shish*, you're all a bunch of perfectionists :) >
>> >That's *sheesh*, not *shish*. :) > A right kebabing if
>> I ever saw one.
F> Neither Websters dictionary nor the jargon file tell me
F> what that is supposed to mean. HELP!
Quick, we need a donor!
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, AT | http://www.vcpc.univie.ac.at/
personal email: tony_curtis32@hotmail.com
"You see? You see? Your stupid minds! Stupid! Stupid!" ~ Eros, Plan9 fOS.
------------------------------
Date: Fri, 17 Jul 1998 09:46:34 -0600
From: Greg Coulombe <gcoulomb@gpu.srv.ualberta.ca>
Subject: system() return values
Message-Id: <35AF71DA.F891DE9B@gpu.srv.ualberta.ca>
I have a perplexing problem: when I call an external program from a
system call, the return value is ALWAYS -1. After going through the
number mangling suggested in the Camel book, this turns out to be a
return code of 255. When I run the same command from the command line,
it returns 0 (as I expected). Any thoughts on this mystery?
--
Greg Coulombe
Programmer, Orlando Project
Faculty of Arts
coulombe@cs.ualberta.ca
"It is easier to port a shell than a shell script."
-- Larry Wall
------------------------------
Date: 17 Jul 1998 10:01:47 -0500
From: John Goerzen <jgoerzen@southwind.net>
Subject: Re: URGENT: HELP!!!!
Message-Id: <r6zvhowo71g.fsf@peridot.southwind.net>
I don't understand; why can't you just read in the structure to an
array or string and throw away those structures that don't contain
'Statement Text'?
John
Dominique CRETEL <dominique.cretel@cfwb.be> writes:
> Hi all,
>
> I begin with Perl and I'm fighting with this problem:
>
> I have a file which structure looks like this (see the and of the post):
>
> an ID (a number),
> a bloc of text (number of lines is variable)
> one empty line of datas (may be with space or tab)
> and so on...
>
> I want to select only the entire blocs that contains the string
> "Statement Text". For example, in the exemple a the end of the post, I
> will get only the bloc:
> ---------
> 9483 DB2 api_data relation_data_serv sqlrrdi (1.15.18.6)
> pid 208; tid 159; cpid 170; time 65325853; trace_point 11
> P1: Statement Text =
> SELECT * FROM NFUSER WHERE NFNAME= 'THEIZE01'
> ---------
>
> How can I do that?
>
> Thanks,
> Dominique
>
> ---trace.log--------------------------
> 9482 DB2 cei_retcode oss 2
> sqloCreateStaticDataAnchors> (1.23.74.109)
> pid 561; tid 569; cpid 69; time 65325853; trace_point 254
> return_code = 000000 = 0
>
> 9483 DB2 api_data relation_data_serv sqlrrdi (1.15.18.6)
> pid 208; tid 159; cpid 170; time 65325853; trace_point 11
> P1: Statement Text =
> SELECT * FROM NFUSER WHERE NFNAME= 'THEIZE01'
>
> 9484 DB2 api_retcode base_sys_utilities sqleGetCurrentCtx
> (1.13.76.106)
> pid 561; tid 569; cpid 69; time 65325853; trace_point 254
> return_code = 000000 = 0
> -----------------------------
------------------------------
Date: Fri, 17 Jul 1998 17:34:48 +0200
From: Eric Zylberstejn <Eric.Zylberstejn@wanadoo.com>
To: dominique.cretel@cfwb.be
Subject: Re: URGENT: HELP!!!!
Message-Id: <35AF6F18.7940E2A1@wanadoo.com>
Hello,
Dominique CRETEL wrote:
> I want to select only the entire blocs that contains the string
> "Statement Text". For example, in the exemple a the end of the post, I
> will get only the bloc:
Set the $/ variable (man perlvar).
Try this :
perl -n -e '$/ = "\n\n"; print if /Statement Text/;' trace.log
Eric
------------------------------
Date: Fri, 17 Jul 1998 10:48:11 -0400
From: Sara Malkawi <smalkawi@engin.umich.edu>
Subject: usage of open2.pl
Message-Id: <Pine.HPP.3.91.980717104513.23671B-100000@dim.engin.umich.edu>
Hi,
I have been reading the online documentation for open2.pl, and am getting
more confused. The module itself says (in comments) to use it like
$pid = &open2('input', 'output', 'ssh srvr2.engin.umich.edu');
and then use $input and $output for I/O. The online docs on the Perl
website say to use it like
use IPC::Open2;
$pid = open2(\*RDR, \*WTR, 'some cmd and args');
Also, how do I actually read and write? Do I use something like
print $output "$str\n";
or
print WTR "$str\n";
??
Any help would be appreciated.
Sara Malkawi
------------------------------
Date: Fri, 17 Jul 1998 16:24:10 +0200
From: "Hans Van Lint" <hvanlint@lodestar.be>
Subject: Variables
Message-Id: <6onmld$g3t$1@news2.xs4all.nl>
Hi,
I'm writing in Perl:
When users enter my site (through login.cgi) they need to give their name
and password. In login.cgi I store their name (with $ENV{REMOTE_USER}) in a
variable called $gebruiker.
However, I'm using different .cgi scripts and I want to remember this
variable in all of them. BUT somehow I think this is very unsafe. Because
sometimes I'm passing the variables via <a
href=zoeken.cgi?gebruiker=$gebruiker...
Is there a way to pass, remember variables in all scripts without the user
noticing it. So not via the above example and not with a hidden field in a
form tag.
I once read I could use an $ENV{} for this in Perl!!
Thnx
------------------------------
Date: Fri, 17 Jul 1998 14:39:42 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: Variables
Message-Id: <35af6211.77392674@thunder>
On Fri, 17 Jul 1998 16:24:10 +0200,
"Hans Van Lint" <hvanlint@lodestar.be> enlightened us thusly:
>Hi,
>I'm writing in Perl:
>When users enter my site (through login.cgi) they need to give their name
>and password. In login.cgi I store their name (with $ENV{REMOTE_USER}) in a
>variable called $gebruiker.
>However, I'm using different .cgi scripts and I want to remember this
>variable in all of them. BUT somehow I think this is very unsafe. Because
>sometimes I'm passing the variables via <a
>href=zoeken.cgi?gebruiker=$gebruiker...
>Is there a way to pass, remember variables in all scripts without the user
>noticing it. So not via the above example and not with a hidden field in a
>form tag.
You want to use cookies.
--
David Cantrell, part-time NT/java/SQL techie
full-time chef/musician/homebrewer
http://www.ThePentagon.com/NukeEmUp
------------------------------
Date: Fri, 17 Jul 1998 07:38:33 -0400
From: Bruce Browning <bruce.browning@tivoli.com>
Subject: Win32 and chdir problems
Message-Id: <35AF37B9.B0D4C5F0@tivoli.com>
I am using Perl to run some of my processes. I have tried using the
chdir command and it works fine as long as the drive and directory are
local but when I try to use it on a network drive, it has problems and
tells me I have an invalid argument. Also I tried testing for the
existence of a file on a network drive and it could not find the file.
Any help would be greatly appreciated.
Here is my configuration:
Win NT 4.0 sp3
Perl 5.004 win32
Network drives are mounted from another NT machine. All file systems are
NTFS.
Thanks,
Bruce
Please reply via email to bruce.browning@tivoli.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 3186
**************************************