[15437] in Perl-Users-Digest
Perl-Users Digest, Issue: 2847 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Apr 23 14:08:47 2000
Date: Sun, 23 Apr 2000 11:05:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <956513111-v9-i2847@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 23 Apr 2000 Volume: 9 Number: 2847
Today's topics:
call sub from browser dmayo2@yahoo.com
Re: call sub from browser <tmp0001@unixsnedkeren.dk>
Re: call sub from browser nobull@mail.com
Re: call sub from browser alexandria_sarkut@my-deja.com
Re: compiling ActivePerl with gcc on NT (Socket.pm issu james_mancz@my-deja.com
Re: Date standardization without Date::Manip <rootbeer@redcat.com>
Re: DBD::Sybase and/or freeTDS oddities <rootbeer@redcat.com>
Re: DBI::ODBC arguments for Supra database client drive <rootbeer@redcat.com>
executing sub in a module without calling it <dimitrio@perlnow.com>
Re: executing sub in a module without calling it <tony_curtis32@yahoo.com>
Re: Good Techniques and Practices <home@cordova.net>
Re: How to execute Perl Bytecode ??? <rootbeer@redcat.com>
Re: I want to use the login name. How can I get the log (Kragen Sitaker)
Re: local function question <gellyfish@gellyfish.com>
Need a perl script that searches a flat file db onsightflash@pacific.net.sg
Re: Need a perl script that searches a flat file db <rootbeer@redcat.com>
Re: Need HELP with IPC::Sharable <rootbeer@redcat.com>
Need some help with an easy subroutine <lgse@homail.com>
Re: Need some help with an easy subroutine <flavell@mail.cern.ch>
Re: Need some help with an easy subroutine (Kragen Sitaker)
Re: Need some help with an easy subroutine <tmp0001@unixsnedkeren.dk>
Perl Benchmarking <josh@projectperl.com>
Re: Perl Benchmarking <rootbeer@redcat.com>
Perl CGI Download ()
Re: Perl CGI Download <rootbeer@redcat.com>
Re: perlcc: No dbm on this machine? <rootbeer@redcat.com>
Re: Plugin based perl app? <marshalc@americasm01.nt.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 23 Apr 2000 16:41:02 GMT
From: dmayo2@yahoo.com
Subject: call sub from browser
Message-Id: <8dv92s$2l7$1@nnrp1.deja.com>
Hello...
I was wondering if there is a way to call a subroutine in a perl script
directly from the browsers location bar.
e.g.
/cgi-bin/perlsrcipt.cgi?subroutine3
Thanks.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 23 Apr 2000 18:52:48 +0200
From: Thorbjoern Ravn Andersen <tmp0001@unixsnedkeren.dk>
Subject: Re: call sub from browser
Message-Id: <39032A60.6F5D09C1@unixsnedkeren.dk>
dmayo2@yahoo.com wrote:
>
> Hello...
>
> I was wondering if there is a way to call a subroutine in a perl script
> directly from the browsers location bar.
>
> e.g.
>
> /cgi-bin/perlsrcipt.cgi?subroutine3
Not as such but you can write a launcher (use CGI.pm for that) which
uses eval to call the subroutine of your choice.
I would suggest quite some checks for validity in your code...
--
Thorbjørn Ravn Andersen "...plus...Tubular Bells!"
http://www.mip.sdu.dk/~ravn
------------------------------
Date: 23 Apr 2000 18:02:40 +0100
From: nobull@mail.com
Subject: Re: call sub from browser
Message-Id: <u9vh18n427.fsf@wcl-l.bham.ac.uk>
dmayo2@yahoo.com writes:
> I was wondering if there is a way to call a subroutine in a perl script
> directly from the browsers location bar.
Define "directly".
> e.g.
>
> /cgi-bin/perlsrcipt.cgi?subroutine3
Obviously a CGI script can choose to interpret the QUERY_STRING in any
way it likes.
If you want to interpret this as a fuction just do:
use CGI;
no strict 'refs';
&{query_string()}();
Note this is a security hole you could drive a truck through - do not
even consider actually doing this.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Sun, 23 Apr 2000 17:40:37 GMT
From: alexandria_sarkut@my-deja.com
Subject: Re: call sub from browser
Message-Id: <8dvcij$6av$1@nnrp1.deja.com>
In article <8dv92s$2l7$1@nnrp1.deja.com>,
dmayo2@yahoo.com wrote:
> Hello...
>
> I was wondering if there is a way to call a subroutine
> in a perl script directly from the browsers location bar.
>
> e.g.
>
> /cgi-bin/perlsrcipt.cgi?subroutine3
Not only is this possible, this is a method
often used by programmers. Employing use of
query string references is logical and affords
you an ability to combine any number of scripts
into one single master script.
You may reference a sub-routine by direct location
bar reference, by form action reference, by usual
hyperlink reference or a bookmark reference.
http.../script.cgi?Routine=3&Word=program
In this example above you would reference
sub-routine number 3 and input "program".
Your sub-routine number 3 might be a
dictionary and would return a definition
for the word "program" in response.
http.../script.cgi?Routine=biography&Name=Abraham+Lincoln
Your script would run a biography sub-routine
and return information on President Abraham Lincoln.
If routine input equals biography,
run sub biography, name is Abraham Lincoln.
Using a query string reference to select a
specific sub-routine is an excellent choice
in both program and data base management.
Andrea Alexandria Sarkut
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 23 Apr 2000 15:33:49 GMT
From: james_mancz@my-deja.com
Subject: Re: compiling ActivePerl with gcc on NT (Socket.pm issue)
Message-Id: <8dv54s$uno$1@nnrp1.deja.com>
If you're using gcc-2.95.2, then you'll need to
download the patch for this version from
ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-
win32/mingw32/gcc-2.95.2/fixes/quote-fix-
msvcrt.exe
That should do the trick.
In article <8ditab$sc5$1@nnrp1.deja.com>,
nawkboy@yahoo.com wrote:
> I would like to write some Perl packages with C
extensions on a Windows
> NT platform. (I wouldn't normally use windows
but in this case I
> really need to have my code run there.)
>
> To avoid buying Microsoft Visual C++ (at least
for now), I have been
> attemping to compile ActiveState5.6.0.613 using
Mingw32(gcc) and
> dmake. Everything I have read indicates that I
must use the same
> compiler for building my XS code that was used
for compiling the Perl
> binary. Since I don't want to buy MS Visual
C++, this means I can't
> use the binary available from ActiveState.
>
> Now that I have hopefully prevented the "Why
are you doing this?"
> responses, I will describe my problem.
>
> Using the default makefile.mk in the win32
directory and changing only
> INST_DRV, INST_TOP, and CCHOME I get everything
to start compiling just
> fine. I am using the same version of gcc and
dmake requested in the
> README.win32 file of the distrib.
> Unfortunately, way into the compilation I get
the following error
> concerning Socket.pm:
>
> Reading specs from D:\gcc-2.95.2-
msvcrt\bin\..\lib\gcc-lib\i386-
> mingw32msvc\2.95.2\specs
> gcc version 2.95.2 19991024 (release)
> ld -o ..\x2p\a2p.exe D:\gcc-2.95.2-
msvcrt\bin\..\lib\gcc-lib\i386-
> mingw32msvc\2.95.2\..\..\..\..\i386-
mingw32msvc\lib\crt2.o -L
> d:\gccPerl\lib\CORE -Ld:\gcc-2.95.2-msvcrt\lib -
LD:\gcc-2.95.2-
> msvcrt\bin\..\lib\gcc-lib\i386-
mingw32msvc\2.95.2 -LD:\gcc-2.95.2
> -msvcrt\bin\..\lib\gcc-lib -LD:\gcc-2.95.2-
msvcrt\bin\..\lib\gcc-
> lib\i386-mingw32msvc\2.95.2\..\..\..\..\i386-
mingw32msvc\lib -L
> D:\gcc-2.95.2-msvcrt\bin\..\lib\gcc-lib\i386-
mingw32msvc\2.95.2
> \..\..\.. C:\TEMP\mk00042d -lmingw32 -lgcc -
lmoldname -lmsvcrt -l
> user32 -lkernel32 -ladvapi32 -lshell32 -
lmingw32 -lgcc -lmoldname -
> lmsvcrt
> cd ..\ext\Socket && \
> ..\..\miniperl -I..\..\lib Makefile.PL
INSTALLDIRS=perl
> Writing Makefile for Socket
> cd ..\ext\Socket && D:\dmake-4.1pl1\dmake.exe -S
> mkdir ..\..\lib\auto\Socket
> cp Socket.pm ..\..\lib\Socket.pm
> ..\..\miniperl -I..\..\lib -
I..\..\lib ..\..\lib\ExtUtils/xsubpp -
> noprototypes -
typemap ..\..\lib\ExtUtils\typemap Socket.xs > S
> ocket.xsc && ..\..\miniperl -I..\..\lib -
I..\..\lib -
> MExtUtils::Command -e mv Socket.xsc Socket.c
> gcc -c -g -O2 -DWIN32 -DHAVE_DES_FCRYPT -
DPERL_IMPLICIT_CONTEXT -
> DPERL_IMPLICIT_SYS -fno-strict-aliasing -
DPERL_MSVCRT_READFIX
> -g -O2 -DVERSION=\"1.72\" -
DXS_VERSION=\"1.72\" -
> I..\..\lib\CORE Socket.c
> Socket.c: In function `boot_Socket':
> Socket.c:1224: incompatible type for argument 1
of `strcmp'
> dmake.exe: Error code 1, while
making 'Socket.o'
> dmake.exe: Error code 255, while
making '..\lib\auto\Socket\Socket.dll'
>
> I have searched the Perl newsgroups and
websites and not found any
> mention of this problem. I am just learning
C++ so I expect the
> problem is outside my skill set. If I had a
patch file, I could
> probably figure out how to apply it and
complete the compilation. I
> could then move on to becoming proficient at
wrapping C++ product API's
> with Perl XS code on a Windows platform. (If
the product API was
> available on Unix I wouldn't be trying to do
this on Windows NT!)
>
> As a side note, it seems Borland's 5.5 compiler
has problems too, but
> there is a patch given on one of the newsgroups
on ActiveState's web
> site.
>
> Thanks in advance for any help.
>
> Jimmy Carpenter
> 713-358-2662
> jcarpenter@questia.com
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 23 Apr 2000 08:59:13 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Date standardization without Date::Manip
Message-Id: <Pine.GSO.4.10.10004230851500.25963-100000@user2.teleport.com>
On Sat, 22 Apr 2000 danrode@my-deja.com wrote:
> Date::Manip seems to be capable of dealing with much of the work, but
> it's large size would cause performance problems.
Have you seen the advice in the Date::Manip docs about "SHOULD I USE
DATE::MANIP"? Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 23 Apr 2000 08:19:15 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: DBD::Sybase and/or freeTDS oddities
Message-Id: <Pine.GSO.4.10.10004230811370.25963-100000@user2.teleport.com>
On Fri, 21 Apr 2000, Jay Flaherty wrote:
> I posted this on c.l.p.modules with no response.
If your question didn't get an answer the first time you asked it, there's
a reason for that. Maybe it was unclear what you wanted. Maybe it looked
like you were asking for a fish, rather than asking to learn how to fish.
Maybe nobody has an answer. Maybe you didn't wait long enough before you
gave up. Maybe it wasn't the most appropriate newsgroup. There are lots of
possible reasons. Asking here isn't likely to fix any of them, unless
perhaps you should have posted here in the first place.
If you've asked clearly and no one has responded in a reasonable amount of
time, there's something else you can try before asking again. In reading
the newsgroup during the last month (you _have_ been doing that, haven't
you?) you must have noticed at least two or three people who post
frequently, politely, and accurately. A short, polite letter by private
e-mail to one of these folks asking for meta-help (help on getting help on
your problem) would not be out of line.
> I find it hard to believe that nobody is using the freeTDS driver with
> the Sybase.pm module to access MS SQLServer from a Sun box running
> Solaris 2.8.
That's pretty specific. Are you sure your problem comes up only in that
configuration?
Good luck with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 23 Apr 2000 07:58:32 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: DBI::ODBC arguments for Supra database client driver ?
Message-Id: <Pine.GSO.4.10.10004230757490.25963-100000@user2.teleport.com>
On Fri, 21 Apr 2000, William Herrera wrote:
> Does anyone know the syntax for the Supra driver used for access to an
> HP/UX database running one of Cincom corporation's SQL database
> servers?
Perhaps you should try to find the documentation for one of those non-Perl
things. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 23 Apr 2000 17:31:42 GMT
From: "Dimitri Ostapenko" <dimitrio@perlnow.com>
Subject: executing sub in a module without calling it
Message-Id: <2sGM4.142122$1C2.3351919@news20.bellglobal.com>
I need to run init sub in a package every time this package is loaded.
Is there way to do it?
tx.
Dimitri
------------------------------
Date: 23 Apr 2000 12:45:56 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: executing sub in a module without calling it
Message-Id: <87purgww17.fsf@shleppie.uh.edu>
>> On Sun, 23 Apr 2000 17:31:42 GMT,
>> "Dimitri Ostapenko" <dimitrio@perlnow.com> said:
> I need to run init sub in a package every time this
> package is loaded. Is there way to do it?
Could you provide an example of what you want to do?
Normally a package will only get loaded once for an
execution session when it is used or required, i.e. it is
not clear what you mean by "every time".
perldoc perlmod would be a good place to look for some
info, especially about BEGIN, or possibly INIT, blocks (if
I interpret your situation correctly).
hth
t
------------------------------
Date: Sun, 23 Apr 2000 12:13:06 -0600
From: Peter <home@cordova.net>
Subject: Re: Good Techniques and Practices
Message-Id: <39033D32.33AB6A97@cordova.net>
Jonathan Stowe wrote:
> People tend to think that Rapid Application Development is mutually exclusive
> with the 'old fashioned' practices of Analysis, Specification and Design:
> I dont think that this is the case, indeed, where you have more than one
> developer working on a project it becomes essential.
>
> A clear specification that describes the inputs, outputs and constraints
> upon a system might not be necessary where you are a single programmer
> working in isolation and you can keep the whole thing in your head at once
> but when a project grows beyond what you can sensibly keep in your head
> or requires the input of more than one developer then these things will
> need to be defined overtly in some way and should be defined before the
> actual development begins.
Although not a discussion of "how to do this in Perl" I think this topic
is vital.
I am one of those (no doubt scorned by many) guys who picked up Perl on
the fly while seeking a job in the IT world since my last job was not
nearly as interesting (not profitable in my case: importing/marketing
English books on tape in Brazil).
I read "Learning Perl" etc. and suddenly I was "programmer". I've got
about 150 more books now and I've found that the "method of programming"
is very important. There is always more than ... in Perl of course, but
one's method of development (as opposed to just coding itself) might be
held against a standard; imho, I believe it should.
I wonder how many programmers have or abide by a guide such as this:
http://www.perl.com/CPAN-local/doc/manual/html/pod/perlstyle.html
which is more the "aesthetics" of the program but important nonetheless.
And this is good:
http://www.perl.com/pub/2000/01/CodingStandards.html
Before ignoring all this, I suggest you read this book (a few hours
read):
"After the Gold Rush" by Steve McConnell, and then ignore it.
If anyone has any good articles etc. regarding "Good Techniques and
Practices" I would like to hear about them.
Certainly this really transcends Perl, but I often run into Perl cgi
apps that are such a pain in the *** to work with (as when you go to
work for a new company you inherit all the supposedly working programs
or you have to extend and modify and some of these things are just
better re-written but there is never any definition what it does, how it
relates to everything else, etc.), and hey, I was/am as guilty as any.
It would be nice if there were some initiative to improve the
methodology that people like me use when developing apps in Perl.
Peter
------------------------------
Date: Sun, 23 Apr 2000 08:28:40 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: How to execute Perl Bytecode ???
Message-Id: <Pine.GSO.4.10.10004230822500.25963-100000@user2.teleport.com>
On Fri, 21 Apr 2000 ovarene@webmails.com wrote:
> But if it is in clear, they might want to make some 'little'
> modifications, modifications that I would not be able to control.
> And as I am responsible of the maintenance of this tool, I do not want
> anyone to make some modifications I am not aware of.
That's what 'diff' or RCS or a similar utility can be good for: You can
see what's changed since you last looked at your code. Of course, you can
then refuse to maintain the modified code. Or take out the mods. Or
re-install your original, unmodified, source.
Or, just maybe, you'll say, "Wow, what a cool new feature!" or "Gee,
thanks! You fixed that bug of mine!"
Cheers! (For open source, that is!)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 23 Apr 2000 15:19:01 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: I want to use the login name. How can I get the login name?
Message-Id: <FvEM4.2245$D%4.3065595@news-east.usenetserver.com>
In article <8duhc2$ba6$1@news.tamu.edu>, yoon <yoonjung@cs.tamu.edu> wrote:
>I would like to get the client's login name in my CGI file.
>
>I don't know how to get it.I am beginner.
>
>http://csweb2.cs.tamu.edu:8000/intranet-bin/comm/buildRootWin.cgi?loginId=la
>mer&passKey=EDFsdfGFG
If you're using CGI.pm, param('loginId') would get 'lamer' if you were
invoked by means of the above URL.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08. Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>
The power didn't go out on 2000-01-01 either. :)
------------------------------
Date: 23 Apr 2000 11:33:13 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: local function question
Message-Id: <8dujh9$slj$1@orpheus.gellyfish.com>
On 22 Apr 2000 11:24:59 -0500 Tony Curtis wrote:
>>> On Sat, 22 Apr 2000 09:13:43 -0700,
>>> Anonymous <nobody@newsfeeds.com> said:
>
>> After reviewing this thread and other threads, it
>> appears PG knows more about Perl than her detractors
>> trying to run her out of this newsgroup on a rail.
>
> Then I'm sure you can post your evidence to back up this
> assertion.
Of course it wont. If it had any backbone to its assertion then it wouldnt
post anonymously.
/J\
--
Solid waste! I could kiss you! Bleh! ew! Yeech! Ooh! I think this
was pizza!
--
fortune oscar homer
------------------------------
Date: Sun, 23 Apr 2000 14:12:51 GMT
From: onsightflash@pacific.net.sg
Subject: Need a perl script that searches a flat file db
Message-Id: <8dv0cq$pkh$1@nnrp1.deja.com>
Hi,
I would like to have (what I believe is) a fairly simple script that
does the following:
1) Has a simple admin interface where an administor can enter new
records in the flat-file database. The records will be things
like "code" "name" "imagename" "URL"
2) A search feature so that the script can be called from a regular
webpage or from the browser URL and return results from the search to a
regular HTML template file.
So the template file can be designed with any design freely and then
inserted in the file will be "placeholders" which will hold the results
pulled from the database. should support a <repeat> feature in case
there are multiple results to display in a table.
3) The database can be queried through not just using an HTML form but
also using regular hyperlinks. E.g. I could set up a hyperlink that
says "Search For All Items In The 'Garden' range" and this could be a
text or image link (not a form submit button) that tells the script to
search for items with the word "Garden" in it and display the results
in the template HTML page. Maybe the link would look something like:
http://mydomain.com/cgi-bin/scriptname.pl?Search=garden
That's it. Is this something that's quite straigthforward? Would anyone
know of any existing script that already does this (and is preferrably
free)? I have searched high and low and can't seem to find something
that does this (or at least the descriptions of the products don't seem
to indicate that they do what I need).
Most scripts do a lot more that I don't need and don't do just what I
need.
Any help is greatly appreciated.
David
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 23 Apr 2000 09:05:48 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Need a perl script that searches a flat file db
Message-Id: <Pine.GSO.4.10.10004230904090.25963-100000@user2.teleport.com>
On Sun, 23 Apr 2000 onsightflash@pacific.net.sg wrote:
> Would anyone know of any existing script that already does this (and
> is preferrably free)? I have searched high and low and can't seem to
> find something that does this (or at least the descriptions of the
> products don't seem to indicate that they do what I need).
If you're wishing merely to _find_ (as opposed to write) programs, this
newsgroup may not be the best resource for you. Perhaps you should post to
a "jobs" newsgroup and offer to hire someone to help you search or to
write the program you need. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 23 Apr 2000 07:56:34 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Need HELP with IPC::Sharable
Message-Id: <Pine.GSO.4.10.10004230751210.25963-100000@user2.teleport.com>
On Fri, 21 Apr 2000 space_moose@my-deja.com wrote:
> $INhandle = tie @INBUFFER, 'IPC::Shareable', undef, { destroy => 1};
I may be mistaken, but I think you should tie this after forking. A tie
before forking, in general, seems a bad idea to me.
Still, if you need to do a lot of DNS requests in parallel, maybe you
should see how hard it would be to make Net::DNS capable of this. (Maybe
it already is; maybe it would be very hard to modify - I haven't looked.)
Good luck with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 23 Apr 2000 11:01:39 GMT
From: "Lorenzo Garcia" <lgse@homail.com>
Subject: Need some help with an easy subroutine
Message-Id: <nKAM4.24$oc.492@nntp1.chello.se>
Hello,
I've precisely begin to write programs in Perl and I need help with a
subroutine:
My problem is that I have some numbers which I want have a "thousand
point"..
for example
(what I have now) (how I want have string formated)
120000 -> 120.000
50200 -> 50.200
325 -> 325
I wonder if it is someone in the perl community who can help me with a short
subroutine there string input is the number without point and the string
output will be formated with a "thousand point".
Sorry to have to bother you and thanks in advance!!
Best regards from a Sunny Stockholm, Sweden
Lorenzo Garcia
------------------------------
Date: Sun, 23 Apr 2000 14:36:24 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Need some help with an easy subroutine
Message-Id: <Pine.GHP.4.21.0004231424330.9148-100000@hpplus01.cern.ch>
On Sun, 23 Apr 2000, Lorenzo Garcia wrote:
> Subject : Re: Need some help with an easy subroutine
No, that isn't the subject of your question. Please try to help
yourself by composing more meaningful subject headers, by reading
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
and the materials regularly posted to the group
news.announce.newusers.
> My problem is that I have some numbers which I want have a "thousand
> point"..
You need to know two things:
* this is locale-dependent, and in an English-speaking locale, commas
would be used, not points. So this is what appears in the FAQ.
* perldoc -q comma
=head1 Found in /usr/local/lib/perl5/5.00503/pod/perlfaq5.pod
=head2 How can I output my numbers with commas added?
Please make yourself familiar with the Perl FAQs, they will
answer lots of questions, even those that you don't yet realise
you need to ask.
good luck
------------------------------
Date: Sun, 23 Apr 2000 15:22:37 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Need some help with an easy subroutine
Message-Id: <1zEM4.2274$D%4.3108047@news-east.usenetserver.com>
In article <nKAM4.24$oc.492@nntp1.chello.se>,
Lorenzo Garcia <lgse@homail.com> wrote:
>(what I have now) (how I want have string formated)
>
>120000 -> 120.000
>50200 -> 50.200
>325 -> 325
>
>I wonder if it is someone in the perl community who can help me with a short
>subroutine there string input is the number without point and the string
>output will be formated with a "thousand point".
>
>Sorry to have to bother you and thanks in advance!!
>
>Best regards from a Sunny Stockholm, Sweden
perldoq -q commas --- think like an American
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08. Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>
The power didn't go out on 2000-01-01 either. :)
------------------------------
Date: Sun, 23 Apr 2000 18:12:12 +0200
From: Thorbjoern Ravn Andersen <tmp0001@unixsnedkeren.dk>
Subject: Re: Need some help with an easy subroutine
Message-Id: <390320DC.13353A0A@unixsnedkeren.dk>
Kragen Sitaker wrote:
> perldoq -q commas --- think like an American
Perhaps this would be a good opportunity to i18nize the FAQ entry?
--
Thorbjørn Ravn Andersen "...plus...Tubular Bells!"
http://www.mip.sdu.dk/~ravn
------------------------------
Date: Sun, 23 Apr 2000 09:30:03 -0500
From: "Josh" <josh@projectperl.com>
Subject: Perl Benchmarking
Message-Id: <sg6284tdl6e21@corp.supernews.com>
I have recently written quite an extensive CGI script in PERL. I would like
to know how I would go about benchmarking such a script, and what would be
considered the normal range(?) for three-thousand some odd lines of code?
Thanks.
Regards,
-Josh
------------------------------
Date: Sun, 23 Apr 2000 09:11:54 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Perl Benchmarking
Message-Id: <Pine.GSO.4.10.10004230906360.25963-100000@user2.teleport.com>
On Sun, 23 Apr 2000, Josh wrote:
> I have recently written quite an extensive CGI script in PERL. I would like
> to know how I would go about benchmarking such a script, and what would be
> considered the normal range(?) for three-thousand some odd lines of code?
What's the purpose of your benchmarking? Are you wanting to determine
whether there are slow spots which could potentially be sped up? If so,
the Benchmark module (which comes with Perl) could be useful; see its
docs.
But if you're trying to determine, say, how many accesses per hour your
program could handle under a particular webserver, you'll probably need to
use a program which repeatedly accesses the URL, perhaps even posting data
as if from a form. Be sure you have permission to do this before you
start, as it'll almost certainly cause a denial-of-service for anyone else
trying to use the webserver at the time. For this, you should probably see
what the newsgroup comp.infosystems.www.authoring.cgi has to say, as
there's nothing Perl-specific about this.
Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 23 Apr 2000 15:17:27 GMT
From: junv@coco2.pacific.net.ph ()
Subject: Perl CGI Download
Message-Id: <8dv467$32a$1@newton.pacific.net.sg>
hi all!
i tried the perl code below that would allow somebody to download a given
file via cgi, unfortunately the dialog box prompts for the cgi script
instead of the actual filename. a quick workaround is to append a "/filename"
at the end. is there an alternative other than this method?
thank you
-jun
===========================================
open(FILE, $file);
binmode(FILE);
print "Content-type: application/x-unknown\n\n";
print <FILE>;
close FILE;
------------------------------
Date: Sun, 23 Apr 2000 09:13:54 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Perl CGI Download
Message-Id: <Pine.GSO.4.10.10004230912370.25963-100000@user2.teleport.com>
On 23 Apr 2000 junv@coco2.pacific.net.ph wrote:
> i tried the perl code below that would allow somebody to download a given
> file via cgi, unfortunately the dialog box prompts for the cgi script
> instead of the actual filename.
It sounds as if you want to ask a remote web browser to do something it's
not doing. Perhaps you should search for the docs, FAQs, and newsgroups
about web browsers and how to talk to them.
> open(FILE, $file);
Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 23 Apr 2000 08:48:09 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: perlcc: No dbm on this machine?
Message-Id: <Pine.GSO.4.10.10004230847410.25963-100000@user2.teleport.com>
On Sat, 22 Apr 2000, Calvin wrote:
> When I try to run a compiled perl program include dbmopen & dbmclose,
> it will return "No dbm on this machine" and stop running.
> What can I do?
Stop trying to compile your Perl source. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 21 Apr 2000 16:10:04 -0500
From: Marshall Culpepper <marshalc@americasm01.nt.com>
Subject: Re: Plugin based perl app?
Message-Id: <3900C3AC.EADABAF4@americasm01.nt.com>
gp@gpcentre.net wrote:
>
> I'm looking to write a Perl application, it'll be CGI, but I want to
> make this plugin based. Basically, a directory (plug-ins) that contains,
> from my thoughts, self contained single file modules that will add
> functionality to the main Perl application.
>
> Now, from my trouble shooting and looking over things, this looks quite
> possible, but I'm wondering if any of you have thoughts on this subject?
> Is there already a plugin based Perl app out there that I can see?
>
> What are your thoughts? I can do it, but I just want some 'second'
> optinions, and probably ideas on implementation.
Remember to 'use strict', and throw the '-w' flag.
As far as plugins go, I've found it easiest to implement a "plugin"
system passing around objects and manipulating them inside of each
plugin.
HTH,
~Marshall
--
perl -e 'print pack
"c*"=>(((4<<4)|10),((7<<4)|5),((7<<4)|3),((7<<4)|4),(2<<4),
((4<<4)|1),((6<<4)|14),((6<<4)|15),((7<<4)|4),((6<<4)|8),((6<<4)|5),
((7<<4)|2),(2<<4),(5<<4),((6<<4)|5),((7<<4)|2),((6<<4)|12),(2<<4),
((4<<4)|8),((6<<4)|1),((6<<4)|3),((6<<4)|11),((6<<4)|5),((7<<4)|2))'
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 2847
**************************************