[19831] in Perl-Users-Digest
Perl-Users Digest, Issue: 2026 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Oct 28 11:05:45 2001
Date: Sun, 28 Oct 2001 08:05:10 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1004285109-v10-i2026@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 28 Oct 2001 Volume: 10 Number: 2026
Today's topics:
Re: $image${number} = "selected"; Doesn't work, what wi <goldbb2@earthlink.net>
(Dumbish ?) NEWBIE question on Perl environment variabl <john@smithIndustries.com>
Re: (Dumbish ?) NEWBIE question on Perl environment var <gellyfish@gellyfish.com>
[ANNOUNCE] Aspect 0.06 <marcel.gruenauer@chello.at>
Re: Clarification on 'system' command (Chandramohan Neelakantan)
Re: Even without binmode, txt file gets uploaded as BI <goldbb2@earthlink.net>
Re: File parseing and testing for existing data <exodus@thisaintreal.com>
Re: File parseing and testing for existing data (Tad McClellan)
full path <mto@kabelfoon.nl>
Re: full path <nobody@nowhere.com>
Re: full path (Garry Williams)
Re: full path <jurgenex@hotmail.com>
Re: How to delete the last link <adustipujo1@mediaone.net>
Re: how to set up a CGI on my webpage <nobody@nowhere.com>
Re: need help with files <gellyfish@gellyfish.com>
Re: Newbie. <exodus@thisaintreal.com>
Re: Obtaining Windows Structure in Perl <gellyfish@gellyfish.com>
Re: PATH and output questions <goldbb2@earthlink.net>
Re: Perl in PWS <gellyfish@gellyfish.com>
Re: printing html <exodus@thisaintreal.com>
problems installing DBD::mysql <m.grimshaw@salford.ac.uk>
Re: problems installing DBD::mysql (Garry Williams)
Re: Screen handling question <gellyfish@gellyfish.com>
Re: Screen handling question <coec@iinet.net.au>
Re: set value of scalar <goldbb2@earthlink.net>
String Parsing... <mercutio@digitalrice.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 28 Oct 2001 02:47:24 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: $image${number} = "selected"; Doesn't work, what will?
Message-Id: <3BDBB80C.E5183C52@earthlink.net>
Bob wrote:
>
> I am trying to write a script to display 100+ sequential images. I
> want to give the viewer the option to jump to an image out of
> sequence. I've seen scripts at the script archives that do this
> through a field into which one types the number of the page. I would
> prefer a pull down menu. I want the menu to be set to the image being
> viewed.
Blech. A select field with 100+ items? Are you absolutely sure this is
what you want? *I* would do it as 3 select fields, one with the
hundreds, one with the tens, and one with the ones places, for the three
digit number.
my $maxnum = 200; # number of images.
my $number = 157; # the one currently selected.
my ($n100, $n10, $n1) = map reverse, split //, reverse $number, 3;
print qq[<select name=image100s>\n];
print qq[<option value = $_>$_</option>] for 0..($n100-1);
print qq[<option value = $n100 selected>$n100</option>\n];
print qq[<option value = $_>$_</option>] for ($n100+1)..($maxnum/100);
print qq[</select><select name=image10s>\n];
print qq[<option value = $_>$_</option>] for 0..($n10-1);
print qq[<option value = $n10 selected>$n10</option>\n];
print qq[<option value = $_>$_</option>] for (($n10+1)..9);
print qq[</select><select name=image1s>\n];
print qq[<option value = $_>$_</option>] for 0..($n1-1);
print qq[<option value = $n1 selected>$n1</option>\n];
print qq[<option value = $_>$_</option>] for (($n1+1)..9);
print qq[</select>\n];
[NB: untested]
--
Klein bottle for rent - inquire within.
------------------------------
Date: Sun, 28 Oct 2001 11:08:30 -0000
From: "John Smith" <john@smithIndustries.com>
Subject: (Dumbish ?) NEWBIE question on Perl environment variables / Installing modules
Message-Id: <9rgot5$1eg$1@news7.svr.pol.co.uk>
Hi All,
Just recently discovered Perl (I know, I know, I've been hiding under a rock
for the past few years ;-). This question maybe a bit off topic. but someone
may be able to help me (or at least point me in the right direction). I
downloaded the Perl 5.6 and built it locally. I also downloaded Inline.pm
(Thanks Johannes for the recommendation) ans tried to install it.
However, This is what I get when I run perl Makefile.pl :
F:\Projects\Inline-0.43>perl Makefile.PL
Checking if your kit is complete...
Looks good
Warning: prerequisite Digest::MD5 2.09 not found at (eval 1) line 220.
Warning: prerequisite Parse::RecDescent 1.78 not found at (eval 1) line 220.
Error: Unable to locate installed Perl libraries or Perl source code.
It is recommended that you install perl in a standard location before
building extensions. Some precompiled versions of perl do not contain
these header files, so you cannot build extensions. In such a case,
please build and install your perl from a fresh perl distribution. It
usually solves this kind of problem.
(You get this message, because MakeMaker could not find
"D:\perl\5.00503\lib\MSWin32-x86\CORE\perl.h")
The question is not about inline, but rather about where the hell the Perl
environment (or default ?) variables are comming from.
First of all, the command perl is running the wrong version of perl (but I
think that's probably because the new built exe is not on my path, and the
build did not change my PATH env setting - so that should be relatively easy
to fix). However, I have no I idea where the path
D:\perl\5.00503\lib\MSWin32-x86\CORE is coming from since its not in any of
my env vars settings and not in my system registry.
Any help will be much appreciated.
Thanks
PS: (maybe stating the obvious - but OS is Win2K)
------------------------------
Date: 28 Oct 2001 15:05:31 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: (Dumbish ?) NEWBIE question on Perl environment variables / Installing modules
Message-Id: <9rh6rr$hhh$1@uranium.btinternet.com>
John Smith <john@smithindustries.com> wrote:
>
> (You get this message, because MakeMaker could not find
> "D:\perl\5.00503\lib\MSWin32-x86\CORE\perl.h")
>
> The question is not about inline, but rather about where the hell the Perl
> environment (or default ?) variables are comming from.
> First of all, the command perl is running the wrong version of perl (but I
> think that's probably because the new built exe is not on my path, and the
> build did not change my PATH env setting - so that should be relatively easy
> to fix). However, I have no I idea where the path
> D:\perl\5.00503\lib\MSWin32-x86\CORE is coming from since its not in any of
> my env vars settings and not in my system registry.
>
If you run 'perl -V' from the command line you will see that path in @INC
(or at least part of it) the WIn32 Perl does some relocation tricks to
set the binary to look in the place where it was installed for the libraries.
If you want to use a different Perl binary you will need to put its directory
in the PATH earlier than the one you are getting now.
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: 26 Oct 2001 17:57:32 GMT
From: Marcel Grunauer <marcel.gruenauer@chello.at>
Subject: [ANNOUNCE] Aspect 0.06
Message-Id: <tto64nk9jj3041@corp.supernews.com>
NAME
Aspect-Oriented Perl - Aspect-oriented programming in pure Perl
DESCRIPTION
Introduction to AOP
Aspect-oriented Programming (AOP) is a programming methodology developed
by Xerox PARC. The basic idea is that in complex class systems there are
certain aspects or behaviors that cannot normally be expressed in a
coherent, concise and precise way. One example of such aspects are
design patterns, which combine various kinds of classes to produce a
common type of behavior.
Aspects in Perl provide:
* Dynamic enabling and disabling of aspects at run-time
* Modular aspects for prepackaged functionality
See `Aspect::Intro' for an introduction to aspect-oriented programming.
See `Aspect::Overview' for an overview of the modules and classes that
comprise this distribution. See `Aspect::Ideas' for ideas on future
developments. See `Aspect::Cookbook' for aspect-oriented recipes for
common situations. See the individual modules' manpages for information
on how to use and implement aspects.
LIMITATIONS
* Many types of join points and pointcuts remain unimplemented.
* Performance may suffer for aspects affecting a wide range of join
points.
PREREQUISITES
`Aspect' requires the following modules, which can be obtained from
CPAN:
Class::MethodMaker
Hook::LexWrap
IO::Scalar
If you install `Aspect' from the CPAN shell, these modules will, if
necessary, be installed automatically as well.
INSTALLATION
It's all pure Perl, so just put the .pm files in their appropriate local
Perl subdirectories.
The easiest way to install this distribution is using the standard build
process for Perl modules:
perl Makefile.PL
make
make test
make install
Or you could use the CPAN shell, as described in the `CPAN' module
documentation.
CHANGES AND FUTURE DEVELOPMENT
This `README' refers to version 0.06. For details of changes, refer to
the file `Changes'.
Future versions will provide new types of join points, pointcuts and
modular aspects. Stability and performance is also an ongoing concern.
See `Aspect::Ideas' for an overview of these ideas.
CHANGES IN VERSION 0.06
* added `around()' function to `Aspect'
* Added `Attribute::Profiled'
* added `Aspect::Attribute' interface to creating advice
* made `Aspect::Advice''s `enable()' and `disable()' return `$self'
* added cookbook example callflow_attr.pl
* added cookbook recipes for bounds checking and change tracking, plus
sample programs
AVAILABILITY
`Aspect' has been uploaded to the CPAN; in any case it is available
from:
http://codewerk.unixbeard.net/aspects/Aspect-0.06.tar.gz
AUTHOR
Marcel Grunauer, <marcel@codewerk.com>
COPYRIGHT
Copyright 2001 Marcel Grunauer. All rights reserved.
This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
SEE ALSO
Aspect::Intro(3pm), Aspect::Cookbook(3pm), Aspect::Ideas(3pm),
Aspect(3pm).
Marcel
--
We are Perl. Your table will be assimilated. Your waiter will adapt to
service us. Surrender your beer. Resistance is futile.
-- London.pm strategy aka "embrace and extend" aka "mark and sweep"
------------------------------
Date: 28 Oct 2001 05:03:33 -0800
From: knchandramohan@yahoo.com (Chandramohan Neelakantan)
Subject: Re: Clarification on 'system' command
Message-Id: <69d11688.0110280503.3205687e@posting.google.com>
Louis Erickson <wwonko@rdwarf.com> wrote in message news:<9rdok3$3fo$1@holly.rdwarf.com>...
[snip]
> Hope I helped more than I confused.
Thanks ...I thought execvp was a binary file capable of being executed
and was looking into different OSs to find it.
regards
CM
------------------------------
Date: Sun, 28 Oct 2001 03:49:42 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Even without binmode, txt file gets uploaded as BINARY instead of ASCII
Message-Id: <3BDBC6A6.8F2934B4@earthlink.net>
Etal wrote:
>
> I sent the day trying to get this to work. Read the manuals and the
> news group. It should work but it does not.
>
> I want to upload via browser a file from local drive to web. I NEED it
> in ASCII. According to perl manual, "Regardless of platform, use
> binmode() on binary files, and do not use binmode() on text files."
>
> I tried with and without and my text file still uploads as binary.
You need to use binmode on both the file you're reading from and writing
to. In your code, this would be, binmode($file) [before you begin
reading from it]. The following code is rather simpler, and does what
you are trying to do.
> I found this script on the newsgroup, it's very nice, but I can't get
> it to upload in ASCII.
>
> Does anyone have an idea?
You'd be better off not doing the reading and writing of the file
yourself. Let existing modules do the work for you.
#!/usr/bin/perl -wT
use CGI::Carp qw(fatalsToBrowser);
use CGI;
my $path = "/www/directory/where/it/goes";
print header, start_html("Upload files to server"),
h2("Upload files to server"),
start_multipart_form,
filefield(-name => 'file'),
submit(-value => 'Upload'),
endform;
if( my $file = upload("file") ) {
use File::Copy qw(copy);
use File::Basename qw(basename);
my $fn = $path . basename( $file );
rename( $file, $fn ) or copy( $file, $fn ) or die $!;
}
__END__
NB: This code is untested.
--
Klein bottle for rent - inquire within.
------------------------------
Date: Sun, 28 Oct 2001 10:34:25 -0000
From: "Exodus" <exodus@thisaintreal.com>
Subject: Re: File parseing and testing for existing data
Message-Id: <taRC7.18344$a14.1357773@news6-win.server.ntlworld.com>
"Matias P. Silva" <mpsilva@csupomona.edu> wrote in message
news:9rfhg2$103d1$1@hades.csu.net...
> Hello to all....
> I'm trying to test if a username already exists with in a comma delimited
> file.
> I tried this below but no joy. The file exists and I am able to write to
> it.
>
> while($line = <USERFILE>){
> if($line =~ /$userName/){
> $result = "true";
> print "$line";
> }
> }
Don't know if it helps, or even if it's any good or correct but I'm doing a
similar thing - check username & password from a list in a csv text file.
I used the following to test for the presence of a username,password string.
while (<USR>) {
if ($username ne ' ' && $password ne ' ') {
if (/$username,$password/) {
$auth = 'true';
}
}
This is used to capture username and password from a html form, and set
$auth to 'true' if the username,password exists.
What I had initially though was:
if (/$username,$password/) {
$auth = 'true';
}
Which of course, if someone supplied blank fields in the form, would
validate, because it only tried to find a comma, which always existed. Took
me about ages to figure that out :o(
I reckon my way is a bit of a fudge, so if anyone knows a better method, I'm
always open to ideas :o)
Ex.
------------------------------
Date: Sun, 28 Oct 2001 13:03:32 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: File parseing and testing for existing data
Message-Id: <slrn9tnts4.jmu.tadmc@tadmc26.august.net>
Exodus <exodus@thisaintreal.com> wrote:
>"Matias P. Silva" <mpsilva@csupomona.edu> wrote in message
>news:9rfhg2$103d1$1@hades.csu.net...
>> I'm trying to test if a username already exists with in a comma delimited
>> file.
>Don't know if it helps, or even if it's any good or correct but I'm doing a
>similar thing - check username & password from a list in a csv text file.
>
>I used the following to test for the presence of a username,password string.
>
>while (<USR>) {
>if ($username ne ' ' && $password ne ' ') {
What if they are the empty string?
> if (/$username,$password/) {
> $auth = 'true';
> }
> }
>
>This is used to capture username and password from a html form, and set
>$auth to 'true' if the username,password exists.
>
>What I had initially though was:
>
>if (/$username,$password/) {
Better put some anchors in your pattern. You will incorrectly
validate something like:
$_ = 'foo,theexodus,thisaintrealeither,bar';
if (/exodus,thisaintreal/) {
# Oops!
> $auth = 'true';
> }
>
>Which of course, if someone supplied blank fields in the form, would
>validate, because it only tried to find a comma, which always existed. Took
>me about ages to figure that out :o(
You'll have the same problem if either is the empty string, which you
aren't testing for.
>I reckon my way is a bit of a fudge, so if anyone knows a better method, I'm
>always open to ideas :o)
die "username cannot be empty" unless length $username;
die "password cannot be empty" unless length $password;
if (/^$username,$password$/) {
$auth = 'true';
}
You have yet more problems if the password contains a comma...
Best approach would probably be to split out the fields and
use 'eq' instead of a pattern match.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 28 Oct 2001 14:42:00 +0200
From: "MAGiC MANiAC^mTo" <mto@kabelfoon.nl>
Subject: full path
Message-Id: <9rgumu$16m6$1@news.kabelfoon.nl>
how can I get the full path of the running file?...
let say: the file : myperl.pl is running...
but in the code I need to know where the full
path where this file : myperl.pl is running...
result: c:\perl\myperl\myperl.pl
so, include the filename not only the location...
------------------------------
Date: Mon, 29 Oct 2001 00:05:37 +1000
From: "Gregory Toomey" <nobody@nowhere.com>
Subject: Re: full path
Message-Id: <leUC7.6385$c5.68111@newsfeeds.bigpond.com>
"MAGiC MANiAC^mTo" <mto@kabelfoon.nl> wrote in message
news:9rgumu$16m6$1@news.kabelfoon.nl...
> how can I get the full path of the running file?...
http://www.perldoc.com/perl5.6.1/lib/Cwd.html
gtoomey
------------------------------
Date: Sun, 28 Oct 2001 14:29:35 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: full path
Message-Id: <slrn9to5if.rmp.garry@zfw.zvolve.net>
On Mon, 29 Oct 2001 00:05:37 +1000, Gregory Toomey <nobody@nowhere.com> wrote:
> "MAGiC MANiAC^mTo" <mto@kabelfoon.nl> wrote in message
> news:9rgumu$16m6$1@news.kabelfoon.nl...
>> how can I get the full path of the running file?...
>
> http://www.perldoc.com/perl5.6.1/lib/Cwd.html
I suppose that you mean that the current working directory is somehow
related to the path of the script that is executing.
That is not true.
The OP wants the FindBin module. See its manual page. That would be
on your own computer:
perldoc FindBin
--
Garry Williams
------------------------------
Date: Sun, 28 Oct 2001 07:31:45 -0800
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: full path
Message-Id: <3bdc24e7@news.microsoft.com>
"Gregory Toomey" <nobody@nowhere.com> wrote in message
news:leUC7.6385$c5.68111@newsfeeds.bigpond.com...
> "MAGiC MANiAC^mTo" <mto@kabelfoon.nl> wrote in message
> news:9rgumu$16m6$1@news.kabelfoon.nl...
> > how can I get the full path of the running file?...
>
> http://www.perldoc.com/perl5.6.1/lib/Cwd.html
That wouldn't help much. Anonymous was interested in the location of the
executable script, not the current working directory.
An FAQ search for "directory" or "path" would have shown the correct answer,
although in a somewhat cryptic disguise:
Found in C:\Perl\lib\pod\perlfaq8.pod
How do I add the directory my program lives in to the module/library
search path?
use FindBin;
use lib "$FindBin::Bin";
jue
------------------------------
Date: Sun, 28 Oct 2001 14:46:20 GMT
From: "Pujo C A" <adustipujo1@mediaone.net>
Subject: Re: How to delete the last link
Message-Id: <0TUC7.40325$bK.495790@typhoon.mw.mediaone.net>
I already filter the one without http
thank you, it helps
--
Pujo C Agustiyanto
http://www.geocities.com/pujoca
<!-- The richest person in this universe is the person who appreciate what
she/he has-->
"Stuart Gall" <stuart@otenet.gr> wrote in message
news:9reoae$e9c$1@usenet.otenet.gr...
> or $url =~ s|(^http://[^/]*).*|$1/|
> if you want the /
>
>
> --
>
> Stuart Gall
> ------------------------------------------------
> This message is not provable.
> "Stuart Gall" <stuart@otenet.gr> wrote in message
> news:9renpi$dsk$1@usenet.otenet.gr...
> > I guessed the problem might be that if page does not have an html
> extension
> > in which case
> >
> > so $url =~ s|(^http://[^/]*).*|$1|
> >
> > does it have to deal with the http:// possibly missing too?
> > --
> >
> > Stuart Gall
> > ------------------------------------------------
> > This message is not provable.
> > "Laocoon" <Laocoon@eudoramail.com> wrote in message
> > news:Xns91479B06AD1CCLaocooneudoramailcom@62.153.159.134...
> > > $url =~ s#/.+?html$##i;
> > >
> > > Hope this helps you..
> >
>
------------------------------
Date: Sun, 28 Oct 2001 17:14:07 +1000
From: "Gregory Toomey" <nobody@nowhere.com>
Subject: Re: how to set up a CGI on my webpage
Message-Id: <AcOC7.6092$c5.64217@newsfeeds.bigpond.com>
"Steven Wüthrich" <spam@dsxs.net> wrote in message
news:3bdaf787$1_4@news.bluewin.ch...
> Hi there,
>
> ive been working with perl for several months now, and now id like to
> put a cgi script on my website, just to test it...
See
http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html
gtoomey
------------------------------
Date: 28 Oct 2001 10:58:47 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: need help with files
Message-Id: <9rgod7$96q$1@neptunium.btinternet.com>
Devon Perez <hoss@chungk.com> wrote:
> how do i make it so that my program can look in a directory and see if a
> specific file already exists?
>
There are the filetest operators that are discussed in the perlfunc manpage
under the general '-X' heading (i.e you can perldoc -f -X )
What you probably want it something like:
if ( -e '/path/to/some/file' )
{
print "file exists!\n";
}
HTH
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: Sun, 28 Oct 2001 10:23:51 -0000
From: "Exodus" <exodus@thisaintreal.com>
Subject: Re: Newbie.
Message-Id: <z0RC7.18288$a14.1348105@news6-win.server.ntlworld.com>
"Uri Guttman" <uri@sysarch.com> wrote in message
news:x7pu79yrs8.fsf@home.sysarch.com...
> first please learn to not top post. put your comments after the edited
> parts of posts you quote.
You got it. :o)
Is it right to always edit the posts? What is someone reads a 'Re:' message
and doesn't have the original? I guess both ways have flaws, I'll stick
with contextual posting :o)
> she is some angry person who doesn't seem to like this group having a
> culture of proper quoting and other netiquette. ignore her.
That's easily done. I just wasn't expecting such a reply in a group like
this, I thought perhaps it had some cryptic meaning beyond my
understanding - obviously not.
> if you demand answers
> and don't lift a finger first, you will more likely to be ignored.
Oh believe me, I'll struggle with a problem before I ask for help, I get
much more satisfaction through figuring things out myself, plus it means I
end up *really* understanding what the problem was in the first place. I
wouldn't ever demand answers, I know everyone out there has busy lives and
things to do with their time, so I'm really grateful when someone takes the
time to assist me (especially as they don't even know me - like yourself
:o).
Thanks for the guidance.
Ex.
------------------------------
Date: 28 Oct 2001 11:07:05 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Obtaining Windows Structure in Perl
Message-Id: <9rgosp$96q$2@neptunium.btinternet.com>
Jody Fedor <Jodyman@usa.net> wrote:
> Is there a way to obtain in Perl the structure in "My Computer",
> "Network Neighborhood" or "Entire Network"?
>
<snip>
>
> Any Ideas out there or places to look for answers?
>
You might get more help from one of the Win32 specific mailling lists hosted
by Activestate at <http://aspn.activestate.com/ASPN/Mail/>
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: Sun, 28 Oct 2001 03:01:30 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: PATH and output questions
Message-Id: <3BDBBB5A.BD42BD26@earthlink.net>
Lou Moran wrote:
>
> From the Perl Cookbook (9.6) I whipped up this:
>
> #! /usr/bin/perl -w
> use strict ;
> use diagnostics ;
>
> my $path = 'N:\domino\reports\679160001' ;
Perl allows forward slashes.
> opendir (DIR, $path) or die "No! $!" ;
> my @files = grep {/\.*$/} readdir (DIR) ;
The pattern /\.*$/ Matches 0 or more dot characters at the end of the
string. Since it can match with 0 dots, ISTM that this isn't what you
want. You likely want grep !/^\.\.?$/, readdir DIR;
> closedir DIR ;
>
> print @files ; #just here to see if it worked
>
> and I have 2 questions:
>
> 1 -- I'd like to use a UNC but:
>
> $path = '\\server\path\to\dir' ;
>
> doesn't work.
For a good reason: Try printing out that path. Now you see why I
suggested using forward slashes? You wouldn't have this problem :)
> 2 -- The print @files prints out (as expected) in a line, while I
> probably won't ever look at the actual output of this I'd like to know
> how to format the output.
print $_, "\n" for @files;
or maybe: print "@files\n"; # which is different, but possibly useful
--
Klein bottle for rent - inquire within.
------------------------------
Date: 28 Oct 2001 10:33:25 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl in PWS
Message-Id: <9rgmtl$ovm$3@uranium.btinternet.com>
gmanon <gmanon@netzero.net> wrote:
> I am trying to run Perl CGI on a MS-PWS in Windows98 and I keep getting this
> error
>
>
> The specified CGI application misbehaved by not returning a complete set of
> HTTP headers. The headers it did return are:
>
> Can't locate cgi-lib.pl in @INC (@INC contains: D:/Perl/lib D:/Perl/site/lib
> .) at C:\Inetpub\wwwroot\cgi-bin\greet.pl line 5.
>
> I wonder if I have to write the first code line like this:
>
> #!D:/Perl/lib/Perl.exe;
>
> Does anyone here knows how to solve this?
>
You will need to add the location of cgi-lib.pl to @INC using 'use lib'
something like:
use lib 'd:/path/to/lib';
However I would really suggest that you use the module CGI that comes
standard with modern Perl - this module has a cgi-lib.pl emulation layer
so you shouldnt have to change your programs all at once.
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: Sun, 28 Oct 2001 10:27:53 -0000
From: "Exodus" <exodus@thisaintreal.com>
Subject: Re: printing html
Message-Id: <k4RC7.18308$a14.1350518@news6-win.server.ntlworld.com>
"Jeff Zucker" <jeff@vpservices.com> wrote in message
news:3BDB2263.1D876A4@vpservices.com...
> I might suggest using either here-docs or the qq operator instead of
> backwhacking the quotes though:
>
> print qq ( <a href="http://www.kernel.org">www.kernel.org</a>\n );
>
> OR
>
> print <<END_OF_HTML;
> <a href="http://www.kernel.org">www.kernel.org</a>
> END_OF_HTML
Darn!
Back to the drawing board on my project then - you just saved me about 2
hours coding :o)
It's amazing what you learn when you don't even ask a question :o)
Ex.
------------------------------
Date: Sun, 28 Oct 2001 13:57:07 +0000
From: mark grimshaw <m.grimshaw@salford.ac.uk>
Subject: problems installing DBD::mysql
Message-Id: <3BDC0EB3.B154C7F2@salford.ac.uk>
Hi all,
As above on Linux RH7.0. I have mysql installed (rpm -q mysql reports:
mysql-3.23.22-6) and mysqld is running without problems. However,
trying to install DBD::mysql either via CPAN or manually produces errors
on make test -
no such file or directory for:
mysql.h
and
errmsg.h
I thought I should install Mysql from cpan. The CPAN install Mysql
starts by attempting to install DBD::mysql and produces the same
messages.
Anyone know what package I'm missing and where to get it from?
------------------------------
Date: Sun, 28 Oct 2001 14:33:10 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: problems installing DBD::mysql
Message-Id: <slrn9to5p6.rmp.garry@zfw.zvolve.net>
On Sun, 28 Oct 2001 13:57:07 +0000, mark grimshaw
<m.grimshaw@salford.ac.uk> wrote:
> As above on Linux RH7.0. I have mysql installed (rpm -q mysql reports:
> mysql-3.23.22-6) and mysqld is running without problems. However,
> trying to install DBD::mysql either via CPAN or manually produces errors
> on make test -
> no such file or directory for:
> mysql.h
> and
> errmsg.h
>
> I thought I should install Mysql from cpan. The CPAN install Mysql
> starts by attempting to install DBD::mysql and produces the same
> messages.
>
> Anyone know what package I'm missing and where to get it from?
You are missing part of the MySql distribution. It is *not* a part of
Perl. You probably should check http://www.mysql.com to obtain a
current distribution.
--
Garry Williams
------------------------------
Date: 28 Oct 2001 11:38:05 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Screen handling question
Message-Id: <9rgqmt$96q$3@neptunium.btinternet.com>
Colin Coe <coec@iinet.net.au> wrote:
> Hi all, I'm planying with a couple of screen handling modules (Curses and
> Term::Screen) but its not making much sense. I have looked at the demo's
> included with Curses, looked through perldoc and checked out www.perl.com
> but still no joy.
>
> Can anyone point me at 'real live' examples using either (or both) of these
> screen handling modules.
>
This is far from a real life example but it shows most of the things that
Term::Screen can do:
#!/usr/bin/perl
require Screen;
my $terminal = new Term::Screen;
$terminal->clrscr();
$terminal->at(12,36)->reverse()->puts("Whatever")->normal();
$terminal->getch();
$terminal->clrscr();
It will print "Whatever" in the middle of the screen and wait for a keypress
before terminating.
There appears to a problem with the current version of Term::Screen on CPAN
at the moment inasmuch as it installs itself as Screen and not Term::Screen
hence the 'require Screen' in the code above. I will mail the fix to the
author :)
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: Sun, 28 Oct 2001 20:48:16 +0800
From: "Colin Coe" <coec@iinet.net.au>
Subject: Re: Screen handling question
Message-Id: <3bdbfe91$0$12162@echo-01.iinet.net.au>
Thanks for the responce :)
What I want to do is have 3 windows with borders. The first 2 take up the
top 22 lines and 40 chars each, while the last is a sort of status area.
How do I put borders around these and how can I use scroll bars?
CC
"Jonathan Stowe" <gellyfish@gellyfish.com> wrote in message
news:9rgqmt$96q$3@neptunium.btinternet.com...
> Colin Coe <coec@iinet.net.au> wrote:
> > Hi all, I'm planying with a couple of screen handling modules (Curses
and
> > Term::Screen) but its not making much sense. I have looked at the
demo's
> > included with Curses, looked through perldoc and checked out
www.perl.com
> > but still no joy.
> >
> > Can anyone point me at 'real live' examples using either (or both) of
these
> > screen handling modules.
> >
>
>
> This is far from a real life example but it shows most of the things that
> Term::Screen can do:
>
> #!/usr/bin/perl
>
> require Screen;
>
> my $terminal = new Term::Screen;
>
>
> $terminal->clrscr();
>
> $terminal->at(12,36)->reverse()->puts("Whatever")->normal();
> $terminal->getch();
> $terminal->clrscr();
>
>
> It will print "Whatever" in the middle of the screen and wait for a
keypress
> before terminating.
>
> There appears to a problem with the current version of Term::Screen on
CPAN
> at the moment inasmuch as it installs itself as Screen and not
Term::Screen
> hence the 'require Screen' in the code above. I will mail the fix to the
> author :)
>
> /J\
> --
> Jonathan Stowe |
> <http://www.gellyfish.com> | This space for rent
> |
------------------------------
Date: Sun, 28 Oct 2001 03:09:01 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: set value of scalar
Message-Id: <3BDBBD1D.99EA4247@earthlink.net>
Jens Luedicke wrote:
>
> hi ...
>
> I want to improve this code ... Comments?
>
> $text = $from if $type eq "From";
> $text = $to if $type eq "To";
> $text = $cc if $type eq "Cc";
> $text = $subject if $type eq "Subject";
>
> The string in $type should
> define the scalar that should be used.
Here's a couple untested solutions.
$text = do {
if( $type eq "From" ) { $from }
elsif( $type eq "To" ) { $to }
elsif( $type eq "Cc" ) { $cc }
elsif( $type eq "Subject" ) { $subject }
};
Or how about:
$text = { From => $from, To => $to, Cc => $cc, Subject => $subject }
->{ $type };
--
Klein bottle for rent - inquire within.
------------------------------
Date: Sat, 27 Oct 2001 16:09:59 +0100
From: "Mercutio" <mercutio@digitalrice.com>
Subject: String Parsing...
Message-Id: <9rh7fg$b16$1@news6.svr.pol.co.uk>
Hey,
I'm attempting to write some perl code that solves Propositional logic.
The input will be a string of the following style:
"((A ^ B) => C)"
Which translates to '(A and B) implies C'.
When attempting to solve it, we generally use Semantic Tableu. You have to
solve the function by working it from the outside, in. In other words, you
start by doing the '=>' (Implies) part and from that, you do the '^' (And)
function.
The output for this example would be {{AC}, {BC}} because to make the input
true, either A and C need to be true, or B and C.
I can handle most things in Perl, except for string parsing. I'm going to
have to write functions to handle the different logical functions: AND, OR,
NOT, IMPLIES, IFF.
Can anyone suggest a method of parsing the string to work the input into the
output?
Cheers,
Tony
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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.
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 V10 Issue 2026
***************************************