[12049] in Perl-Users-Digest
Perl-Users Digest, Issue: 5649 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 13 04:07:19 1999
Date: Thu, 13 May 99 01:02:56 -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 Thu, 13 May 1999 Volume: 8 Number: 5649
Today's topics:
Newbie question on CGI developing (Ken Bass)
Re: Newbie question on CGI developing (Alastair)
Re: Newbie question on CGI developing (Charles R. Thompson)
Re: novice needs help--static variables (Tad McClellan)
Re: novice needs help--static variables (Alastair)
OPEN command doesn't work on NT machine <kuan-wee.lee@infineon.com>
perl install on bsd/os 3.1 <citeckeb@citec.qld.gov.au>
Perl Programmer in Las Vegas? <thickman@lvcm.com>
Re: PERLFUNC: eval - catch exceptions or compile code (Bart Lateur)
Problem with IIS 4 & Perl <roberto@iee.efei.br>
Re: Problem with IIS 4 & Perl (Alastair)
Re: reading data file (Tad McClellan)
Re: REGEXP HELP! (Tad McClellan)
Re: REGEXP HELP! (Larry Rosler)
REGULAR EXPRESSION problems (Ryan Ngi)
Re: REGULAR EXPRESSION problems <robbert@wethmar.demon.nl>
Saving output of CGI program in HTML file <bhaverajesh@hotmail.com>
Re: Security issues wth Perl-Win32 <bennettd@asdi.saic.com>
Re: Setting Environment Variables <hrdbdy@sprynet.com>
Re: SLOC (Alastair)
Re: SLOC (Larry Rosler)
Re: SLOC (Alastair)
string concatination ? tvn007@my-dejanews.com
Re: string concatination ? <ejohnso9@earthlink.net>
translating FAT to VFAT <jfm@bigfoot.de>
Trouble upgrading Perl <chrisb@assi.com>
Using LWP with openssl tool <brundlefly76@hotmail.com>
vb2perl <106274.2233@compuserve.com>
vb2perl <106274.2233@compuserve.com>
vb2perl <106274.2233@compuserve.com>
vb2perl <106274.2233@compuserve.com>
Re: vb2perl (Charles R. Thompson)
Re: vb2perl (I R A Aggie)
visual debugger for UNIX? <liquidcool@hotbot.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 13 May 1999 01:44:16 GMT
From: Barista@End.Of.Universe (Ken Bass)
Subject: Newbie question on CGI developing
Message-Id: <373a28b8.11976741@nntp1.ba.best.com>
I will humble myself at the onset here: I have just started with perl.
I just successfully finished my first cgi program. But I am far from
feeling confident about what I'm doing :-).
My situation now is that I am working with another person to create a
web site. That person is a graphics designer, and knows very little
about programming (although he does know the basics of html fairly
well). So his part is to develop the pages for the site, using
whatever html tools he has. My part, as a software developer, is to do
the cgi for the site.
The problem that keeps occuring is when my cgi programs need to
generate a page. At present, I have to get the html from the graphics
guy, and then code it into my perl program. This can get to be a pain,
not to mention a lot of typing, as well as a problem if he decides to
change anything on that page. (I should point out that right now, most
of these pages are simply responses to form submissions, although we
are looking at doing some pages with dynamic content).
I am basically looking for suggestions on how to work in a situation
like this. One thing I was wondering was if there was a way to use a
file that has something like an html template that my program could
use. The graphics guy could generate it and modify it as needed,
without having to worry about affecting the program.
Any constructive ideas or suggestions will be greatly appreciated.
TIA,
ken bass
kbb@SoftSteps.com
------------------------------
Date: Thu, 13 May 1999 02:04:35 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Newbie question on CGI developing
Message-Id: <slrn7jkgc5.h8.alastair@calliope.demon.co.uk>
Ken Bass <Barista@End.Of.Universe> wrote:
>I am basically looking for suggestions on how to work in a situation
>like this. One thing I was wondering was if there was a way to use a
>file that has something like an html template that my program could
>use. The graphics guy could generate it and modify it as needed,
>without having to worry about affecting the program.
Templates are certainly worth looking at. It might be a good idea to look at the
Text::Template module - find it at ;
http://www.cpan.org/modules/by-module/Text/
>From the doc ;
This is a good way to generate many kinds of output, such
as error messages and HTML pages. Here is one way I use
it: I am a freelance computer consultant; I write world-
wide web applications. Usually I work with an HTML
designer who designs the pages for me.
HTH.
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: Thu, 13 May 1999 04:21:48 GMT
From: design@raincloud-studios.com (Charles R. Thompson)
Subject: Re: Newbie question on CGI developing
Message-Id: <MPG.11a41eb0c12c24bc9896b5@news>
[This followup was posted to comp.lang.perl.misc and a copy was sent to
the cited author.]
In article <373a28b8.11976741@nntp1.ba.best.com>, Ken Bass says...
> So his part is to develop the pages for the site, using
> whatever html tools he has. My part, as a software developer, is to do
> the cgi for the site.
He will play video games, sleep awhile, knock something out at the last
second while you slave over code. I'm allowed to say that because I wear
both hats here and know the workload of each. ;)
> One thing I was wondering was if there was a way to use a
> file that has something like an html template that my program could
> use. The graphics guy could generate it and modify it as needed,
> without having to worry about affecting the program.
Oh yeah. I have a script or two in place that work this way now. If you
can become familiar with using s// and hashes in Perl, you could easily
have him include an agreed-upon 'tag system' where you will pull in a
page and replace the tag with your information in the script.
Using a hash, or other larger scale nested data structures can help
(hashes in hashes, etc) for more complex pages, but generally speaking a
simple hash system with key value pairs will get you started. The benefit
gained by using a hash is that you can match your replacement tag to an
'named element' in the hash... basically performing a simple lookup. If
you hash changes, or the page changes, doesn't matter. As long as you are
using the right names, you are good to go.
Your template may look like... (myhtml.html)
<html>
<head><title><replace="title"></title><head>
<body>
<p><replace="message">
<p><replace="footer">
<p><img src="<replace="myimage">">
</body>
</html>
NOTE:
<replace="thing">
has always worked for me since if it slips through your script the
browser will ignore it (because it doesn't know what it is, yet is inside
a tag structure) Some folks may have something to say about that.
Here's a simple script 'skeleton' which will perform the replacement for
you with this example. It should be enough to present the concept and
provide plenty of followups about issues involved with your project. For
this test, you'll either need to put the html file in the cgi-bin
directory, or recode the path appropriately. Since HTML files are rather
small, this should be applicable to just about anything.
#!/usr/bin/perl5 -w
# change this? ^
use strict;
print "Content-type: text/html\n\n";
# your example hash
my %pagestuff = (
'title' => 'This is a Title',
'message' => 'Hello World',
'footer' => 'socks, shoes',
'myimage' => 'image.gif',);
# open the file and immediately slurp it into a scalar
open (HTML_ARCHIVE, 'myhtml.html') || die("Oops.. no file");
my $pagelines = join ('', <HTML_ARCHIVE>);
close HTML_ARCHIVE;
my ($key,$value);
# iterate through each of the hash keys...
while ( ($key, $value) = each %pagestuff){
# find all instances of the named key and replace it
# with a value from the hash
$pagelines =~ s/<replace="$key">/$pagestuff{$key}/;
}
# viola! out to the browser we go.
print $pagelines;
#END
I have to admit, I pulled the original code out of a 2 year old script
defunct script of mine and modified it 'on the fly' to my newest level of
coding. It works, but you should check back on the thread as I'm sure
there will be follow ups.
Have fun,
--
Charles R. Thompson
RainCloud Studios
------------------------------
Date: Wed, 12 May 1999 12:54:55 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: novice needs help--static variables
Message-Id: <vobch7.3vg.ln@magna.metronet.com>
qq (bulldozer_69@hotmail.com) wrote:
: I'm trying to generate a unique identification number for a web based
: reporting system.
: Each report sent must have a unique id number.
: The syntax of the id number will be as follows:
: 1. It will have the last 2 digits of the year
: 2. Then a period
: 3. and then the number returned by a counter .
: This is incremented by 1 every time a new user sends the form in.
: and the counter is reset to 0 at the beginning of every year.
: also would it be a good idea to have a file that stores the value
: and have this file read from it every time?and rewrite the value
: every time its changed ..
Storing it in a file is a way to get persistence.
You will need to lock the file though.
The Perl FAQ, part 5 has some questions and answers that
will help you with this.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 13 May 1999 00:10:51 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: novice needs help--static variables
Message-Id: <slrn7jk9mv.5f.alastair@calliope.demon.co.uk>
qq <bulldozer_69@hotmail.com> wrote:
>hi ,
>i'm a starting perl user.
>I'm trying to generate a unique identification number for a web based
>reporting system.
If you're looking for unique ID generation methods then check dejanews. I seem
to remember a thread a short while ago on the subject here. For persistence, you
might want to check CPAN (http://www.cpan.org) - maybe the CGI module directory.
HTH.
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: Thu, 13 May 1999 14:55:43 +0800
From: KW Lee <kuan-wee.lee@infineon.com>
Subject: OPEN command doesn't work on NT machine
Message-Id: <373A776E.B1421AF5@infineon.com>
Hi,
I'm migrating al my .pl files from a UNIX machine to an NT machine.
There is one part of the code that needs to read a data file in the same
directory as the .pl file. It works fine on the UNIX machine previously,
but failed when running on NT machine.
------------------------------------
open (REFID, "SCPLReferenceID.dat") or die("Error: SCPLReferenceID.dat
can't open to read!\n");
while (<REFID>)
{
#Check if there's anything in the datafile
if ($_ ne "")
{
$OldID = $_;
}
}
close (REFID);
#Increment that Old ReferenceID
$RefNo = $OldID;
$RefNo = $RefNo + 1;
#Write that Reference ID back to the SCPLReferenceID.dat file
open (REFID, ">SCPLReferenceID.dat") or die("Error: SCPLReferenceID.dat
can't open to write!\n");
print REFID $RefNo;
close (REFID);
----------------------------------------
The program runs fine, until when it tries to open my
SCPLReferenceID.dat file, it would give this error message:
********
CGI Error
The specified CGI application misbehaved by not returning a complete set
of HTTP headers. The
headers it did return are:
Error: SCPLReferenceID.dat can't open to read!
********
I've change the permission of SCPLReferenceID.dat to "Full Control" for
everyone (which is similar to chmod 777 in UNIX), but it still doesn't
work.
I've even added a + sign and a < sign in before the filename in my OPEN
command, and it still doesn't solve the problem.
What else could have gone wrong?
KW Lee
wee@mailhost.net
------------------------------
Date: Thu, 13 May 1999 15:49:40 +1000
From: Ken Blinco <citeckeb@citec.qld.gov.au>
Subject: perl install on bsd/os 3.1
Message-Id: <373A67F4.3480C2A9@citec.qld.gov.au>
Hi,
I've posted an article recently concerning this - thanks for the responses.
Seems that I solve one problem and another one turns up.
Does anyone have any experience in installing a version of perl (5.004 or later)
on bsd/os v3.1 ? If so were there any tricks needed to get it right? My main
problem now is getting sockets to work, I need to make use of the Net modules,
so this is a critical component to the install.
Thanks
Ken
--
----------------------------------------------------------
Ken Blinco E-Mail: Ken.Blinco@citec.com.au
Unix Support Group Phone: +61 7 322 76970
CITEC, GPO Box 297 Brisbane, Queensland 4001 Australia
------------------------------
Date: Wed, 12 May 1999 18:37:59 -0700
From: "thickman" <thickman@lvcm.com>
Subject: Perl Programmer in Las Vegas?
Message-Id: <926559469.036.4@news.remarQ.com>
We need a part time perl programmer to help us with a new project. If you
live in the Las Vegas, NV area and are interested, please contact us.
Thanks,
Sam Dement
--
Handilinks
http://www.handilinks.com
Your Full Internet Directory and Search Engine
------------------------------
Date: Wed, 12 May 1999 22:27:40 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: PERLFUNC: eval - catch exceptions or compile code
Message-Id: <3739ffcc.436049@news.skynet.be>
Randal L. Schwartz wrote:
>Bart> I feel that something is missing from this title. eval() does not only
>Bart> compile code, it *executes* it too.
>
>Oh yeah?
>
>$coderef = eval 'sub { print "This code is not executed, merely compiled" }';
>
>:-)
<PEDANTIC>"Executing" a sub definition merely defines it.</PEDANTIC>
Bart.
------------------------------
Date: Wed, 12 May 1999 00:56:30 -0300
From: "Roberto" <roberto@iee.efei.br>
Subject: Problem with IIS 4 & Perl
Message-Id: <7hatss$cd8$1@gerson.iee.efei.br>
When I was using IIS3 the scrip was running, but now when i change to IIS4 i
recive this message:
"CGI Error
The specified CGI application misbehaved by not returning a complete set of
HTTP headers. The headers it did return are:
Can't open perl script "?????????????????i??????": Invalid argument"
PLEASE I need urgence help!!
thnk's
------------------------------
Date: Thu, 13 May 1999 00:05:22 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Problem with IIS 4 & Perl
Message-Id: <slrn7jk9cl.5f.alastair@calliope.demon.co.uk>
Roberto <roberto@iee.efei.br> wrote:
>When I was using IIS3 the scrip was running, but now when i change to IIS4 i
>recive this message:
Then it's a problem with the web server. Try asking in a newsgroup about web
servers e.g.
comp.infosystems.www.servers.ms-windows
HTH.
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: Wed, 12 May 1999 14:05:29 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: reading data file
Message-Id: <9tfch7.nah.ln@magna.metronet.com>
Peter Eisengrein (eisengre@atx.com) wrote:
: How do I process data in a file that is constantly incrementing (another
: program is regularly writing to this file) without re-reading the entire
: file each time, i.e. how do I process only the new data?
Perl FAQ, part 5:
"How do I do a C<tail -f> in perl?"
( "tail -f" on Unix prints new lines from the end of a file
as they arrive
)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 12 May 1999 13:11:21 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: REGEXP HELP!
Message-Id: <pncch7.3vg.ln@magna.metronet.com>
Jaroslaw M. Myszewski (myszewsk@cse.buffalo.edu) wrote:
: So whole array holds text
: from each text line I need to extract and store all (one or more)
: substings
: that begin with __ and end with ' or " or > or =
: how do I do that?
print "'$1'\n" while $variab =~ /__(.*?)["'=>]/g;
: I tried something like that
: foreach $variab (@Hold)
: {
: $variab !~ s/__(.*)(\"|\'|\=|\>)
That has a syntax error.
What is it that you want to substitute?
I thought you just needed to match them.
: }
: but instead of returing that substring it reuturned its complement
: (all that are NOT like regexp )
: I tried using =~ operator with same result
Yes, because you still have the same syntax error.
If you didn't have the syntax error, then you should not
be getting the "same result", but we cannot tell because
we are not looking at your code, we are looking at
pseudo-code with typos in it.
Don't type code. Use cut/paste.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 12 May 1999 15:43:01 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: REGEXP HELP!
Message-Id: <MPG.11a3a3ceedde313f989a52@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <Pine.GSO.3.96.990512152228.25928B-
100000@yeager.cse.Buffalo.EDU> on Wed, 12 May 1999 15:24:13 -0400,
Jaroslaw M. Myszewski <myszewsk@cse.buffalo.edu> says...
>
> Howdy, I need some help with parsing and regexps
> I'm parsing text file and putting whole line of text into an array slot.
> So whole array holds text
> from each text line I need to extract and store all (one or more)
> substings
> that begin with __ and end with ' or " or > or =
> how do I do that?
> I tried something like that
> foreach $variab (@Hold)
> {
> $variab !~ s/__(.*)(\"|\'|\=|\>)
> }
> but instead of returing that substring it reuturned its complement
> (all that are NOT like regexp )
> I tried using =~ operator with same result
Tim Armbruster is right -- you might post more useful code. What you
have above has a syntactically invalid regex, and you don't do anything
with the result in any case.
But here's a guess as to the regex you need, based on your text and
sample (assuming the line is in $_):
my @substrings = /(__.*?['">=])/g;
This may work somewhat faster, but is harder to type and get right:
my @substrings = /(__[^'">=]*['">=])/g;
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 07 May 1999 05:02:31 GMT
From: ryanngi@hotmail.com (Ryan Ngi)
Subject: REGULAR EXPRESSION problems
Message-Id: <373270dc.83213743@news.inet.co.th>
HI
i have 1 questions about regular expression.
1. give $Question='go to http://www.perl.com/CPAN/ you'll find it';
how can i change the $Question to
'go to <a href=http://www.perl.com/CPAN/>http://www.per.com/CPAN/</a>
you'll find it';
I've tried $Question=~s{(http://|ftp://)(\S+)}{<ahref=$1$2>$1$2</a>}i;
but it's not WORK!... what's wrong,..... how can i fix it!
------------------------------
Date: Thu, 13 May 1999 09:50:14 +0200
From: "Robbert Wethmar" <robbert@wethmar.demon.nl>
Subject: Re: REGULAR EXPRESSION problems
Message-Id: <926581983.19502.0.pluto.c3adf115@news.demon.nl>
When I tried your two lines of code they worked fine, exept for the extra
single quote in "you'll" which should be escaped like:
$Question='go to http://www.perl.com/CPAN/ you\'ll find it';
what exactly was the result you got?
greetings,
robbert
Ryan Ngi wrote in message <373270dc.83213743@news.inet.co.th>...
>HI
>
>i have 1 questions about regular expression.
>
>1. give $Question='go to http://www.perl.com/CPAN/ you'll find it';
> how can i change the $Question to
>'go to <a href=http://www.perl.com/CPAN/>http://www.per.com/CPAN/</a>
>you'll find it';
>
>I've tried $Question=~s{(http://|ftp://)(\S+)}{<ahref=$1$2>$1$2</a>}i;
>but it's not WORK!... what's wrong,..... how can i fix it!
>
------------------------------
Date: Thu, 13 May 1999 04:20:11 GMT
From: Rajesh Bhave <bhaverajesh@hotmail.com>
Subject: Saving output of CGI program in HTML file
Message-Id: <7hdjtn$gj2$1@nnrp1.deja.com>
Hello
My CGI program on server generates HTML and displays on the client
(browser). But, when I save the output it saves as progname.pl file
(progname is the CGI program name). Of course, I can save it as .html,
by changing the extension while saving. I want the output to be saved
as .html file when I try to save the output. Is there any way ?
Thanks
Rajesh Bhave
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: Wed, 12 May 1999 21:04:15 -0700
From: "Darren Bennett" <bennettd@asdi.saic.com>
Subject: Re: Security issues wth Perl-Win32
Message-Id: <87701800@NEWS.SAIC.COM>
Jonathan,
You are a bored young man aren't you??
You win.. I'm done with this 'thread' .. sorry to have wasted so much
bandwidth trying to get some knowledge from you.
-Darren
------------------------------
Date: Wed, 12 May 1999 23:28:22 -0400
From: Michelle Warner <hrdbdy@sprynet.com>
Subject: Re: Setting Environment Variables
Message-Id: <373A46D6.FA74F43F@sprynet.com>
Never mind...re-read mpeppler's FAQ page about this problem and duh, the
answer was there all along - I can just link to where the libraries are from
one of the more common libraries such as /usr/lib....Thanks for reading
though. :)
Michelle Warner wrote:
> I have a perl script which is executed from the web. The script
> interfaces to a Sybase database via Sybperl thus I need to have the
> LD_LIBRARY_PATH set to where the Sybase libraries are located. The
> script appears to run under the www user so I had my SA set the
> LD_LIBRARY_PATH but I am still having problems. I am not not sure if my
> SA restarted the Web server or if it needs to be restarted for this
> change to effect. I have information being Posted from a form so I am
> trying to avoid writing a shell script which would set this environment
> variable and then exec the other perl script. IF I did take this
> approach, how do I capture and pass the form information in the shell
> script. Thanks in advance.
>
> --
> Peace,
> Michelle
> http://home.sprynet.com/sprynet/hrdbdy
> ICQ# 17965901
>
> "Still I Rise" - Maya Angelou
--
Peace,
Michelle
http://home.sprynet.com/sprynet/hrdbdy
ICQ# 17965901
"Still I Rise" - Maya Angelou
------------------------------
Date: Wed, 12 May 1999 23:54:47 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: SLOC
Message-Id: <slrn7jk8oq.5f.alastair@calliope.demon.co.uk>
Nicolae Giurescu <nicolae_giurescu@srtelecom.com> wrote:
>I am looking for a Perl script to count the Source Lines of Code in C++
>files that are organized into hierarchical directory structures. Should
>anybody can give me some hints on where to find such a script or what would
>be a correct approach to develop one, I would greatelly appreciate it. When
>it comes to Perl, I'm a newbee :)
I'd be tempted to look at using the File::Find module, which is included with
standard Perl I believe. See the docs (perldoc File::Find). For examples of it's
use, it might be a good idea to check dejanews.
Once you have a list of filenames (maybe on an extension?), you can open them
and count the lines.
HTH.
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: Wed, 12 May 1999 17:49:19 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: SLOC
Message-Id: <MPG.11a3c16a210c9418989a57@nntp.hpl.hp.com>
In article <slrn7jk8oq.5f.alastair@calliope.demon.co.uk> on Wed, 12 May
1999 23:54:47 GMT, Alastair <alastair@calliope.demon.co.uk> says...
> Nicolae Giurescu <nicolae_giurescu@srtelecom.com> wrote:
> >I am looking for a Perl script to count the Source Lines of Code in C++
> >files that are organized into hierarchical directory structures. Should
> >anybody can give me some hints on where to find such a script or what would
> >be a correct approach to develop one, I would greatelly appreciate it. When
> >it comes to Perl, I'm a newbee :)
>
> I'd be tempted to look at using the File::Find module, which is included with
> standard Perl I believe. See the docs (perldoc File::Find). For examples of it's
> use, it might be a good idea to check dejanews.
>
> Once you have a list of filenames (maybe on an extension?), you can open them
> and count the lines.
'Source Lines of Code in C++ files' is not the same as the number of
lines in the files. Some parsing is necessary to remove blank lines and
lines that are exclusively comments. (I believe one counts preprocessor
directives and conditionally compiled code as source lines.)
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 13 May 1999 01:16:07 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: SLOC
Message-Id: <slrn7jkdha.5f.alastair@calliope.demon.co.uk>
Larry Rosler <lr@hpl.hp.com> wrote:
>
>'Source Lines of Code in C++ files' is not the same as the number of
>lines in the files. Some parsing is necessary to remove blank lines and
>lines that are exclusively comments. (I believe one counts preprocessor
>directives and conditionally compiled code as source lines.)
Absolutely true. As I wrote the reply I thought 'should I mention comments,
blanks lines etc.?' However, my thoughts were that getting to the stage of
counting 'lines of code' would inevitably lead to looking at what one wanted to
ignore. I would never consider 'source lines of code' as a simple 'wc -l'.
Best Wishes,
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: Thu, 13 May 1999 05:50:41 GMT
From: tvn007@my-dejanews.com
Subject: string concatination ?
Message-Id: <7hdp7h$kd6$1@nnrp1.deja.com>
Hi,
Would someone help me with this problem ?
Problem:
$line[1] = 010;
Want the output to be:
$line[1] = xxx010;
My solution:
for ($i = 0 ; $i < $number_of_x ; $i++){
$line[1] = x.$line[1]
}
------------------------------------
since $number_of_x could be thousand and I do not want goes
through the for loop thousand of times.
Would someone give be a better or more elegant solution ?
Thanks in advance,
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: Thu, 13 May 1999 00:00:52 -0700
From: Erik Johnson <ejohnso9@earthlink.net>
Subject: Re: string concatination ?
Message-Id: <373A78A4.8ECC35D4@earthlink.net>
tvn007@my-dejanews.com wrote:
> Hi,
>
> Would someone help me with this problem ?
>
> Problem:
>
> $line[1] = 010;
>
> Want the output to be:
>
> $line[1] = xxx010;
>
> My solution:
>
> for ($i = 0 ; $i < $number_of_x ; $i++){
> $line[1] = x.$line[1]
> }
>
> ------------------------------------
>
> since $number_of_x could be thousand and I do not want goes
> through the for loop thousand of times.
>
> Would someone give be a better or more elegant solution ?
>
> Thanks in advance,
>
> --== Sent via Deja.com http://www.deja.com/ ==--
> ---Share what you know. Learn what you don't.---
Actually there is a very slick way to do this sort of thing,
and I guess it is a common enough thing to want to do that
Larry actually made an operator for such, called the "string repetition"
operator (see pg. 37 of "The Llama Book", 2E)
/swdev/erikj >cat foo
#! /usr/local/bin/perl
$number_of_x = 3; # or any big number you like
$char = "x";
$foo = $char x $number_of_x; # then just tack $foo on the front of
whatever you want
print "\$foo = \"$foo\"\n";
HTH,
-ej
------------------------------
Date: Sun, 9 May 1999 22:26:44 +0200
From: "Jan-Friedrich Mutter" <jfm@bigfoot.de>
Subject: translating FAT to VFAT
Message-Id: <7h4qvt$ghv$1@union.informatik.uni-muenchen.de>
Hi,
is there a module or method or code available which is able to translate,
say 'C:\Progra~1' to 'C:\Program Files' ?
Cheers, Jan.
------------------------------
Date: Thu, 13 May 1999 01:13:15 GMT
From: "Christian Brink" <chrisb@assi.com>
Subject: Trouble upgrading Perl
Message-Id: <LGp_2.124$6z1.137660@client.news.psi.net>
I get this error message when I try and run a perl script w/ a use statement
since I have upgraded Perl 5.00503
@er object version 1.02 does not match $ 1.03 at
/usr/lib/perl5/5.00503/DynaLoader.pm line 80.
BEGIN failed--compilation aborted at ./pageme line 9.
I am running Perl on RH 5.2. The orginal perl installed was from an rpm. I
have upgraded by using an rpm and by compiling.
I know I am missing something, but I could not find a FAQ on it.
Any help is appreciated (preferable a point in the right direction)
THX
Christian Brink
chrisb@assi.com
------------------------------
Date: Thu, 13 May 1999 03:37:31 GMT
From: Brundle <brundlefly76@hotmail.com>
Subject: Using LWP with openssl tool
Message-Id: <7hdhdr$enq$1@nnrp1.deja.com>
I would like to use LWP to form a (basic authenticated) POST request,
and then pass the request through the openssl command-line utility with
the -s_client option.
Why? I can't maintain the tricky versioning issues
Crypt::SSLeay/SSLeay/LWP currently require for HTTPS support on FreeBSD.
I can do simple GETs easily with the utility, but I do not know enough
about how POSTS work to implement. The WC3 HTTP spec is not a very
effective how-to tool, either.
I (foolishly) thought I could just print the $req->as_string and do a:
./genrequest | openssl -s_client somehost.here.com:443
This doesn't work as it tries to process the first line (POST [uri])
before it even gets to the basic authentication header.
Help appreciated.
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: Thu, 13 May 1999 00:29:59 +0200
From: "Nokian" <106274.2233@compuserve.com>
Subject: vb2perl
Message-Id: <7hcvln$afg@selena.rz.uni-duesseldorf.de>
hi
I need a program, which translates visual basic source code into perl
source
code.
thanx!
(ich suche ein Programm, welches mir visual basic sources code in perl
|bersetzt.
Danke)
------------------------------
Date: Thu, 13 May 1999 00:29:59 +0200
From: "Nokian" <106274.2233@compuserve.com>
Subject: vb2perl
Message-Id: <7hcvq4$ak3@selena.rz.uni-duesseldorf.de>
hi
I need a program, which translates visual basic source code into perl
source
code.
thanx!
(ich suche ein Programm, welches mir visual basic sources code in perl
|bersetzt.
Danke)
------------------------------
Date: Thu, 13 May 1999 00:29:59 +0200
From: "Nokian" <106274.2233@compuserve.com>
Subject: vb2perl
Message-Id: <7hcvs1$akr@selena.rz.uni-duesseldorf.de>
hi
I need a program, which translates visual basic source code into perl
source
code.
thanx!
(ich suche ein Programm, welches mir visual basic sources code in perl
|bersetzt.
Danke)
------------------------------
Date: Thu, 13 May 1999 00:29:59 +0200
From: "Nokian" <106274.2233@compuserve.com>
Subject: vb2perl
Message-Id: <7hd013$ani@selena.rz.uni-duesseldorf.de>
hi
I need a program, which translates visual basic source code into perl
source
code.
thanx!
(ich suche ein Programm, welches mir visual basic sources code in perl
|bersetzt.
Danke)
------------------------------
Date: Thu, 13 May 1999 00:48:05 GMT
From: design@raincloud-studios.com (Charles R. Thompson)
Subject: Re: vb2perl
Message-Id: <MPG.11a3eca130a62d09896b3@news>
[This followup was posted to comp.lang.perl.misc and a copy was sent to
the cited author.]
In article <7hcvq4$ak3@selena.rz.uni-duesseldorf.de>, Nokian says...
> I need a program, which translates visual basic source code into perl
> source code.
You need a 12 step program for obsessive compulsive disorders. 5 posts!
I don't know if anything like that exists. You might try
www.activestate.com and see what turns up.
--
CT
------------------------------
Date: 13 May 1999 02:02:18 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: vb2perl
Message-Id: <slrn7jkcq9.rd5.fl_aggie@stat.fsu.edu>
On Thu, 13 May 1999 00:29:59 +0200, Nokian <106274.2233@compuserve.com>, in
<7hcvq4$ak3@selena.rz.uni-duesseldorf.de> wrote:
+ I need a program, which translates visual basic source code into perl
+ source code.
I think comp.lang.perl.humor is down the hall, three doors on the left...
James
------------------------------
Date: Thu, 13 May 1999 01:03:07 GMT
From: Phil Yurchuk <liquidcool@hotbot.com>
Subject: visual debugger for UNIX?
Message-Id: <373A24CB.B9CDF5F2@hotbot.com>
Hello,
I was wondering if there existed a reliable visual debugger for perl
that ran under X. I'm developing on a Solaris 2.6 machine, and was
hoping to find something like xxgdb. Does xemacs interact with the
standard perl debugger? I know it cooperates with the Sun Workshop
debugger quite well.
As for those who are vehemently opposed to anything with a GUI, I
respect your opinion, and have come to the same conclusion in many
areas, for many tasks. I just happen to be more efficient with a visual
debugger than with a standard one.
Thanks in advance,
Phil
------------------------------
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 5649
**************************************