[11959] in Perl-Users-Digest
Perl-Users Digest, Issue: 5559 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 4 11:07:14 1999
Date: Tue, 4 May 99 08:00:25 -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 Tue, 4 May 1999 Volume: 8 Number: 5559
Today's topics:
Re: A public apology based on private thoughts :-) <Allan@due.net>
Re: An attempt to compare the performance of perl vs co <gellyfish@gellyfish.com>
Re: ASP & PERL <cmcurtin@interhack.net>
Re: ASP & PERL <bcravens@isccomputers.com>
Re: Declaration Help Please!! (Tad McClellan)
Re: Finding x^y? (Steve Linberg)
Re: Frequent Posters: new group for WWW applications of (Tad McClellan)
Help: How to deal with a $ in string match <neville_hobson@mentor.com>
Re: Help: How to deal with a $ in string match <Allan@due.net>
HELP: Printing binary files (e.g. pdf) to the client br <kraaikae@xs4all.nl>
Re: Implementing Zmodem in Perl? <tim@timbury.com>
Re: inserting "|" and " ' " to Access???? (Scott McMahan)
installing APi507e.exe on Win 95 <Matija.Exel@lag.ensieg.inpg.fr>
Re: installing APi507e.exe on Win 95 <tim@timbury.com>
Re: installing APi507e.exe on Win 95 <Matija.Exel@lag.ensieg.inpg.fr>
Re: Is this a bug? <silver@silverchat.com>
Re: ISPs that offer cgi space?? <mflaherty2@earthlink.net>
Re: ISPs that offer cgi space?? <bblackmoor@my-dejanews.com>
Memory leak <ashilt01@sprintspectrum.com>
Re: must be better way <gellyfish@gellyfish.com>
Re: must be better way (Tad McClellan)
need to get "formate" output to logfile doable?? grindrod@tfn.com
Re: Newbie question <conmara@tcon.net>
Re: Newbie question (Tad McClellan)
Perl Beginner <ba@iamd.com>
Re: Perl on a 386 with 2 MB RAM??? (David Cantrell)
perl win32 directory layout is a mess! (Reini Urban)
Re: perl win32 directory layout is a mess! (Scott McMahan)
pl2bat.pl suggestion with 4dos/nt (Reini Urban)
Re: problems substituting \' with ' (ignore if you hate (Bob Trieger)
Re: Shopping Cart Script <tim@timbury.com>
Re: Simple question <gellyfish@gellyfish.com>
Re: This is an EASY ONE! (Steve Linberg)
Upload files and 'Jeff Scripts' <gerardor@scs.carleton.ca>
Re: What's the difference between Perl and CGI? (Tad McClellan)
Re: Whats wrong? <jdf@pobox.com>
Re: where can i find sample perl-cgi scripts? <gellyfish@gellyfish.com>
Re: which UNIX should I use? (Scott McMahan)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 4 May 1999 10:34:33 -0400
From: "Allan M. Due" <Allan@due.net>
Subject: Re: A public apology based on private thoughts :-)
Message-Id: <7gn03c$inp$1@nntp5.atl.mindspring.net>
Rick Delaney wrote in message <372E6A57.D752E3A1@home.com>...
:[posted & mailed]
:abarkow@my-dejanews.com wrote:
:>
:> I really want to apologize for my thoughts of rudeness. I was wrong.
:Well, apology accepted and thanks for your refreshing attitude.
:> I am convinced that virtually all solutions can be found in the FAQ
:> with a little bit of patience.
:Yes, all solutions, not just Perl ones. Just look at the title of FAQ
:3.1. I needn't quote it since I know you can find it.
:
:Welcome, FAQ initiate! :-)
or, perhaps he is now a a FAQolyte?
Sorry, couldn't resist.
AmD
--
$email{'Allan M. Due'} = ' All@n.Due.net ';
--random quote --
[End of diatribe. We now return you to your regularly scheduled
programming...]
- Larry Wall in Configure from the perl distribution
------------------------------
Date: 4 May 1999 12:30:43 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: An attempt to compare the performance of perl vs compiled perl vs C
Message-Id: <372eda63@newsread3.dircon.co.uk>
Steven Elliott <elliotsl@NOSPAMmindspring.com> wrote:
> David Cassell wrote:
>>
>> I found your Perl program impossible to access, so I can't evaluate
>> it. Perhaps you might want to post it...
>
> It is embedded in my post as plain text since my news tool (Netscape)
> did not use any encoding. In any case here it is:
It showed up as an multipart attachment here - Its generally better to
just stick the code in your post than attach it.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: 04 May 1999 09:53:05 -0400
From: Matt Curtin <cmcurtin@interhack.net>
Subject: Re: ASP & PERL
Message-Id: <xlxvhe92b7i.fsf@gold.cis.ohio-state.edu>
>>>>> On Tue, 4 May 1999 11:25:28 +0200,
"Dennis van Remortel" <dennisvr@igr.nl> said:
Dennis> Who knows good sites with ASP and PERL tutorials???
First of all, comp.programming is for language-independent programming
issues. Please post to the right newsgroups.
Secondly, Perl is not spelled PERL. I do wish people would stop
capitalizing it.
Perl documentation can be found, oddly enough, at
http://www.perl.com/.
I do not know where you can find help with ASP, but I'm willing to bet
that a newsgroup I found (and to which I have crossposted this
article) is the right place to ask.
--
Matt Curtin cmcurtin@interhack.net http://www.interhack.net/people/cmcurtin/
------------------------------
Date: Tue, 4 May 1999 09:16:50 -0500
From: "Billy Cravens" <bcravens@isccomputers.com>
Subject: Re: ASP & PERL
Message-Id: <qkDX2.26277$95.1048726@news2.giganews.com>
Kinda curious.. even though the convention is to not capitalize Perl,
wouldn't it make since, since it is an acronym?
(Practical Extraction and Reporting Language)
Just a thought.
<snip>
>Secondly, Perl is not spelled PERL. I do wish people would stop
>capitalizing it.
<snip>
>Matt Curtin cmcurtin@interhack.net
------------------------------
Date: Tue, 4 May 1999 04:31:04 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Declaration Help Please!!
Message-Id: <88bmg7.893.ln@magna.metronet.com>
CNE_Morti (morti_cne@my-dejanews.com) wrote:
: Could someone point me in the right direction please. I've read the docs and
: I just can't see the trees for the forest, so please don't flame too badly..
You should never be flamed if you have taken a shot at trying
to answer your own question first.
It is those who ask questions where the answers are easily
found (by a word search) in the standard Perl docs that
get roasted.
: I do appreciate your assistance. I'm trying to declare department as the
: contents of a form field named dept. If the contents of the $FORM dept
: matches 'Information' it sends to a specific E-Mail Address. If the contents
: of the $FORM dept matches 'Technical Support' it sends to a different E-Mail
: Address. The form contains a drop-down box for the customer to select.
: $department = "$FORM{'dept')";
You have a syntax error on that line.
You do not need to copy it to the $department temporary variable
either. You already have it in the $FORM{dept} variable...
: if ( $department eq 'Information' ) {
: $recipient = 'someone@host.com';
: }
: elsif ( $department eq 'Technical Support' ) {
: $recipient = 'another@host.com';
: }
That's fine if you only have 2 potential recipients, but it
won't scale well.
You could instead form "associations" between the value entered
in the form and the corresponding email address.
A hash (formerly know as "associative arrays") is just the
ticket for such cross-reference type things.
my %addrs = ( 'Information', 'someone@host.com',
'Technical Support', 'another@host.com'
);
if (exists $addrs{$FORM{dept}})
{ $recipient = $addrs{$FORM{dept}} }
else
{ die "there is no address on file for '$FORM{dept}'" }
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 04 May 1999 09:53:41 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Finding x^y?
Message-Id: <linberg-0405990953410001@ltl1.literacy.upenn.edu>
In article <ebohlmanFB6q3z.AKI@netcom.com>, Eric Bohlman
<ebohlman@netcom.com> wrote:
> Tad McClellan <tadmc@metronet.com> wrote:
> : <aol> Me too! </aol>
>
> Isn't it poor style to declare an element with non-empty content when
> that content is a constant? Wouldn't a simple <aol/> (or <aol></aol> for
> pre-WebSGML processors) make more sense?
Woo-hoo! LMAO! :)
--
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
email: <linberg@literacy.upenn.edu>
WWW: <http://www.literacyonline.org>
------------------------------
Date: Tue, 4 May 1999 03:51:52 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Frequent Posters: new group for WWW applications of Perl?
Message-Id: <ou8mg7.893.ln@magna.metronet.com>
Charles R. Thompson (design@raincloud-studios.com) wrote:
: > I think you meant s/site/newsgroup/ there?
: > Precise terminology is important when discussing technical
: topics :-)
: Yeah... but weren't you tired too after writing that much? How
: much are you getting from Random House anyway? ;)
I keep expecting a check in the mail, but it never comes.
When I call, they keep saying something about not paying
for unsolicited manuscripts (especially ones that were
never even submitted to them).
Bummer!
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 04 May 1999 14:52:18 +0100
From: Neville Hobson <neville_hobson@mentor.com>
Subject: Help: How to deal with a $ in string match
Message-Id: <372EFB92.27478776@mentor.com>
This is a multi-part message in MIME format.
--------------9F76B420B41903AFD9E678FE
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I'm sure this is simple regular expression stuff but I've just been
caught by the following situation:
my $firstname = '$fred';
my $fullname = '$fred_flintstone';
my $surname = $fullname;
$surname =~ s/$firstname//;
print $surname;
Whilst the strings have a $ in them the interpolated pattern doesn't get
a match so $fred_flintstone is what is printed. If you remove the $ it
works just fine. How should one deal with the $? I have no choice - the
string to be tested may have a $ as the first character. I guess I
could strip the $ of first and add it back later.
Any suggestions gratefully received.
Neville
--------------9F76B420B41903AFD9E678FE
Content-Type: text/x-vcard; charset=us-ascii;
name="neville_hobson.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Neville Hobson
Content-Disposition: attachment;
filename="neville_hobson.vcf"
begin:vcard
n:Hobson;Neville
tel;fax:+44 (0)1635 810108
tel;work:+44 (0)1635 811473
x-mozilla-html:FALSE
url:www.mentor.com
org:Mentor Graphics (UK) Ltd.;Mentor Consulting
version:2.1
email;internet:neville_hobson@mentor.com
title:Senior Technical Consultant
adr;quoted-printable:;;Rivergate, Newbury Business Park=0D=0ALondon Road;Newbury;Berkshire;RG13 2QB;England
note;quoted-printable:=0D=0A
x-mozilla-cpt:;-1
fn:Neville Hobson
end:vcard
--------------9F76B420B41903AFD9E678FE--
------------------------------
Date: Tue, 4 May 1999 10:25:26 -0400
From: "Allan M. Due" <Allan@due.net>
Subject: Re: Help: How to deal with a $ in string match
Message-Id: <7gmvia$gds$1@nntp5.atl.mindspring.net>
Neville Hobson wrote in message <372EFB92.27478776@mentor.com>...
:I'm sure this is simple regular expression stuff but I've just been
:caught by the following situation:
:my $firstname = '$fred';
:my $fullname = '$fred_flintstone';
:my $surname = $fullname;
:$surname =~ s/$firstname//;
:print $surname;
:
:Whilst the strings have a $ in them the interpolated pattern doesn't get
:a match so $fred_flintstone is what is printed. If you remove the $ it
:works just fine. How should one deal with the $? I have no choice - the
:string to be tested may have a $ as the first character. I guess I
:could strip the $ of first and add it back later.
Well, TIMTOWTDI but OW:
my $firstname = quotemeta('$fred');
perldoc -f quotemeta
HTH
AmD
------------------------------
Date: Tue, 4 May 1999 16:39:45 +0200
From: "Egon Kraaikamp" <kraaikae@xs4all.nl>
Subject: HELP: Printing binary files (e.g. pdf) to the client browser
Message-Id: <7gn1uj$8uh$1@news1.xs4all.nl>
I'm looking for a way to send the data from a .pdf file to the client
browser trhough perl.
I think it has to look like:
1) open the file
2) "print" the file-data
3) close the file
Can someone direct me to the right way to do this?
------------------------------
Date: Tue, 4 May 1999 09:21:30 -0400
From: "Tim" <tim@timbury.com>
Subject: Re: Implementing Zmodem in Perl?
Message-Id: <925824054.543.79@news.remarQ.com>
This is OT, but since we're here...
Why can't you use ftp for file xfer? What OS is running on the box?
What are the security/access concerns? Promiscuous mode only
implies that all packets will be passed, not just those destined for
that box. Ftp should still work, no? And just so this conversation
isn't *completely* devoid of perl info: should you desire to script
these transfers, you can use Net::FTP to do so.
Tim K.
Mitch wrote in message <372E8B8B.FFF13F8@home.com>...
>Long story short, I have a script running on a box with no drives (i.e.
>floppy, zip etc), and a NIC that is always (and has to remain this way)
>in promiscuous mode. The kicker is that I need to be able to transfer
>files to this box. The only solution I could come up with is Zmodem.
>My question is: Can I do this, and if so, can someone explain how, or
>point me to info that can help me solve this problem?
>
>Thanks again, (man the perl community rules)
>
>Mitch
------------------------------
Date: 4 May 1999 12:19:45 GMT
From: scott@aravis.softbase.com (Scott McMahan)
Subject: Re: inserting "|" and " ' " to Access????
Message-Id: <372ee5e1.0@news.new-era.net>
jckchan@hotmail.com wrote:
> Think for your help, but I don't understand it.
> Would you please explain more.
' is a special SQL character and must be escaped. It is similar to
escaping a " or ' in a Perl string. You do this by doubling it, that is
'' which is something I did not find in the documentation. I stumbled
across it trying things at random. Apparently, it is part of ODBC. An
application I was involved with ran into this same problem. We had to
manually scan all input and double the 's.
I never ran into a problem with |, so I don't know what to tell you.
We probably just never used |, since our thing was an English
text messaging tool which didn't use funny characters. I do not
know how to escape it.
> When user fill the FORM (a text box). The value is stored
> in a variable say $FORM{$TEXTBOX}. How to locate the "|" and
> " ' "?????
Typically, you'd use the s operator. You want to replace
the ' with a ''. And a | with whatever character sequence
escapes it.
Scott
------------------------------
Date: Tue, 04 May 1999 15:14:49 +0200
From: Matija Exel <Matija.Exel@lag.ensieg.inpg.fr>
Subject: installing APi507e.exe on Win 95
Message-Id: <372EF2C9.D5DD4143@lag.ensieg.inpg.fr>
hello,
towards the end of the installation of APi507e.exe on a Win 95 PC (I
checked with several PCs),
I get the following message:
_INS0432 a causi une difaillance de page dans (_INS0432 caused a page
fault within the module...)
le module PERLEZ.DLL ` 014f:00f5106e.
Registres :
EAX=00000001 CS=014f EIP=00f5106e EFLGS=00010213
EBX=bff8bac6 SS=0157 ESP=006df1d4 EBP=00000001
ECX=c3b05074 DS=0157 ESI=010de280 FS=395f
EDX=815ab2cc ES=0157 EDI=00000000 GS=0000
Octets ` CS : EIP :
8b 46 08 50 e8 d9 87 00 00 83 c4 04 56 e8 d0 87
Etat de la pile : (stack:)
00f50000 00000000 01080460 00f59a13 00000000 00f59aca 00f50000 00000000
00000000 00f50000 815ae344 006df3d0 815ab7cc bff7b9ce 00f50000 00000000
The installation apparently completes without problems, and my CGI
scripts are running OK, so far...
So, do I have to worry?
------------------------------
Date: Tue, 4 May 1999 09:29:20 -0400
From: "Tim" <tim@timbury.com>
Subject: Re: installing APi507e.exe on Win 95
Message-Id: <925824524.355.99@news.remarQ.com>
I've only installed Perl on English Windows, so I don't know if any
language-specific issues may exist. However you may want to
check with ActiveState [ http://www.ActiveState.com ]and also
consider installing the latest build (515?).
Tim K.
Matija Exel wrote in message <372EF2C9.D5DD4143@lag.ensieg.inpg.fr>...
>
>hello,
>
>towards the end of the installation of APi507e.exe on a Win 95 PC (I
>checked with several PCs),
>I get the following message:
>
>_INS0432 a causi une difaillance de page dans (_INS0432 caused a page
>fault within the module...)
> le module PERLEZ.DLL ` 014f:00f5106e.
>Registres :
>EAX=00000001 CS=014f EIP=00f5106e EFLGS=00010213
>EBX=bff8bac6 SS=0157 ESP=006df1d4 EBP=00000001
>ECX=c3b05074 DS=0157 ESI=010de280 FS=395f
>EDX=815ab2cc ES=0157 EDI=00000000 GS=0000
>Octets ` CS : EIP :
>8b 46 08 50 e8 d9 87 00 00 83 c4 04 56 e8 d0 87
>Etat de la pile : (stack:)
>00f50000 00000000 01080460 00f59a13 00000000 00f59aca 00f50000 00000000
>00000000 00f50000 815ae344 006df3d0 815ab7cc bff7b9ce 00f50000 00000000
>
>The installation apparently completes without problems, and my CGI
>scripts are running OK, so far...
>So, do I have to worry?
>
>
>
------------------------------
Date: Tue, 04 May 1999 16:58:38 +0200
From: Matija Exel <Matija.Exel@lag.ensieg.inpg.fr>
Subject: Re: installing APi507e.exe on Win 95
Message-Id: <372F0B1E.C2BB4A0B@lag.ensieg.inpg.fr>
Tim wrote:
> I've only installed Perl on English Windows, so I don't know if any
> language-specific issues may exist. However you may want to
> check with ActiveState [ http://www.ActiveState.com ]and also
> consider installing the latest build (515?).
> Tim K.
well, I just tried build 515 with the same result: it happens just after
"Configuring Active Perl. This may take a minute." and then while
"Configuring Perl..." an error window for _INS0432 pups up and
the Debug information is:
_INS0432 a causi une difaillance de page dans
le module PERLEZ.DLL ` 0137:00c11085.
Registres :
EAX=00000001 CS=0137 EIP=00c11085 EFLGS=00010213
EBX=00c1caa4 SS=013f ESP=006df1cc EBP=00000001
ECX=c101b9c8 DS=013f ESI=00db11b0 FS=2727
EDX=815549fc ES=013f EDI=00000000 GS=0000
Octets ` CS : EIP :
ff 76 08 e8 63 74 00 00 59 5e c3 55 8b ec 51 53
Etat de la pile :
00db11b0 00c11055 00000000 00d30470 00c10000 00c186e3 00000000 00c1879a
00c10000 00000000 00000000 00c10000 815542f4 006df3d0 81553460 bff7b9b5
------------------------------
Date: Mon, 03 May 1999 18:22:24 -0500
From: silver <silver@silverchat.com>
Subject: Re: Is this a bug?
Message-Id: <372E2FB0.8222A54B@silverchat.com>
you're right, it's probably not a bug, but I'd at least consider it a
"gotcha" that should be documented in some traps page, or better yet in
'perltie'. because the theory is that programs aren't supposed to know
they're calling functions instead of just using a hash. but there's at
least one way to tell now :)
this happened to me because I made an Object representing a UI in Tk,
and wanted to
"watch" a variable with Tk::Label... so I naturally stuck the variable
in an attribute.
I had the label watching \$ui->{'label'} (okay, the names were more
interesting, but this is
an example).
later, I changed the underlying object from a regular hash to a tied
hash, and suddenly
my label didn't appear. it took hours of pouring over documentation and
trying different
code things before I realized the problem was this undocumented
"feature" of using tied
hashes. it would've saved a LOT of time if 'perltie' mentioned that in
some warning or something.
though it would be _even better_ if the reference were magical and
acting on it would
act on the tied hash :)
of course, I finally got around by changing the paradigm to
my $label;
$ui->{'labelref'} = \$label;
and asking Tk to watch $ui->{'labelref'} instead of \$ui->{'label'}.
the workaround isn't bad at all, and I don't mind it, but it IS a
"gotcha".
after I wrote my initial post, I really wanted to re-word it to say "if
this isn't a bug,
could it be documented as a trap?" :)
whee fun.
--s
Andrew Allen wrote:
>
> silver (silver@silverchat.com) wrote:
> [recap: references to the same "value" from a tied hash are different]
> <snip>
>
> I wouldn't consider this a bug. After all, after you've tied a hash,
> every hash access is a function call. I wouldn't complain if the
> "defined" function returned a distinct value each time I called it.
>
> Andrew
------------------------------
Date: Tue, 4 May 1999 09:44:49 -0400
From: "Mike Flaherty" <mflaherty2@earthlink.net>
Subject: Re: ISPs that offer cgi space??
Message-Id: <7gmtip$cia$1@ash.prod.itd.earthlink.net>
A lot of the CGI that I have been using has been written in perl so I
thought the folks in this newsgroup would know were I could implement it
publicly.
I would like to thank the folks who emailed me with some ISP options.
Thanks Again,
Mike Flaherty
Westwood, MA
------------------------------
Date: Tue, 04 May 1999 14:36:14 GMT
From: BBlackmoor <bblackmoor@my-dejanews.com>
Subject: Re: ISPs that offer cgi space??
Message-Id: <7gn0ku$970$1@nnrp1.dejanews.com>
Hash: SHA1
In article <372EA152.D8B1FCA6@chatbase.com>,
webmaster@chatbase.com wrote:
> Mike Flaherty wrote:
> >
> > I haven't looked yet but this seems like to best place to start.
>
> Well, it's actually not the best place to start, being this NG is
> dedicated and geared towards Perl. Which your question has nothing
to do
> with.
That's absurd: you want him to start comp.lang.perl.isp just to ask
one question? Of course this newsgroup is an appropriate place to ask
his question.
I don't have an answer for him, unfortunately. I wish I did.
BBlackmoor
- --
The highest human achievement, and perhaps the most difficult, is
merely being reasonable.
Version: PGP Personal Privacy 6.0.2
Comment: DH/DSS: 2E7E 0FE6 5CFE A01A 1237 4602 D235 87E3 4653 39E7
iQA/AwUBNy8F/9I1h+NGUznnEQJlOQCfRo2NyDt/n4u1yMK6kyuwWDr6er0An3QA
0FBB/lhaWESV/r/qhbsQU5vl
=NIF9
-----END PGP SIGNATURE-----
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 04 May 1999 14:06:48 GMT
From: Aaron Shilts <ashilt01@sprintspectrum.com>
Subject: Memory leak
Message-Id: <7gmutm$7j3$1@nnrp1.dejanews.com>
I am working on a script that continuously runs in the background. It
constantly watches a file and when it is appended, it sends the appended text
out a socket connection.
To "monitor" the file size, I am using a few if-then loops with 1 seconds
sleeps to keep CPU utilization down. The script was written to call
subroutines from within other subroutines (probably not the best practice?).
While the script runs, I am watching memory consumption with the 'top'
command and it is slowly increasing until the program eventually (after
hours) runs out of memory and dies.
I tried localizing all of my vars within the subs and that doesn't seem to
help. It looks to me like Perl doesn't like calling sub's from within other
subs, and I can't really make the last statement work in this context. Is
there a better way to exit a loop and call a subroutine directly?
I have included a portion of the code and would appreciate any ideas:
-------------------------------
sub check_calls {
$size = -s $call_info;
if ($size == 0) {
sleep (1);
&check_file;
}
elsif ($size == $size_sent) {
sleep (1);
&check_file;
}
elsif ($size > $size_sent) {
print ("There is new data since the last transmission\n");
&send_calls;
}
else {print ("There is a processing error!\n");}
}
-------------------------------
A good example of the problem is in the last elsif statement. If &send_calls
was run, it would do its processing then call &check_file, causing the loops
to go deeper and deeper.
--
Aaron Shilts
Sprint Corporate Security
ashilt01@sprintspectrum.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 4 May 1999 14:10:34 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: must be better way
Message-Id: <372ef1ca@newsread3.dircon.co.uk>
christine@techresource.org wrote:
> I have an array like such, returned from postgres query.
>
> @array
>
> $array[0] is "what_i_want_a "
> $array[1] is "what_i_want_b "
> $array[2] is "what_i_want_c "
>
> I want to copy the array into another and have that
> array look like this.
>
> $new_array[0] is "what_i_want_a"
> $new_array[1] is "what_i_want_b"
> $new_array[2] is "what_i_want_c"
>
Probably the best way is to read what it says in perlfaq4:
How do I strip blank space from the beginning/end of a
string?
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Tue, 4 May 1999 04:34:27 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: must be better way
Message-Id: <jebmg7.893.ln@magna.metronet.com>
christine@techresource.org wrote:
: I have an array like such, returned from postgres query.
: @array
: $array[0] is "what_i_want_a "
: $array[1] is "what_i_want_b "
: $array[2] is "what_i_want_c "
: I want to copy the array into another and have that
: array look like this.
: $new_array[0] is "what_i_want_a"
: $new_array[1] is "what_i_want_b"
: $new_array[2] is "what_i_want_c"
Perl FAQ, part 4:
"How do I strip blank space from the beginning/end of a string?"
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 04 May 1999 12:59:44 GMT
From: grindrod@tfn.com
Subject: need to get "formate" output to logfile doable??
Message-Id: <7gmqvu$45j$1@nnrp1.dejanews.com>
I'm trying to keep the formate of my data the same in my log file as when I
use the write command to format it for STDOUT. Does anyone know how. I tried
print HAND write; # this did not work, I also tried assigning write to a
variable and then passing in to my handle to the log file, but that also
doesn't work. Ideas would be helpfull - Thanks
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 04 May 1999 08:05:25 -0500
From: Ken McNamara <conmara@tcon.net>
Subject: Re: Newbie question
Message-Id: <372EF095.F3490CE7@tcon.net>
I'm just about the opposite of you. I'm trying to learn (learning) graphic
design, animation, and video editing.
I'd be happy to coach you in Perl and CGI for some return coaching on my pet
project.
My web page is:
http:\\www.conmara.net
Question(s).
Since you have no programming background - how are your math and logic
skills?
Do you play an instrument (lots of good programmers seem to)?
What do you want to accomplish with Perl?
How much time do you have to spend on it?
How many computers do you have access to?
Do you have direct access to a Web server? (it's a lot easier to learn CGI
when you have control of the box running the program).
KenMc
metamorphon@hotmail.com wrote:
> Is there a good book out there for beginners where I could learn Perl or
> CGI on windows 95.
> I know absulatly nothing about programming, I'm a graphic designer, I
> specialize on 3D animation and video editing. It's been few months I've
> been doing web page design. I'm really desperate to learn Perl, could I
> learn it from a book or should I take a course?
------------------------------
Date: Tue, 4 May 1999 04:35:59 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Newbie question
Message-Id: <fhbmg7.893.ln@magna.metronet.com>
Ronald J Kimball (rjk@linguist.dartmouth.edu) wrote:
: <metamorphon@hotmail.com> wrote:
: > Is there a good book out there for beginners where I could learn Perl or
: > CGI on windows 95.
: > I know absulatly nothing about programming, I'm a graphic designer, I
: > specialize on 3D animation and video editing. It's been few months I've
: > been doing web page design. I'm really desperate to learn Perl, could I
: > learn it from a book or should I take a course?
: I would really recommend taking a course in
: Perl. You should be able to find training resources on www.perl.com.
Also check the Continuing Education department of 2 and 4 year
colleges in your area.
Many offer low-cost Perl classes.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 4 May 1999 22:52:13 +0800
From: "Brian Altman" <ba@iamd.com>
Subject: Perl Beginner
Message-Id: <7gn1aq$51p$1@news.skyinet.net>
Hi there,
I am just beginning to learn how to program in Perl.
Right now I am wondering if it is possible to 'get' specific data from an
existing file (any text based file), and write it to a new file.
Can someone help me with this ?
Thanks a lot in advance !!
------------------------------
Date: Tue, 04 May 1999 12:17:55 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: Perl on a 386 with 2 MB RAM???
Message-Id: <372fe525.13417613@news.insnet.net>
On Tue, 04 May 1999 11:55:24 +0200, Folkert Meeuw
<fmee@lfi.uni-hannover.de> enlightened us thusly:
>David Cantrell wrote:
>
>> Then please explain how I can run Linux with a single floppy disc and
>> no hard disk in the machine at all.
>
>was it yours you ask by yourself question ?
No - it was a rhetorical question; the original poster seemed to be
claiming (incorrectly) that it was impossible to run Linux with only a
60Mb hard drive.
[Copying newsgroup posts to me by mail is considered rude]
--
David Cantrell, part-time Unix/perl/SQL/java techie
full-time chef/musician/homebrewer
http://www.ThePentagon.com/NukeEmUp
------------------------------
Date: Tue, 04 May 1999 14:01:06 GMT
From: rurban@sbox.tu-graz.ac.at (Reini Urban)
Subject: perl win32 directory layout is a mess!
Message-Id: <372ef54a.20738380@judy>
win32/vc installers might not like the changed directly layout as it
used now.
in detail i don't like
~INST_TOP~~INST_VER~\lib\~archname~ and
~INST_TOP~~INST_VER~\bin\~archname~
i just use #!/usr/local/bin/perl if under linux or win32
the problem is that i am forced to set my path to
~INST_TOP~~INST_VER~\lib\~archname~ as well which clutters up my path
setting. just for the unusual win32/vc perl directory layout.
perl.dll decides at run-time where to look for INC
so i cannot just change it to the "normal" unix layout, which is
something like /usr/local/lib/perl5/site_perl/$apiversion/$archname
for sitearch
most other platforms use the consistent and logical layout.
my simple question now is:
in which file to change this to have
e:\usr\lib\perl5.005\site\MSWin32-x86-thread and
e:\usr\bin\perl5.005 for example?
it tried several times to fix win32/config.vc but the produced perl.dll
doesn't reflect this.
there are some hardcoded, not configurable, just plain wrong assumptions
in the win32/win32.c sources which should honor the settings in
config.vc.
for example this line, from win32.c, win32_get_sitelib()
path2 = get_emd_part(path2, "site\\lib", ARCHNAME, "bin", pl, Nullch);
this is plain wrong!
even setting the suggested registry paths didn't work out for me.
every time i fix it it crawls back with every update.
the thing is that i want to try cygwin32, mingw32 and vc compiled
versions with the same libs, avoiding having to reinstall all the
modules again and again.
where to complain? hip?
---
Reini Urban
http://xarch.tu-graz.ac.at/autocad/news/faq/autolisp.html
------------------------------
Date: 4 May 1999 14:59:21 GMT
From: scott@aravis.softbase.com (Scott McMahan)
Subject: Re: perl win32 directory layout is a mess!
Message-Id: <372f0b49.0@news.new-era.net>
Reini Urban (rurban@sbox.tu-graz.ac.at) wrote:
> in detail i don't like
> ~INST_TOP~~INST_VER~\lib\~archname~ and
> ~INST_TOP~~INST_VER~\bin\~archname~
My Perl is in C:\Perl. Maybe you're using the wrong
version, had something go wrong during the install,
or something? You could download the latest Active
State port of Perl to Win32, and use the InstallShield
setup program they provide.
Scott
------------------------------
Date: Tue, 04 May 1999 13:25:27 GMT
From: rurban@sbox.tu-graz.ac.at (Reini Urban)
Subject: pl2bat.pl suggestion with 4dos/nt
Message-Id: <372ee78f.17223496@judy>
pl2bat.pl suggestion with 4dos/nt
=================================
for those win95/98, dos or os/2 users with 4DOS, 4OS2 or 4DOS/NT
installed, it would be nice to support more than just the 9 args.
their command shell is capable but the pl2bat.pl logic denies it.
also for nt users it is often had to force to use setdos /p* or change
their overall behaviour with using * as parameter character.
it is probably overkill to check for $ENV{'_4ver'} at run-time of a
batch script, but it would be the best solution.
I personally often switch between cmd.exe, 4nt.exe, bash.exe and
tcsh.exe.
the next best solution would be to change <perl>/win32/bin/pl2bat.pl at
least to check for the actually used paramchar when 4DOS/NT is detected
and change the default to this char.
or give the dumb user a hint in the config.h file or at least in the
README.win32, how to set the -a switch in the makefile, when generating
all the batches.
such as:
replace %* with %$ under 4os2/4nt or %& with 4DOS
the big problem is that 4DOS, 4OS2 or 4DOS/NT doesn't export the actual
value as internal variable to be able to override it. it only exports
CommandSep and EscapeChar. blame them!
PS:
in fact much better imho is it to set .pl=perl in the 4start.btm
and delete all those generated batch files.
---
Reini Urban
http://xarch.tu-graz.ac.at/autocad/news/faq/autolisp.html
------------------------------
Date: Tue, 04 May 1999 12:00:09 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: problems substituting \' with ' (ignore if you hate amateur questions)
Message-Id: <7gmmok$3sk$1@fir.prod.itd.earthlink.net>
[ courtesy cc sent by mail if address not munged ]
Hauk Langlo <hauk@forumnett.no> wrote:
>I'm adding a backslash to all the ' characters in a scalar to let it
>enter an SQL database. When retreaving the scalar I want to remove the
>backslash but it seems like I can't make it work no matter what I do.
>
>-----
>$foo="Hauk's problem";
>
>$foo=~s/'/\\'/g;
replace ' with \'
>$foo=~s/\\//g:
after you fix this line by getting rid of that colon
replace \ with notta
>----
>
>$foo is now still "Hauk\'s problem" and that IS a problem
$foo will be the same as it originally was.
May I also suggest that you use a different character than slashes when
playing with backwhacks. It ain't real nice on the eyes.
ie:
$foo=~s~'~\\'~g;
$foo=~s~\\~~g;
Good luck
------------------------------
Date: Tue, 4 May 1999 09:00:32 -0400
From: "Tim" <tim@timbury.com>
Subject: Re: Shopping Cart Script
Message-Id: <925822808.905.46@news.remarQ.com>
smnayeem@my-dejanews.com wrote in message
<7gmc7j$ods$1@nnrp1.dejanews.com>...
>In article <7glp84$n2h@newsops.execpc.com>,
> "wizeguy" <wizeguy@net-link.net> wrote:
>> I am new to Pearl, but I'm trying to setup a Shopping cart script on my
>> Website. I am using a shareware program from "Perlshop" (www.arpanet.com)
My
>> Webpage is parked at www.webjump.com My problem is that the script that
I
>> have "perlshop.cgi" does not have the correct extension, My website only
>> supports the *.pl extension. Both site and script are both free so they
>> have limited support. How do I get around this, or am I off base on how
it
>> should work? Please E-mail all responses. Thanks Kevin
>>
>>
>Did u try renaming the cgi to pl extension?
>and also there is a way to configure ur server to accept .cgi files
>
>smnayeem
Sites hosted on Webjump can run Perl cgi scripts, but only with the
pl extension. Renaming it should work fine.
Tim K.
[cc: wizeguy@net-link.net ]
------------------------------
Date: 4 May 1999 14:32:27 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Simple question
Message-Id: <372ef6eb@newsread3.dircon.co.uk>
Netguy <netguy@homemail.com> wrote:
> How to get something like LWP::Simple get() or like that work in
> (uh) Windows95?
C:\WINDOWS\Desktop>perl -MLWP::Simple -e"getprint('http://www.gellyfish.com')"
Works fine for me. But you dont say what problems you are having so I
cant be more specific.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Tue, 04 May 1999 09:55:03 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: This is an EASY ONE!
Message-Id: <linberg-0405990955030001@ltl1.literacy.upenn.edu>
In article <MPG.1197d462e89f77599899ab@nntp.hpl.hp.com>, lr@hpl.hp.com
(Larry Rosler) wrote:
> Reading that is good advice in general. However, you have aimed the
> responder in the wrong direction for this problem.
>
> Though he thinks he wants to use a regular expression, it is far more
> likely that he should use the index() function (if for no other reason
> than to avoid failing on inadvertant regex metacharacters in the search
> string).
Good point. I didn't engage my brain enough to help with him what he
really wanted to do, just with what he said he wanted to do. :)
--
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
email: <linberg@literacy.upenn.edu>
WWW: <http://www.literacyonline.org>
------------------------------
Date: 4 May 1999 13:31:45 GMT
From: "Gerardo R." <gerardor@scs.carleton.ca>
Subject: Upload files and 'Jeff Scripts'
Message-Id: <372EF882.7BB6D46E@scs.carleton.ca>
Hello,
I'm working on a web page that uploads a file to the server. I've
downloaded
"Jeff Scripts" to upload a file. I've read the README file and setup
evertything as indicated. When I load (netscape 4.07) the upload.html
included with the files I get "Premature end of script headers".
I read about this message and I think file-upload.cgi takes care of the
problem by flushing Perl's buffer. $| = 1;
I changed the path to the right location of my Perl interpreter (ver
5.005)
in file-upload.cgi. I changed permissions - 755 - to that script. I've
tried
to run the script manually './file-upload.cgi' but I get command not
found; I
do watch for case sensitiveness. On the other hand I have another script
with
same permissions, owner and group which runs fine.
It could be that it has something to do with my server configuration,
because
I've read in previous messages posted here that people is running the
script.
I know it's hard to tell from this description if it's server config.
But can
you give me some hints on what to look for.
Thank you in advance
Gerardo Reynaga
------------------------------
Date: Tue, 4 May 1999 04:02:37 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: What's the difference between Perl and CGI?
Message-Id: <ti9mg7.893.ln@magna.metronet.com>
TRG Software : Tim Greer (webmaster@chatbase.com) wrote:
: joeyandsherry@mindspring.com wrote:
: >
: > I have been apparently posting to the wrong newsgroups,
: >
: > What's the difference between Perl and CGI?
: >
: > Thanks for the enlightment.
: Perl and CGI are nothing of the same. Perl is a language. You can use
: Perl to write CGI applications, just as you can use C or a ton of other
: languages.
Since Perl is a general purpose language, you can use it in
just about any "problem domain". (and in fact, the consensus
is that less than half of all Perl programming is web-related,
which kind of explains why CGI-specific questions are not
appreciated in the Perl newsgroups)
You can use it for Accounting applications.
What's the difference between Perl and Accounting?
The perceived interchangability of Perl and CGI applications
is because the overwhelming majority of WWW programmers
choose to use Perl. They could choose some other language
if they want, but they seldom want.
:-)
: go to http://www.perl.com and read everything you can.
: read some FAQ's
Like this one from the Perl FAQ, part 3, which provides several
useful URLs.
"Where can I learn about CGI or Web programming in Perl?"
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 04 May 1999 10:26:49 -0400
From: Jonathan Feinberg <jdf@pobox.com>
To: warlock@eskimo.com
Subject: Re: Whats wrong?
Message-Id: <m3so9cc3me.fsf@joshua.panix.com>
warlock@eskimo.com (Jim Richardson) writes:
> use backtics rather than single quotes would help :)
>
> ` rather than '
^ Hmm?
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: 4 May 1999 14:26:37 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: where can i find sample perl-cgi scripts?
Message-Id: <372ef58d@newsread3.dircon.co.uk>
smnayeem@my-dejanews.com wrote:
> i was looking for some sample scripts that implements the object oriented
> version of perl-cgi but most of the examples just use plain html and cgi
> inside perl scripts... anyone knows where i can get sample codes of oo
> perl-cgi? also where would i find some good online tuturials on perl-cgi (say
> to manipulate data from a flat-file database) any help would be appreciated
> thanks!
>
I would start with documentation for CGI.pm which has at least one full
example.
Alternatively you might (for instance ) look at Brent Michalski's articles
on the subject starting at:
<http://webreview.com/wr/pub/98/07/10/perl/index.html>
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: 4 May 1999 12:24:10 GMT
From: scott@aravis.softbase.com (Scott McMahan)
Subject: Re: which UNIX should I use?
Message-Id: <372ee6ea.0@news.new-era.net>
For Perl development, I recommend Red Hat 5.2. I've been doing some heavy
Perl stuff on it, and really love it. It's UNIX-ish, has all the bells
and whistles (even the man pages work, which is more than I can say for
most of the commercial UNIXes I've used! -- I can M-x man in Emacs and
get the man pages!), and will run on just about anything.
For web development, if you are a UNIX admin who knows what you're doing,
a Linux box can't be beat -- especially if you know DNS and can set up all
your web sites on one box using Apache 1.3's non-IP virtual domains. I
have all the web sites I develop on a single Linux box this way, and
they look and feel like they do online. I can even cross-link them.
Scott
------------------------------
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 5559
**************************************