[10962] in Perl-Users-Digest
Perl-Users Digest, Issue: 4563 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 6 12:07:18 1999
Date: Wed, 6 Jan 99 09:00:25 -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 Wed, 6 Jan 1999 Volume: 8 Number: 4563
Today's topics:
Re: Apache Problem: Can display but not execute marimba@atlcom.net
Can't find my way with a map <jerryp.usenet@connected.demon.co.uk>
CGI offline mode: enter name=value pairs on standard in <kohl@dik.maschinenbau.tu-darmstadt.de>
Re: CGI offline mode: enter name=value pairs on standar <collin.starkweather@colorado.edu>
Re: Checking for a Charictor in a Variable <staffan@ngb.se>
Re: Checking for a Charictor in a Variable (Tad McClellan)
Re: Combining Animated Gifs in Perl? <dana@nowhere.com>
Deleting a line in a HTML File <keithd@moss.co.uk>
Re: Dynamic gifs on the fly <chaimwerz@yahoo.com>
Editors (Was: Re: If Larry Wall's listening out there.. (Clay Irving)
Re: How do I create a unique (reproducible) identifier? <staffan@ngb.se>
Re: I can't resist sharing this with you.... (Tad McClellan)
Re: If Larry Wall's listening out there.... (Marc Haber)
Re: If Larry Wall's listening out there.... <Brett.Diamond@lmco.com>
Re: If Larry Wall's listening out there.... <jim.michael@gecm.com>
Re: If Larry Wall's listening out there.... <ludlow@us.ibm.com>
JOB - CONTRACT POSITION (DICO)
JOB - CONTRACT WORK (DICO)
JOB-CA Application Engineers johnspot@hotmail.com
Re: Modules and Mysql <mjordan@rogers.wave.ca>
Nasty regexp .... help! <zack44@altavista.net>
Nasty regexp .... I'm stumped. <zack44@altavista.net>
Nasty regexp .... I'm stumped. <zack44@altavista.net>
Nasty regexp .... I'm stumped. <zack44@altavista.net>
Nasty regexp .... I'm stumped. <zack44@altavista.net>
Newbie Question joining to perl programms <dietmar.kling@sam-net.de>
Re: OK I give up (After a WEEK!) (Marc Austin)
Re: Opening remote file <dana@nowhere.com>
Re: Password Encryption (Clay Irving)
Re: Password Encryption <r2-d2@REMOVEbigfoot.com>
Re: Password Encryption <collin.starkweather@colorado.edu>
Perl & Java ? <jjv@caesun.msd.ray.com>
Re: Perl & Java ? <dnp@ams.org>
PERLLIB env problem <akelingos@petrosys-usa.com>
Position for Programmer/Analyst <cmcnamar@maximgroup.com>
Problem connecting to Sybase from Perl sharda@hotmail.com
problems with system call hanging <dana@nowhere.com>
Shame: Deleting List Elements <rj@suse.de>
Short way to do this with a regexp?? Delete certain cha (Charles Wilt)
Re: Short way to do this with a regexp?? Delete certain <staffan@ngb.se>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 06 Jan 1999 16:28:33 GMT
From: marimba@atlcom.net
Subject: Re: Apache Problem: Can display but not execute
Message-Id: <7702vd$msb$1@nnrp1.dejanews.com>
Found the answer to my own question. Probably should have gone in an Apache
group, my apologies.
Apache implies that their cgi-bin directory is set up and ready to go on a
fresh install. I found that I actually had to uncomment the ScriptAlias line
in srm.conf before it would work. I didn't have to alter the actual content.
In article <76thio$ds7$1@nnrp1.dejanews.com>,
marimba@atlcom.net wrote:
> This is a straight up newbie problem but I've tried the most common fixes for
> it. When I enter the URL for the script multiply.cgi, it displays the code
> instead of the output.
>
> 1) multiply.cgi has #!/usr/local/bin/perl which is an existing shell
> 2) multiply.cgi's permissions are 777
> 3) multiply.cgi is located in the cgi-bin directory
> 4) According to Apache docs, in a new installation, the cgi-bin directory is
> ready to go and doesn't need to be ScriptAliased or anything. This is a new
> installation of both Apache and Perl
> 5) Versions are Apache 1.3.0 and Perl 5.004.04
>
> Does anybody have any suggestions other than the first 3 canned suggestions?
>
> Thanks,
> CB
> m a r i m b a @ a t l c o m . n e t
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 6 Jan 1999 16:16:47 +0000
From: Jerry Pank <jerryp.usenet@connected.demon.co.uk>
Subject: Can't find my way with a map
Message-Id: <DR2nTBAvx4k2EwgS@connected.demon.co.uk>
I want to use map to remove leading/trailing quotes that may exist in a
tab delimited file:
Something along the lines of:
@data = map { s/^"|"$//g; } split /\t/, $line;
What do I need to change so @data is the result of the s/// rather than
the number of matches?
I can obviously do this in two lines but one would be neater and the map
answer would satisfy my curiosity.
-- Jerry Pank http://www.netconnected.com/
jerryp.usenet@netconnected.com
The whole intent of Perl 5's module system was to encourage the growth
of Perl culture rather than the Perl core.
-- Larry Wall in <199705101952.MAA00756@wall.org>
------------------------------
Date: Wed, 06 Jan 1999 15:47:32 +0100
From: Uwe Kohl <kohl@dik.maschinenbau.tu-darmstadt.de>
Subject: CGI offline mode: enter name=value pairs on standard input
Message-Id: <36937783.B9353E9E@dik.maschinenbau.tu-darmstadt.de>
--------------09769D5682964EB83CDEE103
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hello,
I just installed Perl 5.00502 to use CGI.pm.
It seems all ok, but when I start, for exampel, this test-script:
#!/dfs/users/kohl/perl/bin/perl
use CGI qw/:standard/;
print header (),
start_html(-title=>'Wow!'),
h1('WOW!'),
'Look MA no hands!',
end_html();
I get the error message: "offline mode: enter name=value pairs on
standard input"
With Cntrl D input the script goes on, but I want to call it from HTML.
What's wrong?
Thanks
--
---------------------------------------------------------------------------
Dipl.-Ing. Uwe Kohl DDDD K K
FG Datenverarbeitung in der Konstruktion (DiK) D D *** K K
TU Darmstadt D D *** K K
Petersenstr.30 D D KK
D-64287 Darmstadt D D I KK
Tel: +49 6151 16 5484 D D I K K
Fax: +49 6151 16 6854 D D I K K
Email: kohl@dik.maschinenbau.tu-darmstadt.de DDDD IIIII K K
WWW: http://www.dik.maschinenbau.tu-darmstadt.de
---------------------------------------------------------------------------
--------------09769D5682964EB83CDEE103
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hello,
<br>I just installed Perl 5.00502 to use CGI.pm.
<br>It seems all ok, but when I start, for exampel, this test-script:
<p>#!/dfs/users/kohl/perl/bin/perl
<br>use CGI qw/:standard/;
<br>print header (),
<br> start_html(-title=>'Wow!'),
<br> h1('WOW!'),
<br> 'Look MA no hands!',
<br> end_html();
<p>I get the error message: "offline mode: enter name=value pairs on standard
input"
<br>With Cntrl D input the script goes on, but I want to call it from HTML.
<p>What's wrong?
<br>
<p>Thanks
<pre>--
---------------------------------------------------------------------------
Dipl.-Ing. Uwe Kohl DDDD K K
FG Datenverarbeitung in der Konstruktion (DiK) D D *** K K
TU Darmstadt D D *** K K
Petersenstr.30 D D KK
D-64287 Darmstadt D D I KK
Tel: +49 6151 16 5484 D D I K K
Fax: +49 6151 16 6854 D D I K K
Email: kohl@dik.maschinenbau.tu-darmstadt.de DDDD IIIII K K
WWW: <A HREF="http://www.dik.maschinenbau.tu-darmstadt.de">http://www.dik.maschinenbau.tu-darmstadt.de</A>
---------------------------------------------------------------------------</pre>
</html>
--------------09769D5682964EB83CDEE103--
------------------------------
Date: Wed, 06 Jan 1999 09:13:01 -0700
From: Collin Starkweather <collin.starkweather@colorado.edu>
To: Uwe Kohl <kohl@dik.maschinenbau.tu-darmstadt.de>
Subject: Re: CGI offline mode: enter name=value pairs on standard input
Message-Id: <36938B8D.999@colorado.edu>
Uwe Kohl wrote:
>
> Hello,
> I just installed Perl 5.00502 to use CGI.pm.
> It seems all ok, but when I start, for exampel, this test-script:
>
> #!/dfs/users/kohl/perl/bin/perl
> use CGI qw/:standard/;
> print header (),
> start_html(-title=>'Wow!'),
> h1('WOW!'),
> 'Look MA no hands!',
> end_html();
>
> I get the error message: "offline mode: enter name=value pairs on
> standard input"
> With Cntrl D input the script goes on, but I want to call it from
> HTML.
>
> What's wrong?
>
>
> Thanks
>
> --
> ---------------------------------------------------------------------------
>
> Dipl.-Ing. Uwe Kohl DDDD K K
> FG Datenverarbeitung in der Konstruktion (DiK) D D *** K K
> TU Darmstadt D D *** K K
> Petersenstr.30 D D KK
> D-64287 Darmstadt D D I KK
> Tel: +49 6151 16 5484 D D I K K
> Fax: +49 6151 16 6854 D D I K K
> Email: kohl@dik.maschinenbau.tu-darmstadt.de DDDD IIIII K K
> WWW: http://www.dik.maschinenbau.tu-darmstadt.de
> ---------------------------------------------------------------------------
>
>
That's not an error message. You are just running the script from the
command line, and it wants some CGI form parameters. Since it is not
being passed any from a browser, it wants you to type them in.
Hook it up to the web and you'll be fine.
------------------------------
Date: Wed, 06 Jan 1999 17:30:01 +0100
From: Staffan Liljas <staffan@ngb.se>
Subject: Re: Checking for a Charictor in a Variable
Message-Id: <36938F89.557C5B98@ngb.se>
RTFM: perlre, perlop
------------------------------
Date: Wed, 6 Jan 1999 10:35:57 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Checking for a Charictor in a Variable
Message-Id: <dd3077.cl2.ln@magna.metronet.com>
Artoo (r2-d2@REMOVEbigfoot.com) wrote:
: How can you check to see if a character exists with-in a variable. ie: I
: need to check there is an @ sign anywhere in the variable inorder to
: process.
print "there is an @ sign in \$var ($var)\n" if $var =~ tr/@/@/;
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 06 Jan 1999 10:42:24 -0500
From: dana <dana@nowhere.com>
Subject: Re: Combining Animated Gifs in Perl?
Message-Id: <36938460.8D65FB8C@nowhere.com>
You don't even need perl for this. The easiset way to do this is to use
GIF Construction Set. It's a super easy to use program that lets you do
this sort of thing and can be found at http://www.mindworkshop.com/ the
have a fully functioning demo version.
Diana
Mike wrote:
> Does any one know of a program that would allow me to combine two gifs,
> one animated and one unanimated? By combining I mean place the
> unanimated one to the right of the animated one and combine it into one
> image file. I have been using fly but it seems that it doesn;t support
> animated gifs. Please reply if you know of any program or if you have
> some source code that would allow this in perl. Thanks.
------------------------------
Date: Wed, 06 Jan 1999 15:54:32 +0000
From: Yoann Le Corvic <keithd@moss.co.uk>
Subject: Deleting a line in a HTML File
Message-Id: <36938738.5BD27354@moss.co.uk>
Hello
I created a small system that generate an index of file dynamically
using perl. When a user from the Internet send a request, it's stored,
and a new line is added in the index. But now, I have another problem. I
need to remove this line dyna,ically when someone from support reply to
it.
I can I remove dynamically a table line from a HTML Document ???
Thanks
Yoann Le Corvic
Internet Administrator
------------------------------
Date: Wed, 06 Jan 1999 11:14:06 -0500
From: Leonord Wertzberger <chaimwerz@yahoo.com>
Subject: Re: Dynamic gifs on the fly
Message-Id: <36938BCE.6D5741FC@yahoo.com>
Hi thanks for your reply!
Can you please direct me to the question topic where this was discussed - I am still very new to
perl. Also what does DejaNews mean and where can I find it?
TIA
Leo
brian d foy wrote:
> In article <76rrhv$276s$1@node17.cwnet.frontiernet.net>, "Leo" <chaimwerz@yahoo.com> posted:
>
> > Does anyone overhere know a perl script that could paste me together 2 gifs
> > (a picture frame & a metal greting add on)On the fly according to a users
> > input?
>
> this sort of thing is trivial with Image::Magick or some of the other
> solutions given to the same question earlier this week.
>
> good luck :)
>
> --
> brian d foy
> CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: 6 Jan 1999 10:22:55 -0500
From: clay@panix.com (Clay Irving)
Subject: Editors (Was: Re: If Larry Wall's listening out there....)
Message-Id: <76vv4f$2pp@panix.com>
if (talk_about($editor_preference)) {
print "The subject has been discussed to death.\n";
die "A horrible death.\n";
}
--
Clay Irving
clay@panix.com
------------------------------
Date: Wed, 06 Jan 1999 17:24:25 +0100
From: Staffan Liljas <staffan@ngb.se>
Subject: Re: How do I create a unique (reproducible) identifier?
Message-Id: <36938E39.32D9C759@ngb.se>
Hi!
> >Oops! How do you write a hash to a file, and then retrieve it such
> >that it's still a hash? Is there a quick way, other than iterating
> >through the whole thing, turning it into some kind of array or
> >something?
>
> Use a tied hash. See the documentation on tie and/or dbmopen.
But how does this work if two processes access the same file at the same
time (as might _very_ well be the case over the internet). Maybe this
was a stupid question.
Staffan
------------------------------
Date: Wed, 6 Jan 1999 10:21:43 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: I can't resist sharing this with you....
Message-Id: <ni2077.862.ln@magna.metronet.com>
Andrew Mayo (andrew@geac.co.nz) wrote:
: I asked a short while ago if anyone had an elegant solution to the problem
: of matching text between balanced parentheses. I received a reply from
: someone whose name I omit, not because I wish in any way to hide their
: authorship, but to avoid exposing them to spam.
: The resulting snippet of Perl has to be the most cunning and elegant piece
: of code I think I have ever seen in 22 years of programming. After 15
: minutes of careful study I *still* don't exactly see how it works, though I
: am, of course, a Perl novice, to say the least. Slightly modified from the
: original, here it is
: while (<>)
: {
: ($re=$_)=~s/(\()|(\))|./\1.\2/sg;
I liked it too.
I enshrined it in my slick_tricks/ directory when it was posted
here in August '97 (Subject: Re: can regexp do balanced match?).
I converted it to be -w clean, though it doesn't look as pretty:
($re=$_)=~s/([()]|.)/if ( $1 eq '(' )
{ '(.' }
elsif ( $1 eq ')' )
{ '.)' }
else
{ '.' }
/sge;
But for Most Elegant Piece of Code Ever, I would have to
go with the one below, which prints a representation of
a directory tree:
find . -print | sed -e 's,[^/]*/\([^/]*\)$,`--\1,' -e 's,[^/]*/,| ,g'
(also posted here in August '97,
Subject: Re: Visual representation of UNIX Directories
)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 06 Jan 1999 14:04:18 GMT
From: Marc.Haber-usenet@gmx.de (Marc Haber)
Subject: Re: If Larry Wall's listening out there....
Message-Id: <76vqh2$8e4$2@news.rz.uni-karlsruhe.de>
"Andrew Mayo" <andrew@geac.co.nz> wrote:
>Those of us working in a Windows environment generally will use notepad as a
>text editor.
Notepad is for masochistic minds only. There are numerous freeware
drop-in replacements available.
Greetings
Marc
--
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber | " Questions are the | Mailadresse im Header
Karlsruhe, Germany | Beginning of Wisdom " | Fon: *49 721 966 32 15
Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fax: *49 721 966 31 29
------------------------------
Date: Wed, 06 Jan 1999 09:05:05 -0500
From: Brett Diamond <Brett.Diamond@lmco.com>
Subject: Re: If Larry Wall's listening out there....
Message-Id: <36936D8D.DB8FC379@lmco.com>
You might want to consider changing editors... I suggest xemacs, even though
the Wondows version is in beta. Xemacs is perhaps a bit overblown for your
needs, but is one fine editor, "knows" perl (context-sensitive coloring, help,
etc), can be used to interactively debug your Perl code, and can even be used
to access news groups. You can find it at:
ftp://ftp.xemacs.org/pub/xemacs/beta/xemacs-21.0/
The most recent version as of this writing is xemacs-install-990105.EXE
Andrew Mayo wrote:
> Dear Larry and friends,
>
> What a wonderful thing you have wrought.... but there's one small
> detail.....
>
> Those of us working in a Windows environment generally will use notepad as a
> text editor. Simple-mindedly, notepad does *not* display line numbers. (it
> also doesn't do brace matching, but this I can live with)
>
> Unfortunately, perl's syntax checker appears to assume we'll be using
> something like vi, and so I get things like
>
> Missing right bracket at line 101...
>
> and with no printed context of where the parser blew up, I have to count
> lines. This gets rapidly tedious. Particularly since I am not a very
> experienced Perl programmer, to say the least...
>
> I cannot find a command-line switch to give me more detailed error
> reporting; if there is one, my apologies, but what I really would like is
>
> foo(x,y,z
> ^
> Missing right bracket at line 101
>
> (the ^ is supposed to be just after the z, should your browser mangle the
> above)
>
> Is there any way I can get Perl to print the context of the error message or
> am I stuck counting lines. If the latter, may I humbly suggest this as an
> enhancement for a future version?. While you're in there, how about a
> severity level option for warnings, too, so that the -w flag could take a
> parameter to indicate just how picky Perl ought to be.
>
> PS:
>
> At the risk of incurring the flames and wrath of a zillion Perl programmers,
> and, worse, being a novice by my own admission, some aspects of Perl strike
> me as worthy of mention, in comparison to other programming languages I have
> used.
>
> Pros
>
> 1. Incredibly powerful for text munging - which is why I am using it, since
> I have a bunch of VB programs to mangle and I certainly wouldn't want to try
> mangling them given VB's very limited string functions.
>
> 2. Portable and concise, yet efficient; can process a lot of stuff with
> amazing speed on even humble hardware.
>
> 3. Rock-solid and extremely well documented (thanks, O'Reilly and
> associates).
>
> 4. Can't beat the price.
>
> 5. Tied variables - what an excellent idea. Also the package concept and the
> way objects have been implemented.
>
> Cons
>
> (note: I raise these because I want to write elegant yet maintainable code
> and these cons seem to put barriers up in front of me - perhaps illusory
> ones, of course, were I more knowledgeable)
>
> 1. Programs rapidly become unreadable if special care isn't taken to comment
> carefully. This is due not just to leaning toothpick syndrome, which is
> curable by careful choice of quote characters, as well as the quotemeta
> function, but because almost every metacharacter sequence that could exist
> has a semantic meaning which of course can't be deduced without looking it
> up, until you become a Perl veteran. Of course C++ suffers badly from this,
> too. At the other extreme, I know COBOL has been roundly condemned for its
> verbosity but MOVE A TO B or PERFORM X VARYING Y FROM 1 BY 1 UNTIL Y > 3
> express the intent in such a way that the syntax, once learnt, is never
> forgotten. I have not written a line of COBOL for 10 years, but I think most
> of the language is still with me - it has so much noise in it.
>
> 2. No macro pre-processor (AFAIK) which would let me add a bit of syntactic
> sugar; most experienced C programmers find #define and #typedef are
> invaluable for rendering sense out of chaos.
>
> 3. The variable argument list array is a nice idea but lack of proper
> subroutine prototypes makes code rather obscure. Yes, I do see the section
> on Perl 5.003 prototypes but, using VB as an example this time..
>
> sub DrawImage(pic as Picture, optional rotation as degrees=zero_degrees)
>
> it is relatively clear that the first argument is a picture, and the second,
> optional argument is the rotation in degrees, with the default being zero
> (degrees would be defined as an enum, probably, with perhaps four values for
> 0,90,180, and 270 degrees). Also the noiseword 'sub' tells me this routine
> returns nothing, as does
> 'void' in C - how do I indicate this in Perl?.
>
> I don't see how to write Perl code which comes close to being
> self-documenting in this way, particularly function arguments.
>
> A further, related issue is that arguments appear to be passed by reference,
> so that special care needs to be taken to avoid side-effects and there does
> not appear to be an easy way for the function prototype to define that an
> argument or arguments should be passed by value instead, as there is in both
> C and VB.
>
> 4. Lack of structures (aka VB types) and enums - at least, I can't find such
> things. Sure, hashes are very nice, but they're not really the same thing.
>
> 5. Try as I might, I find the bind operator counter-intuitive. Operating on
> $_ by default was probably a good idea back when Perl was sort of
> ancestrally-related to Awk, but having to use $myvar=~.... to get around
> this still seems peculiar; I may or may not actually be assigning to $myvar
> depending on whether the right-hand side of the expression is a match or a
> substitute.
>
> 6. Lack of strong typing. There are times when you want to prevent someone
> from assigning a string to an integer and I don't see how to do this with
> Perl - in fact, I don't know how to define a variable as being of a specific
> type (other than an array, or a hash or a simple variable). Variables just
> 'spring into existence' as they did in early versions of BASIC - which can
> lead to some very obscure programming errors. Does 'use strict' really help
> here?.
>
> 7. Lack of structured exception handling (I may, however, be wrong here, I
> just haven't found it yet).
>
> 8. No switch() or case statement, leading to nasty indented if... else if
> type of constructs.
>
> I conclude from these observations, some or all of which may turn out to be
> mistaken, that Perl is suitable for fairly small programs (and indeed, was
> designed this way, in all fairness) but that large Perl programming projects
> will need considerable care in order to be maintainable. Has anyone out
> there had experience in maintaining large (>10,000 line) Perl programs or
> program suites, and if so, what techniques would you recommend to maximise
> maintainability, other than the obvious recourse of commenting every line,
> which is currently what I am doing?.
>
> You may think that the notion of writing larger systems in Perl is
> ludicrous, but consider that if you want platform portability your current
> mainstream choices are
>
> (a) C/C++ - compiled, hence slow development cycle, needs to be rebuilt on
> each target platform, limited string processing (to say the least), easy to
> create memory leaks.
>
> (b) Java - primitive runtime libraries, lacks powerful string functions,
> still evolving, not under ANSI or open source control and hence subject to
> vendor change. Has to be compiled to JVM each time source is changed, unless
> someone knows of an incremental Java compiler (in which case this would have
> to be widely available across platforms
>
> or
>
> (c) Perl - open source, hence widely available for almost all platforms,
> interpreted, short development cycle, powerful string processing,
> extendable.
>
> As we move to GUI RAD environments under, say, Linux, we need a quick
> development language, similar to what we have with Visual Basic under
> Windows. Is Perl going to be that future, or Java, or some other language?.
> I understand someone's working on a Visual Perl, for instance.
------------------------------
Date: Wed, 06 Jan 1999 09:23:21 -0500
From: Jim Michael <jim.michael@gecm.com>
Subject: Re: If Larry Wall's listening out there....
Message-Id: <369371D9.73E8@gecm.com>
> Missing right bracket at line 101...
>
> and with no printed context of where the parser blew up, I have to count
> lines. This gets rapidly tedious. Particularly since I am not a very
> experienced Perl programmer, to say the least...
d:\edit filename
The dos editor has line number indicator at the bottom of the screen.
Still, not a programmer's editor. Try something like PFE.
Cheers,
Jim
------------------------------
Date: Wed, 06 Jan 1999 09:55:58 -0600
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: If Larry Wall's listening out there....
Message-Id: <3693878E.778A850A@us.ibm.com>
todda wrote:
> there are variant of vi which can be found on the web at no cost. vim, vile
> and elvis. I believe that these all have win32 versions. I know vim can be
> found in win32.
vim for Win32 also comes with its GUI counterpart, gvim. I've found
this to be a very nice editor for programming. (Of course, anything
that gave me auto indent would be a step up from Notepad.)
--
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)
------------------------------
Date: Wed, 06 Jan 1999 15:23:05 GMT
From: dico@internetworks.ca (DICO)
Subject: JOB - CONTRACT POSITION
Message-Id: <MPG.10fd580ced933bcd989681@news.mtt.net>
Hi,
I need a perl programmer to create a database program. This database
will contain about 200 entries. Some entries will have more fields then
others. The field information in each entry will be used to create a
simply web page which will basically list the information in a neat table
and show an image.
So basically what will happen from a web surfers point of view is that
they will want information on product A8395 and the perl script searches
the database, finds the entry which matches that product id number, and
then creates a web page which reflects the information in the database.
If this sounds like something you can do, please email
info@internetworks.ca for more information.
Notes: Perl, Unix
------------------------------
Date: Wed, 06 Jan 1999 15:24:24 GMT
From: dico@internetworks.ca (DICO)
Subject: JOB - CONTRACT WORK
Message-Id: <MPG.10fd5878bf55f5af989682@news.mtt.net>
Hi,
I need a perl programmer to create a database program. This database
will contain about 200 entries. Some entries will have more fields then
others. The field information in each entry will be used to create a
simply web page which will basically list the information in a neat table
and show an image.
So basically what will happen from a web surfers point of view is that
they will want information on product A8395 and the perl script searches
the database, finds the entry which matches that product id number, and
then creates a web page which reflects the information in the database.
If this sounds like something you can do, please email
info@internetworks.ca for more information.
Notes: Perl, Unix
------------------------------
Date: Wed, 06 Jan 1999 15:25:09 GMT
From: johnspot@hotmail.com
Subject: JOB-CA Application Engineers
Message-Id: <76vv8i$j3s$1@nnrp1.dejanews.com>
Responsible for paid design and implementation of high profile knowledge
distribution applications for major customers such as Goldman Sachs,
Cisco, AT&T, Carlson Travel, and RiteAid.
The ideal candidate has application design and development experience
for the professional services group of a software vendor or consulting
firm and is fluent in C++, HTML, and PERL.
Dbase(SQL, Oracle, ODBC), TCP/IP networking, Java, ASP, middleware
experience a plus.
Good communications skills and writing skills are important as well.
50% travel
This is a full-time position and is extremely strategic within the company and
offers leadership potential. Extremely competitive equity, salary, and bonus
package. Tele-Commute/Available immediately.
Please email your resume to johnspot@hotmail.com
or fax to: 408-975-0583
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 06 Jan 1999 08:19:32 -0800
From: Mark Jordan <mjordan@rogers.wave.ca>
Subject: Re: Modules and Mysql
Message-Id: <36938D14.30EC1FBD@rogers.wave.ca>
Hi Gary,
There's documentation and examples at
http://mysql.turbolift.com/mysql/DBD_3.21.X.html .
Mark Jordan
lefkogt.xp@usafa.af.mil wrote:
> Is there a reference on how to manipulate Mysql databases with PERL? I know I
> can use:
>
> use dbi; or
> use Mysql;
>
> modules but is there a reference as to what I can do? Sort of like CGI.pm?
> Thanks
> Gary
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 06 Jan 1999 11:29:24 -0500
From: Zack <zack44@altavista.net>
Subject: Nasty regexp .... help!
Message-Id: <36938F64.A4DA4A9C@altavista.net>
I don't know if it's possible to do this in a single expression, but here's what I've been beating my head against the wall trying to do:
Scan a text string with the following rules:
1. Some words are "required"
2. Other words are "optional"
3. Others are to be "screened"
4. Not all 3 of these types of words will be searched for each time, and there may be multiples of each type.
5. In other words, a given search may have 1 word 2 screen 1 required word, and 2 optional words. Another search would have 1 optional word only .... etc.
6. For each string searched, I need to report back the number of required matches, the number of optional matches, and the number of screened matches for reporting purposes.
What I've done so far is build up arrays containing the search terms (@opt, @req, @screen) and then try and go through them, building a big regexp string. No luck, and quite frankly, my brain is a bit cooked from looking at it so long.
Any ideas? Is it possible to do this in a single =~ line?
Thanks!
------------------------------
Date: Wed, 06 Jan 1999 11:26:51 -0500
From: Zack <zack44@altavista.net>
Subject: Nasty regexp .... I'm stumped.
Message-Id: <36938ECB.C0DA0410@altavista.net>
I don't know if it's possible to do this in a single expression, but here's what I've been beating my head against the wall trying to do:
Scan a text string with the following rules:
1. Some words are "required"
2. Other words are "optional"
3. Others are to be "screened"
4. Not all 3 of these types of words will be searched for each time, and there may be multiples of each type.
5. In other words, a given search may have 1 word 2 screen 1 required word, and 2 optional words. Another search would have 1 optional word only .... etc.
6. For each string searched, I need to report back the number of required matches, the number of optional matches, and the number of screened matches for reporting purposes.
What I've done so far is build up arrays containing the search terms (@opt, @req, @screen) and then try and go through them, building a big regexp string. No luck, and quite frankly, my brain is a bit cooked from looking at it so long.
Any ideas? Is it possible to do this in a single =~ line?
Thanks!
------------------------------
Date: Wed, 06 Jan 1999 11:27:33 -0500
From: Zack <zack44@altavista.net>
Subject: Nasty regexp .... I'm stumped.
Message-Id: <36938EF5.B300CC1C@altavista.net>
I don't know if it's possible to do this in a single expression, but here's what I've been beating my head against the wall trying to do:
Scan a text string with the following rules:
1. Some words are "required"
2. Other words are "optional"
3. Others are to be "screened"
4. Not all 3 of these types of words will be searched for each time, and there may be multiples of each type.
5. In other words, a given search may have 1 word 2 screen 1 required word, and 2 optional words. Another search would have 1 optional word only .... etc.
6. For each string searched, I need to report back the number of required matches, the number of optional matches, and the number of screened matches for reporting purposes.
What I've done so far is build up arrays containing the search terms (@opt, @req, @screen) and then try and go through them, building a big regexp string. No luck, and quite frankly, my brain is a bit cooked from looking at it so long.
Any ideas? Is it possible to do this in a single =~ line?
Thanks!
------------------------------
Date: Wed, 06 Jan 1999 11:28:07 -0500
From: Zack <zack44@altavista.net>
Subject: Nasty regexp .... I'm stumped.
Message-Id: <36938F17.6AE06CA2@altavista.net>
I don't know if it's possible to do this in a single expression, but here's what I've been beating my head against the wall trying to do:
Scan a text string with the following rules:
1. Some words are "required"
2. Other words are "optional"
3. Others are to be "screened"
4. Not all 3 of these types of words will be searched for each time, and there may be multiples of each type.
5. In other words, a given search may have 1 word 2 screen 1 required word, and 2 optional words. Another search would have 1 optional word only .... etc.
6. For each string searched, I need to report back the number of required matches, the number of optional matches, and the number of screened matches for reporting purposes.
What I've done so far is build up arrays containing the search terms (@opt, @req, @screen) and then try and go through them, building a big regexp string. No luck, and quite frankly, my brain is a bit cooked from looking at it so long.
Any ideas? Is it possible to do this in a single =~ line?
Thanks!
------------------------------
Date: Wed, 06 Jan 1999 11:26:31 -0500
From: Zack <zack44@altavista.net>
Subject: Nasty regexp .... I'm stumped.
Message-Id: <36938EB7.A6A97F8D@altavista.net>
I don't know if it's possible to do this in a single expression, but here's what I've been beating my head against the wall trying to do:
Scan a text string with the following rules:
1. Some words are "required"
2. Other words are "optional"
3. Others are to be "screened"
4. Not all 3 of these types of words will be searched for each time, and there may be multiples of each type.
5. In other words, a given search may have 1 word 2 screen 1 required word, and 2 optional words. Another search would have 1 optional word only .... etc.
6. For each string searched, I need to report back the number of required matches, the number of optional matches, and the number of screened matches for reporting purposes.
What I've done so far is build up arrays containing the search terms (@opt, @req, @screen) and then try and go through them, building a big regexp string. No luck, and quite frankly, my brain is a bit cooked from looking at it so long.
Any ideas? Is it possible to do this in a single =~ line?
Thanks!
------------------------------
Date: Wed, 06 Jan 1999 15:33:16 +0100
From: Dietmar Kling <dietmar.kling@sam-net.de>
Subject: Newbie Question joining to perl programms
Message-Id: <3693742C.FFE67E6B@sam-net.de>
Hello
I am new to perl
I succesfully opened a webpage from a webserver and I want to remove
HTML Tags
This works if i put it in 2 scripts (one which loads the html page and
one perl program which filters the loaded page)
How can I join the code ?
I am new to perl, maybe i missed something important
Regards
Dietmar
At this pointed I succesfully opened the page
........
local $/ = "\n%%\n";
my $html;
while (<HTTPSERVER>)
{
# **************** This code works in a seperate script ******
if ( /^\<PRE/ ) {
# Now we lookup </PRE> (-> 0 Hits )
if ( /\<\/PRE\>/ )
{
print "0 Hits\n";
exit 0;
}
$html = $_;
$html =~ s/<[^>]*>//gs; # Strip HTML Tags
print $html;
{
local $/="</PRE>";
$html = <HTTPSERVER>;
$html =~ s/<[^>]*>//gs; # Strip HTML Tags
printf $html;
}
# *********************
}
}
close HTTPSERVER;
------------------------------
Date: Wed, 06 Jan 1999 08:31:49 -0800
From: placeit@easyad.com (Marc Austin)
Subject: Re: OK I give up (After a WEEK!)
Message-Id: <placeit-0601990831490001@blv-lx100-ip33.nwnexus.net>
Thanks everyone for your help (especially Greg!) This has to be the most
helpful newsgroup on the Net!
Unfortunately, I still haven't resolved this... The snippet is part of a
larger script, so (Greg,) if I were to use "use strict;" I would pretty
much have to rewrite the entire script. (next time ok?)
Maybe what I need is a standalone script, that resends the lost key...
Here's the test form I'm trying to get working...
http://www.treasurenet.com/cgi-bin/treasure/newkey.pl
Here's the text file I'm searching in it's entirety...
206.63.40.32-14118-897075016 me1@treasurenet.com
206.81.244.150-13845-897092360 me2@treasurenet.com
206.63.42.57-26391-897078547 me3@treasurenet.com
206.63.40.26-20433-915566748 me4@treasurenet.com
153.37.198.141-7833-915571660 me5@treasurenet.com
If you submit me3@treasurenet.com in the form above, the script should return
897078547 as field1, and me3@treasurenet.com as field2, but it is
returning the entire last line as field1 and nothing for field2. Ugh!
Here's the snippet
sub split_key {
$email_found = 0;
open(KEYEMAIL,"$email_file") || die "can't open $email_file\n";
@keyemail = <KEYEMAIL>;
chop(@keyemail);
close(KEYEMAIL);
foreach (@keyemail) {
($field1,$field2) = split(/ /);
if ($field2 == $FORM{'email'}) {
$email_found = 1;
$matched_password = $field1;
$matched_email = $field2;
}
}
if ($email_found) {
print "Content-type: text/html\n";
print "\n";
print "<html><head><title>Success!</title></head>\n";
print "<body>\n";
print "<center>This is a test<p>Field1 - $matched_password<p>Field2
- $matched_email\n";
print "<p></center></body></html>\n";
}
}
------------------------------
Date: Wed, 06 Jan 1999 10:50:32 -0500
From: dana <dana@nowhere.com>
Subject: Re: Opening remote file
Message-Id: <36938648.FD48261A@nowhere.com>
Well, this is probably an inelegant solution but seeing as no one else has
responded yet . . . you could use the perl FTP module to retrieve the file
first and then use the open( ) command.
Diana
Henrik Ruud wrote:
> How do I open a file from ANOTHER SERVER into a variable in a perl-script?
>
> Henrik Ruud
------------------------------
Date: 6 Jan 1999 10:16:26 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Password Encryption
Message-Id: <76vuoa$20g@panix.com>
In <76vkp3$ovu$1@plug.news.pipex.net> "Artoo" <r2-d2@REMOVEbigfoot.com> writes:
>What is the best way to store passwords encrypted on a server? How do I
>encode them and decode them to check on log-in to script?
I'm tempted to answer, "The best way to store passwords encrypted on a
UNIX server is in the supplied passwd file." ...but I suspect you really
mean to ask another question.
--
Clay Irving
clay@panix.com
------------------------------
Date: Wed, 6 Jan 1999 15:25:56 -0000
From: "Artoo" <r2-d2@REMOVEbigfoot.com>
Subject: Re: Password Encryption
Message-Id: <76vvcu$552$1@plug.news.pipex.net>
Does the crypt function only work on UNIX, or is there an NT version? (If
so where can I get it)
Thanks
Mike wrote in message <3693686D.24757D41@counter.w-dt.com>...
>Use perls crypt function. It can't be decrypted, you just crypt both with
>the same salt and then compare them.
>
------------------------------
Date: Wed, 06 Jan 1999 09:09:38 -0700
From: Collin Starkweather <collin.starkweather@colorado.edu>
Subject: Re: Password Encryption
Message-Id: <36938AC2.7017@colorado.edu>
Artoo wrote:
>
> Does the crypt function only work on UNIX, or is there an NT version? (If
> so where can I get it)
>
> Thanks
>
> Mike wrote in message <3693686D.24757D41@counter.w-dt.com>...
> >Use perls crypt function. It can't be decrypted, you just crypt both with
> >the same salt and then compare them.
> >
While crypt comes standard issue for unix builds, only the latest
ActivePerl distribution has the crypt function for NT; e.g.,
D:\>perl -e "print crypt 'salt','pepper'"
pe129l1Z.qpL2
D:\>
------------------------------
Date: Wed, 06 Jan 1999 09:25:56 -0500
From: Jason Varsoke <jjv@caesun.msd.ray.com>
Subject: Perl & Java ?
Message-Id: <36937274.A0F18244@caesun.msd.ray.com>
I'm looking for a way to interface a few perl functions with a Java
GUI that I have. Does anyone know where I can find any information on
this topic. Thanks.
Please send reply to jjv@caesun.msd.ray.com
my news access is limited.
-jason
------------------------------
Date: Wed, 06 Jan 1999 11:40:31 -0500
From: Dan Pelton <dnp@ams.org>
To: Jason Varsoke <jjv@caesun.msd.ray.com>
Subject: Re: Perl & Java ?
Message-Id: <369391FF.3D00CD3A@ams.org>
I read that there is a JPerl package which lets you call perl
functions from java. It might do what you want.
You can find it at http://www.angelfire.com/in/sbm/
Dan
------------------------------
Date: 6 Jan 1999 15:23:37 GMT
From: "Alec Kelingos" <akelingos@petrosys-usa.com>
Subject: PERLLIB env problem
Message-Id: <01be3988$cb2cd100$7637ebcf@psusa6.petrosys-usa.com>
Hi there,
I'm not a perl expert and really need some advice. We just installed perl
on a Solaris box and are having a problem finding .pm files. We have
PERLLIB set to /apps/perl5004/lib and we find .pm files in that directory
just fine. The problem is that none of the sub-directories are checked.
How do we get perl to check PERLLIB (or PERL5LIB) and all of its
sub-directories?
Thanks in advance,
Alec
------------------------------
Date: Wed, 06 Jan 1999 11:40:47 -0500
From: Christian McNamara <cmcnamar@maximgroup.com>
Subject: Position for Programmer/Analyst
Message-Id: <3693920E.DEDB38EF@maximgroup.com>
Since 1987, Maxim Group has been a leader in providing Information
Technology professionals to all companies. We focus on providing you a
path to achieve your goals both personally and professionally. Please
take a moment to call and see what opportunities we may have for you.
Presently we are in need of professionals with the following skill sets:
A Programmer/Analyst to work on a market Risk Application using Perl and
Korn Shell. We are looking for someone with 2 or 3 years experience.
The platform being used is Unix with a Solarius flavour. (Version 5.1
or 2.6). This position is available ASAP and is located in downtown
Toronto at a major financial institution. The position is a month long
contract. Maxim Group offers free software training and world class
customer service to
all of our consultants. For more information, please contact Chris
McNamara at 1-800-241-5950 or 905-501-2830 or e-mail me at the address
below.
Chris McNamara
Maxim Group
cmcnamar@maximgroup.com
------------------------------
Date: Wed, 06 Jan 1999 14:38:23 GMT
From: sharda@hotmail.com
Subject: Problem connecting to Sybase from Perl
Message-Id: <76vsgv$gau$1@nnrp1.dejanews.com>
Hi Everybody,
My local machine is IRIX6.5
For Perl, the version is 5.003
And Sybase version is 11
I am facing the following problem when I try to connect to Sybase, from
Perl, using Sybperl:
Can't load '/usr/local/lib/perl5/IP19-irix/auto/Sybase/DBlib/DBlib.so' for
module Sybase::DBlib: 1002:/usr/local/bin/perl5: rld: Fatal Error:
unresolvable symbol in /usr/local/lib/perl5/IP19-
irix/auto/Sybase/DBlib/DBlib.so: sv_yes at /usr/local/lib/perl5/DynaLoader.pm
line 140.
at /usr/local/lib/perl5/Sybase/DBlib.pm line 97
BEGIN failed--compilation aborted at test.pl line 5.
The filename of the perl script is called test.pl and on its line 5, I have
written use Sybase::DBlib
Is it possible that the perl binary which I am using has been created(it has
been created by someone else) for older versions of IRIX?
I am not able to figure out the problem. Please help! :(
Thanx in advance.
Rajesh
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 06 Jan 1999 10:28:23 -0500
From: dana <dana@nowhere.com>
Subject: problems with system call hanging
Message-Id: <36938117.9B1B3933@nowhere.com>
I was wondering if anyone had any suggestions . . .
Using the open( ) command, I am attempting a system call and putting the
results in a file handle as such:
open(FILEHANDLE, " system command |") || die "generic die message";
which works fine unless the system command hangs. My question is; how
do I detect that the command is hung and kill the pid of the script? I
know that I will probably use "kill $$" to kill the perl script process
but I am not sure how to detect that the system command is hung.
thanks in advance for any suggestions.
Diana
dmears@navisite.com
------------------------------
Date: Wed, 06 Jan 1999 16:25:36 +0100
From: Richard Jelinek <rj@suse.de>
Subject: Shame: Deleting List Elements
Message-Id: <36938070.534CBB6@suse.de>
Hi,
either there are tomatoes on my eyes or I'm still a bloody perl-newbie:
@list = (1,2,3,4,5);
How do I delete element 3? I mean not to clear it, I mean delete. I know
shift,pop et al. but I need to delete elements inside a list.
<do_some_magic_thing>
print join ':',@list;
=> 1:2:4:5
How???
--
Bye,
Rico
------------------------------
Date: 6 Jan 1999 14:54:32 GMT
From: charles.0272@worldnet.no.spam.att.net (Charles Wilt)
Subject: Short way to do this with a regexp?? Delete certain chars from string.
Message-Id: <MPG.10fd46e978c025e49896b2@netnews.worldnet.att.net>
I need to replace the following characters with a space if the appear in
a string:
\ / : * ? " < > |
The string will be used as a filename. I think I can do this in multiple
lines with each line handling one char. But I wonder if there is a way
to do this in one line.
Thanks for the help.
--
Charles Wilt
Miami Luken, Inc.
e-mail: charles.0272@worldnet.no.spam.att.net
--->remove the no.spam.
------------------------------
Date: Wed, 06 Jan 1999 17:37:40 +0100
From: Staffan Liljas <staffan@ngb.se>
Subject: Re: Short way to do this with a regexp?? Delete certain chars from string.
Message-Id: <36939154.81309F25@ngb.se>
> I need to replace the following characters with a space if the appear
> in a string:
> \ / : * ? " < > |
Why not
s/[\Q\/:*?"<>|\E]/ /g;
But you might also try
s/\W/ /g;
which replaces everything but alphanumerics and underscore with space
(all from perlre)
Staffan
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 4563
**************************************