[12374] in Perl-Users-Digest
Perl-Users Digest, Issue: 5974 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 12 23:07:23 1999
Date: Sat, 12 Jun 99 20:00:20 -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 Sat, 12 Jun 1999 Volume: 8 Number: 5974
Today's topics:
Re: A Newbie needs HELP! <bie@connect.ab.ca>
Re: Calculating weekday given year, month and day (Gregory Snow)
Call Shell Script <technology@workmail.com>
Re: DBD::CSV <gellyfish@gellyfish.com>
Re: disalowing words <softsci@eagle.ca>
Re: FormMail Modification (Abigail)
gd question bababozorg@aol.com
help for newbie <DENHOP@prodigy.net>
help <csmith10@columbus.rr.com>
Re: I (Abigail)
Re: Log file (Abigail)
Looking for Perl free lancer (Vinyltrade)
Re: mod_perl require problem <jason@eggnet.com>
Newbie Question <hanafi@magix.com.sg>
Re: Perl and WinNT services (Paul Rahe)
Re: PerlIS.dll on NT == Perl.exe COMPLETELY? <peter@verhas.com>
PerlScript ... what features are missing? <ksnyde@msn.com>
Re: Prevent loading from Cache? (Abigail)
Re: Printing rsanders@ac.net
Re: Printing (Abigail)
Re: problem with no text outputting from Perl CGI scrip (Abigail)
Pull out HREFs from text? (Ken Williams)
Sort on mtime <aef@pangea.ca>
Re: Stat mtime <aef@pangea.ca>
Re: Stat mtime (Abigail)
Re: Subs that can operate on $_ in void context? (Abigail)
using perl scripts in VC++'s post-build step <dominikos@my-deja.com>
Which first unlock() or close()? Unclear FAQ. <mats.pettersson@falukuriren.se>
Re: Which first unlock() or close()? Unclear FAQ. <aef@pangea.ca>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 11 Jun 1999 23:59:49 -0600
From: Tim <bie@connect.ab.ca>
Subject: Re: A Newbie needs HELP!
Message-Id: <3761F755.22A4@connect.ab.ca>
Or if your a cheap nebie like me... go to:
www.virtualave.net
Tony Stone wrote:
>
> Hi, im a newbie too! The first thing you should do is get a paid web
> hosting service which has Perl installed. I noticed your using a free AOL
> Members page and as far as i know they do not give you access to a CGI
> Directory. You should check out www.cgi-resources.com and see some of there
> tutorials and try to get a feel of how Perl works and what it does.... then
> you will have a understadning of what could do the job. I didnt even look
> at the page but i can say that it would be pretty easy to do what you are
> explaining... and ionfact there are aleady programs out there that do just
> what you want. Again, lcheck out www.cgi-resources.com to see some of these
> programs. Im learning to so i cant give you the best answers but good luck!
> Tony Stone
> tony@devnetwork.com
> http://www.devnetwork.com
>
> JJ wrote in message <7j665r$1dva$1@newssvr01-int.news.prodigy.com>...
> >----- Original Message -----
> >From: John Porter <jdporter@min.net>
> >Newsgroups: alt.perl,comp.lang.perl.misc
> >Sent: Wednesday, June 02, 1999 12:28 PM
> >Subject: Re: A Newbie needs HELP!
> >
> >> Do you have all that data in a database, or some kind of data file,
> >> other than the html files themselves? How were these html files
> >> generated in the first place?
> >
> >I'm afraid that the files were generated in HTML format only. They are all
> >basically a collection of links in exactly the same format as the example I
> >uploaded to the web. If I could somehow convert the information into a
> >database format, I'm sure that would be the best answer, since this will be
> >an ongoing project whereby links will be added and deleted over time.
> >
> >Since I am a *complete* novice at programming (
--
-------------------------------------------------------
| TBE: http://tbe.virtualave.net |
| * 3:2 Ratio + 100 Free credits! * |
| Tim's Chat Doors: http://www.connect.ab.ca/~mundy/ |
-------------------------------------------------------
------------------------------
Date: 13 Jun 1999 00:48:54 GMT
From: snow@biostat.washington.edu (Gregory Snow)
Subject: Re: Calculating weekday given year, month and day
Message-Id: <7juv5m$j86$1@nntp6.u.washington.edu>
In article <3761656F.AF819D96@larc.nasa.gov>,
Ed Bogart <e.h.bogart@larc.nasa.gov> wrote:
>Gregory Snow wrote:
>>
>> where dmy_to_julian is a good julian day converter (I use the one
>> available at the Perl Function Repository:
>> http://moiraine.dimensional.com/~dgris/perl/pfr/ ).
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Notice this paragraph.
>>
>
>Well I tried it and got;
>
>Undefined subroutine &main::dmy_to_julian called at TestIF line 10.
>
>Line 10 is "$day_of_week = ( dmy_to_julian( $day, $month, $year ) + 1 )
>%7"
While you don't need a full module, you do need to define the function
(some modules do it for you, there are copies available from looking
at archives of the group, the one at the above url won out on a
discussion of different ones to use, it's about 10 lines and easy
to include in your program)
>And, wouldn't this only work for years that start on Sunday, I.e. julian
>day 1 is Sunday? Which reminds me of a long story about calendars that
>my wife made me promise never to tell. 8=)
The "+1" was to bring the 0 to be sunday (otherwise 0 would have been
monday and sunday would have been 6), If you want sunday to be 1 and
sat to be 7, just add 1 after the mod. This algorythm works for any
date after october 15, 1582 (it wouldn't be to hard to fix that if you
really needed to), and will continue to work long after 2000.
--
-------------------------------------------------------------------------------
Gregory L. Snow | Imagination is the one weapon in the
(Greg) | war against reality.
snow@biostat.washington.edu | -- Jules de Gaultier
------------------------------
Date: Sat, 12 Jun 1999 17:07:55 -0700
From: Raj <technology@workmail.com>
Subject: Call Shell Script
Message-Id: <3762F65B.9E4E40D9@workmail.com>
Hi,
Can a Shell Script be invoked from CGI/Perl Script? if so ...how? TIA,
Raj
------------------------------
Date: 12 Jun 1999 23:18:15 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: DBD::CSV
Message-Id: <7juprn$4vt$1@gellyfish.btinternet.com>
On Sat, 12 Jun 1999 12:11:31 -0300 Kevin Howe wrote:
> How reliable/bug free is DBD::CSV? Is it safe to use in large projects?
>
I cant speak for reliability but I guess it would be fun to do a benchmark:
Benchmark: timing 10 iterations of i_CSV, i_INFORMIX, i_XBASE...
i_CSV: 53 wallclock secs (49.18 usr + 3.02 sys = 52.20 CPU)
i_INFORMIX: 34 wallclock secs (16.02 usr + 1.04 sys = 17.06 CPU)
i_XBASE: 296 wallclock secs (291.82 usr + 1.78 sys = 293.60 CPU)
The test databases are all created in the same directory. I'm not surprised
about the relative performance of the Informix database because the DBD
is relatively thin - most of it is an XS stub to the client libraries
which themselves are only clients to the database engine. I will let
others draw conclusions from the other results however.
/J\
#!/usr/bin/perl -w
use strict;
use DBI;
use Benchmark;
$| = 1;
my $create =<<EO1;
CREATE TABLE woof (
woof1 CHAR(10),
woof2 INTEGER,
woof3 CHAR(10)
)
EO1
my $insert =<<EO2;
INSERT INTO woof
VALUES ("BlahVlahah",98,"Blahbalh")
EO2
my $drop =<<EO3;
DROP TABLE woof
EO3
timethese (10, {
'i_XBASE' => sub { &do_XBASE; },
'i_CSV' => sub { &do_CSV; },
'i_INFORMIX' => sub { &do_Informix; }
} );
sub do_XBASE
{
my $dbh = DBI->connect("DBI:XBase:.",'','',{ AutoCommit => 1})
or die $DBI::errstr;
$dbh->do($create) || die $dbh->errstr;
for ( 1 .. 1000 )
{
$dbh->do($insert) || die $dbh->errstr;
}
$dbh->do($drop) || die $dbh->errstr;
$dbh->disconnect();
}
sub do_CSV
{
my $dbh = DBI->connect("DBI:CSV:",'','',{ AutoCommit => 1})
or die $DBI::errstr;
$dbh->do($create) || die $dbh->errstr;
for ( 1 .. 1000 )
{
$dbh->do($insert) || die $dbh->errstr;
}
$dbh->do($drop) || die $dbh->errstr;
$dbh->disconnect();
}
sub do_Informix
{
my $dbh = DBI->connect("dbi:Informix:blah",'','',{ AutoCommit => 1})
or die $DBI::errstr;
$dbh->do($create) || die $dbh->errstr;
for ( 1 .. 1000 )
{
$dbh->do($insert) || die $dbh->errstr;
}
$dbh->do($drop) || die $dbh->errstr;
$dbh->disconnect();
}
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 12 Jun 1999 22:19:49 -0400
From: "Kumar Sundaram" <softsci@eagle.ca>
Subject: Re: disalowing words
Message-Id: <7jv4fg$19j$1@mur2.odyssey.on.ca>
--
Perhaps, you could store all the bad words in an ASCII text file and in your
perl program open the file and compare the user's input against the bad
words that are stored in the file. If you want an example code please let
me know by email and I will send it to you.
Kumar
kumarsundaram@usa.net
Twarren10 <twarren10@aol.com> wrote in message
news:19990612074323.22857.00000762@ng-fu1.aol.com...
>I have what seems to be a relativly simple problem, but I cannot find the
>answer in the books. I want to cut off to a "not allowed" message anyone
who
>enters the 8 or 9 words which are unacceptable to some people. I have it
set
>with a long list of elsif statements, but I remember reading this can be
done
>on one line with a comma or something to that nature? can anyone enlighten
me
>how to avoid the long list of "elsif" statements for each word I want to
>exclude. Thanks in advance.
>
------------------------------
Date: 12 Jun 1999 18:25:37 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: FormMail Modification
Message-Id: <slrn7m5rjv.4e6.abigail@alexandra.delanet.com>
Rollie Kenyon (kenyon@ct1.nai.net) wrote on MMCXI September MCMXCIII in
<URL:news:376269DD.DB2F3CE5@ct1.nai.net>:
::
:: After performing math calculations on my form, some fields contain a
:: zero value. Any ideas how to modify FormMail so it doesn't send fields
:: that contain 0? Thanks in advance......
rm is your friend.
Abigail
--
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Sun, 13 Jun 1999 01:38:08 GMT
From: bababozorg@aol.com
Subject: gd question
Message-Id: <7jv220$lkc$1@nnrp1.deja.com>
hi
does anyone knows if i can make more than 1 image (gif) with the module
GD at the same time?
if not can you please suggest me a module that i can use it like that!
thanks for the help
hamed
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Sat, 12 Jun 1999 20:45:43 -0500
From: "DENNIS W HAUPT" <DENHOP@prodigy.net>
Subject: help for newbie
Message-Id: <7jv2fp$2jms$1@newssvr04-int.news.prodigy.com>
I'm learning perl now and I would like to test my scripts on my own computer
before uploading them. I write the scripts and open the page in the web
browser but it just opens the perl.exe in a dos box I don't know how to tell
it to send the info to the browser. Have tried website 2 and other stuff
all with the same result.
Please email any help to visualbasic@programmer.net and I will help with
any VB questions
------------------------------
Date: Sat, 12 Jun 1999 19:55:24 -0400
From: "Chuck Smith" <csmith10@columbus.rr.com>
Subject: help
Message-Id: <6yC83.13996$6y2.178142@storm.twcol.com>
This is a multi-part message in MIME format.
------=_NextPart_000_0079_01BEB50D.82DEE2C0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I need to create a Perl program that will add code to the HTML files =
that are uploaded to the server, such as what happens on Free Host =
services where the banners are added after you upload. Is there some =
source out there where this has already been done as I would hate to =
reinvent the wheel. Looking to make it definable as to which =
directories will or will not need the code added.
Thanks for any help on this matter,
C Smith
------=_NextPart_000_0079_01BEB50D.82DEE2C0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3401" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>
<DIV><FONT size=3D2>I need to create a Perl program that will add code =
to the HTML=20
files that are uploaded to the server, such as what happens on Free Host =
services where the banners are added after you upload. Is there =
some=20
source out there where this has already been done as I would hate to =
reinvent=20
the wheel. Looking to make it definable as to which directories =
will or=20
will not need the code added.</FONT></DIV>
<DIV><FONT size=3D2>Thanks for any help on this matter,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=3D2>C Smith</FONT></DIV></FONT></DIV></BODY></HTML>
------=_NextPart_000_0079_01BEB50D.82DEE2C0--
------------------------------
Date: 12 Jun 1999 18:26:27 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: I
Message-Id: <slrn7m5rlh.4e6.abigail@alexandra.delanet.com>
Walter (walter@tscinternet.com) wrote on MMCXI September MCMXCIII in
<URL:news:37627f45@news1.us.ibm.net>:
$$ I ran across a reference to arrays that state...
$$
$$ Initialize your array before adding items to increase efficiency.
$$
$$ i.e.: $#priceList = 3000;
$$
$$ What do you guys think?
$$
$$ If I know the size of my array, does this help?
use Benchmark;
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
.qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
.qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 12 Jun 1999 18:31:18 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Log file
Message-Id: <slrn7m5ruk.4e6.abigail@alexandra.delanet.com>
Twarren10 (twarren10@aol.com) wrote on MMCXI September MCMXCIII in
<URL:news:19990612115747.22408.00000834@ng-fu1.aol.com>:
,, I am writing a simple program to log what people are seaching for and the
,, number of times they search. It's basic and uncomplicated, and perl gives no
,, error messages, but it doesn't work. Can anyone tell me what might cause this
,, not to work. I've gone over it several times and can't catch anything wrong.
,, here's the code.
Perl doesn't give error messages if you don't give Perl any change to
utter them. Use -w, use strict, and most of all,
*CHECK THE RETURN VALUE OF SYSTEM CALLS*
Abigail
--
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 13 Jun 1999 01:33:56 GMT
From: vinyltrade@aol.com (Vinyltrade)
Subject: Looking for Perl free lancer
Message-Id: <19990612213356.24788.00001377@ng-cc1.aol.com>
Hello any Freelancers.
I tried to set up a auction site but with no success. I then hired someone
and
they don't seem to have the time to do it as quickly as I would like it done.
So I am looking for anyone who would could make the changes and of course I am
looking for a quote.
The software is Everysoft. (free perl script)
The preview auction numbers do not match posted item numbers. (preview #'s &
posted #'s)
Software is charging bidders.
I want to add some categories as well. (as many as 20)
And change heading of the html code. (basic page lay out)
Change the auction times to 3-5-7-10-14-30.
If anyone is interesed please visit the site at the URL below and let me know
how much for the job and please send along some examples of your work. thanks,
Vernon Tart
Vinyl Trade
http://www.vinyltrade.com/
Selling/Trading rock, soul, jazz, reggae and country.
Albums, 45's, 12", CD's. Wants list accepted.
Record & CD Auctions at http://www.vinyltrade.cybercitynic.com/
------------------------------
Date: Sat, 12 Jun 1999 21:30:04 GMT
From: Jason Eggleston <jason@eggnet.com>
Subject: Re: mod_perl require problem
Message-Id: <7jujgk$hqu$1@nnrp1.deja.com>
With further investigation, this did not solve the problem (the -X
option isn't a good solution for me). However, I figured out a better
symptom:
1. All of my scripts "require" the same code.
2. As long as I only have executed 1 perl script since httpd started,
the code always runs.
3. When I execute multiple perl scripts that "require" the same code
(a script that contains functions I wrote), the code, about half the
time, no longer works.
The error message I get is:
[Sat Jun 12 14:17:32 1999] [error] Uncaught exception from user code:
Undefined subroutine
&Apache::ROOT::chUserOptions_2epl::PrintHeading called
at /home/httpd/html/chUserOptions.pl line 12.
Apache::ROOT::chUserOptions_2epl::handler('Apache=SCALAR
(0x853581c)') called at /usr/lib/perl5/site_perl/5.005/i386-
linux/Apache/Registry.pm line 135
eval {...} called at /usr/lib/perl5/site_perl/5.005/i386-
linux/Apache/Registry.pm line 135
Apache::Registry::handler('Apache=SCALAR(0x853581c)') called
at /dev/null line 0
eval {...} called at /dev/null line 0
The function "PrintHeading" does exist in the file I include.
This leads me to believe that in some cases, mod_perl will think
a "required" file is loaded when in fact it is not.
Any ideas?
In article <37611792.43938682@dwc.ch>,
Christoph Wernli <cw@dwc.ch> wrote:
> [posted and mailed]
>
>
> It looks like you've run into the "compile once, run multiple times"
pitfall (indicated by
> "works about 1 out of every two tries).
>
> Try this:
>
> - run your httpd with the -X switch (daemon won't fork)
> - replace the BEGIN{}-block with
> use lib '/home/httpd/html/';
> require 'stdinc.pl'
>
> Cheers,
>
> -werns
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Sun, 13 Jun 1999 10:49:20 +0800
From: "Deep Throat" <hanafi@magix.com.sg>
Subject: Newbie Question
Message-Id: <7jv65u$bp6$1@clematis.singnet.com.sg>
Hi,
I wanted to learn Perl ,how do I get started ?
1.Do I need a compiler ?
2. where is a good site to learn it from ?
3. Does Perl works in a specific OS ?
Thanks
Rgds
Hanafi
------------------------------
Date: Sun, 13 Jun 1999 00:10:50 GMT
From: prahe@home.com (Paul Rahe)
Subject: Re: Perl and WinNT services
Message-Id: <3764f65c.70102081@news>
You'll want to use the srvany.exe program (available on the client NT
resource disk and the server NT resource disk) to create the service.
Installation:
-> Copy SRVANY.EXE to your system and install it as a Windows NT
service, for example:
INSTSRV MyService c:\tools\srvany.exe
-> configure via the Services applet ("Startup..." dialog) of the
Control Panel as manual or automatic, as appropriate.
-> set via the Services applet ("Startup..." dialog) of the Control
Panel the account for the service. If you need access to the screen &
keyboard, you must choose the LocalSystem account and click the "Allow
Service to Interact with Desktop", otherwise choose any account and
specify the correct logon password. Note that the LocalSystem account
doesn't have network access.
Specifying the application to start & its parameters:
Run the Registry Editor (REGEDT32.EXE):
-> under
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MyService: create
a 'Parameters' key
-> under the above key, create an 'Application' value of type REG_SZ
and specify there the full path of your app executable (including the
extension). For example:
Application: REG_SZ: D:\TOOLS\VI.EXE
On Fri, 11 Jun 1999 19:49:04 GMT,
Bill_ThompsonNOSPAM@OneNOSPAMSource.com (Bill Thompson) wrote:
>Has anyone successfully written a WinNT service with Perl? Although
>I could just install a program using the InstSrv.exe utility, it would
>be nice to be able to respond more gracefully to commands to halt
>services, pause services, etc.
>
>It seems doable with all of the com object packages and knowing that
>you can now build a service with visual basic using similar objects.
------------------------------
Date: Sat, 12 Jun 1999 23:55:32 +0200
From: "Peter Verhas" <peter@verhas.com>
Subject: Re: PerlIS.dll on NT == Perl.exe COMPLETELY?
Message-Id: <7julhs$k4h$1@pollux.matav.net>
I found that file upload did not work with the ISAPI version for files
larger than 48K. I did not try the latest version.
ISAPI implementation handles the environment variables a bit different. The
hash %ENV does not behave like a real hash. What I mean is
while( ($k,$kv) = each %ENV ){ print "$k=$v\n";}
does not list the environment variables on the ISAPI version. But when you
reference the $ENV{XXX} variable it works properly. Bit it can not list
them.
Regards,
Peter
------------------------------
Date: Sat, 12 Jun 1999 20:19:09 -0700
From: "Ken Snyder" <ksnyde@msn.com>
Subject: PerlScript ... what features are missing?
Message-Id: <fGD83.607$u43.131950@typhoon-sf.snfc21.pbi.net>
When using "PerlScript" under ASP I noticed that assigning a variable like
this:
$myVariable << 'END_OF_HTML';
<html>
hello world
</html>
END_OF_HTML
print $myVariable;
Doesn't work. It works fine under just Perl. Anyone have an idea how I can
get this to work under PerlScript? Anyone know the functional list of
things that don't work under PerlScript?
ken
------------------------------
Date: 12 Jun 1999 18:38:40 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Prevent loading from Cache?
Message-Id: <slrn7m5sce.4e6.abigail@alexandra.delanet.com>
Hans Bolte (04282757-0001@t-online.de) wrote on MMCXI September MCMXCIII
in <URL:news:37626387.29C0@t-online.de>:
"" Hello,
""
"" can I prevent, that the browser loads the output from a cgi-script from
"" his cache?
You write your own browser that doesn't use the cache. Of course, it's
very hard for a browser to tell wether something was generated by a
cgi-script or through some other means. Perhaps you could propose a new
HTTP header "X-THIS-WAS-GENERATED-BY-A-CGI-SCRIPT".
Good luck!
Abigail
--
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Sun, 13 Jun 1999 02:24:02 GMT
From: rsanders@ac.net
Subject: Re: Printing
Message-Id: <376315dc.28197239@news.ac.net>
I found that by entering the > before LPT1 does send the output to the
printer.
open(PRINTER, '>LPT1:')
On Sat, 12 Jun 1999 18:00:14 +0200, =?iso-8859-1?Q?Bj=F6rn?= Teegen
<bjoern.teegen@gmx.de> wrote:
>> I'm new to Perl programming and cannot find the command(s) I need to
>> send data to the printer. I've been through three manuals and looked
>> online to no avail.
>
>One possibility is to write directly to the printer device:
>
># UNIX
>open(PRINTER, '/dev/lp1');
>print PRINTER "Hello, world!\n";
>close(PRINTER);
>
># DOS
>open(PRINTER, 'LPT1:'); # I am not sure if this works under DOS
>print PRINTER "Hello, world!\n";
>close(PRINTER);
>
>Bjvrn
>
------------------------------
Date: 12 Jun 1999 18:40:08 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Printing
Message-Id: <slrn7m5sf6.4e6.abigail@alexandra.delanet.com>
rsanders@ac.net (rsanders@ac.net) wrote on MMCXI September MCMXCIII in
<URL:news:37627ff6.10402054@news.ac.net>:
// I'm new to Perl programming and cannot find the command(s) I need to
// send data to the printer. I've been through three manuals and looked
// online to no avail.
Just open a pipe to the appropriate printer command, and use print.
Abigail
--
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 12 Jun 1999 18:41:31 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: problem with no text outputting from Perl CGI script (long, enclosure)
Message-Id: <slrn7m5shq.4e6.abigail@alexandra.delanet.com>
Ben Mullen (brutal@greenbaynet.com) wrote on MMCXI September MCMXCIII in
<URL:news:7jskf3$13hk$1@news.inc.net>:
-- I'm having troubles with a CGI script that feeds in a html document template
-- and adds in information that it gets from the cgi querry. Basically my
-- problem is that I get no output from the script. I'm not sure where I'm
-- going wrong since I'm taking a crash corse on Perl and my job needs this
-- done in a week. Below is the script as I have it so far:
Remember: *ALWAYS CHECK THE RETURN VALUE OF SYSTEM CALLS!*
If you don't, and it doesn't work, don't bother asking here.
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Sun, 13 Jun 1999 01:45:10 GMT
From: tekkin@hotmail.com (Ken Williams)
Subject: Pull out HREFs from text?
Message-Id: <929238311.389.95@news.remarQ.com>
I have a block of text, I can strip out all HTML easily with
s/<(?:[^>'"]*|(['"]).*?\1)*>//gs;
But this gets rid of hrefs, and leaves the link. I would like to preserve
all the hrefs within the text before I strip out the html. How could I do
this?
Thanks
------------------------------
Date: Sat, 12 Jun 1999 21:20:26 -0500
From: "AEF" <aef@pangea.ca>
Subject: Sort on mtime
Message-Id: <7jv4gf$q38$1@pumpkin.pangea.ca>
More help please. I've got the stat, and date format going on , but not able
to make the hash work to sort the mtimes.
opendir(DIR, "$base_dir") || die "Can't open $base_dir\n";
while($file = readdir(DIR)) {
$mtime = (stat("$base_dir/$file"))[9];
$filedate{$file} = $mtime;
# help here please,
# no success in making a hash of the filedates to sort the files
# below, by mtime!
if($file =~ /.*\.$file_ext\.old/) {
open(OLD, "$base_dir/$file") || die "Can't open $file\n";
$data =<OLD>;
close(OLD);
$topic = $file;
$topic =~ s/\..*//g;
#do other stuff
}
}
------------------------------
Date: Sat, 12 Jun 1999 18:33:45 -0500
From: "AEF" <aef@pangea.ca>
Subject: Re: Stat mtime
Message-Id: <7juqns$km2$1@pumpkin.pangea.ca>
That's it...
Thanks Dan and Jonathan.
Dan Zetterstrom <methabol@hem.passagen.se> wrote in message
news:3763d27a.9561058@news.algonet.se...
> On Sat, 12 Jun 1999 12:05:54 -0500, "AEF" <aef@pangea.ca> wrote:
>
> >More information for reference...
> >
> >opendir(DIR, "$base_dir") || die "Can't open $base_dir\n";
> >
>
> You read files from $base_dir...
>
> > while($file = readdir(DIR)) {
> > $mtime = (stat($file))[9];
>
> ... but check the date on $file in the _current_ dir. Try:
>
> $mtime = (stat("$base_dir/$file"))[9];
>
> > printf "file %s updated at %s\n", $file, scalar
localtime($mtime);
> >
> >}
> >
>
------------------------------
Date: 12 Jun 1999 18:42:27 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Stat mtime
Message-Id: <slrn7m5sjh.4e6.abigail@alexandra.delanet.com>
AEF (aef@pangea.ca) wrote on MMCXI September MCMXCIII in
<URL:news:7ju258$8r5$1@pumpkin.pangea.ca>:
"" I'm a newbie. Help please.
man perl
Abigail
--
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 12 Jun 1999 18:43:08 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Subs that can operate on $_ in void context?
Message-Id: <slrn7m5skq.4e6.abigail@alexandra.delanet.com>
Marcel Grunauer (marcel.grunauer@lovely.net) wrote on MMCXI September
MCMXCIII in <URL:news:37625fa6.3417363@enews.newsguy.com>:
??
?? sub add1 {
?? $_++
?? # but only if used in a void context
?? # this is what I don't know
?? }
perldoc -f wantarray
Abigail
--
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
"\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
"\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Sat, 12 Jun 1999 23:28:08 GMT
From: Dominik <dominikos@my-deja.com>
Subject: using perl scripts in VC++'s post-build step
Message-Id: <7juqe2$jn9$1@nnrp1.deja.com>
I want to use perl scripts in VC++'s post-build compilation step.
build command looks something like this:
perl my.pl *
It works fine when called from command line, but doesn't work inside
visual C++.
To simplify question, my.pl looks something like this:
@files = < @ARGV >;
foreach $header ( @files ) {
print $header,"\n";
}
The error message says:
The name specified is not recognized as an
internal or external command, operable program or batch file.
internal error: glob failed at my.pl line 1.
anyone saw this kind of problems?
--
- Dominik
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Sun, 13 Jun 1999 00:43:26 +0200
From: Mats Pettersson <mats.pettersson@falukuriren.se>
Subject: Which first unlock() or close()? Unclear FAQ.
Message-Id: <3762E28E.71240092@falukuriren.se>
Hi!
I read the FAQ (perlfag5) on flock(), but it seems a bit unclear about
which order to do things. The example in the FAQ ends as follows:
---[cut]-----------
(print FH $num+1, "\n") or die "can't
write numfile: $!";
# DO NOT UNLOCK THIS UNTIL YOU CLOSE
close FH or die "can't
close numfile: $!";
---[end]-----------
But above there is no unlock at all.
So, i read the "perldoc -f flock" to get a more clear picture and it
says:
---[cut]-----------
sub lock {
flock(MBOX,LOCK_EX);
# and, in case someone appended
# while we were waiting...
seek(MBOX, 0, 2);
}
sub unlock {
flock(MBOX,LOCK_UN);
}
open(MBOX, ">>/usr/spool/mail/$ENV{'USER'}")
or die "Can't open mailbox: $!";
lock();
print MBOX $msg,"\n\n";
unlock();
---[end]----------
Here there is a unlock, but no close. How should this be?
Mats
------------------------------
Date: Sat, 12 Jun 1999 21:25:11 -0500
From: "AEF" <aef@pangea.ca>
Subject: Re: Which first unlock() or close()? Unclear FAQ.
Message-Id: <7jv4ph$q3l$1@pumpkin.pangea.ca>
Being a newbie myself, I'm probably not the reply you want, but I understood
that unlock was implicit in close (using flock 2), and that there's no
necessity to unlock??? Probably wrong but...
Mats Pettersson <mats.pettersson@falukuriren.se> wrote in message
news:3762E28E.71240092@falukuriren.se...
> Hi!
>
> I read the FAQ (perlfag5) on flock(), but it seems a bit unclear about
> which order to do things. The example in the FAQ ends as follows:
>
> ---[cut]-----------
> (print FH $num+1, "\n") or die "can't
> write numfile: $!";
> # DO NOT UNLOCK THIS UNTIL YOU CLOSE
> close FH or die "can't
> close numfile: $!";
>
> ---[end]-----------
>
> But above there is no unlock at all.
>
> So, i read the "perldoc -f flock" to get a more clear picture and it
> says:
>
> ---[cut]-----------
>
> sub lock {
> flock(MBOX,LOCK_EX);
> # and, in case someone appended
> # while we were waiting...
> seek(MBOX, 0, 2);
> }
>
> sub unlock {
> flock(MBOX,LOCK_UN);
> }
>
> open(MBOX, ">>/usr/spool/mail/$ENV{'USER'}")
> or die "Can't open mailbox: $!";
>
> lock();
> print MBOX $msg,"\n\n";
> unlock();
>
> ---[end]----------
>
> Here there is a unlock, but no close. How should this be?
>
> Mats
------------------------------
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 5974
**************************************