[11793] in Perl-Users-Digest
Perl-Users Digest, Issue: 5393 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 15 18:07:25 1999
Date: Thu, 15 Apr 99 15:00:22 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 15 Apr 1999 Volume: 8 Number: 5393
Today's topics:
Re: $variables in <FILES> <gregm@well.com>
Re: $variables in <FILES> (Tad McClellan)
Re: [help] - please <cassell@mail.cor.epa.gov>
accessing files across UNC paths <ericw@fikus.com>
are circular references causing out of memory error? martin@cutup.de
Re: Can I write a #!-style interpreter with Perl ? <jdf@pobox.com>
can Perl handle huge files martin@cutup.de
Re: can Perl handle huge files (Abigail)
checking filenames.. <terral@cyberplex.com>
Re: Convert HTML -> Perl (Tad McClellan)
Re: Convert HTML -> Perl (Bart Lateur)
Re: error message (Tad McClellan)
Re: flocking question - worried (Daniel Beckham)
Re: HTTP Cookies and Netscape Browser (Abigail)
Re: Out of Order <jdf@pobox.com>
Re: Out of Order <upsetter@ziplink.net>
Re: position in s///g? (Ilya Zakharevich)
Question about Connection <jrhill@writeme.com>
Re: Question about variables, and Perl in general <jdf@pobox.com>
Re: Quick Questions WIN32 Extensions. <cassell@mail.cor.epa.gov>
Re: Recursion not working properly <cassell@mail.cor.epa.gov>
Scalars .. <gsriniva@ecn.purdue.edu>
Re: Scalars .. <cassell@mail.cor.epa.gov>
Re: SQL and the ODBC module <rawkrawl@rednecks.com>
Re: Trying to get the cgi script to print the date last (Larry Rosler)
warnings on Win32 (Gus)
Re: warnings on Win32 <gregm@well.com>
Re: warnings on Win32 <ericw@fikus.com>
Re: what does this error msg mean? <gellyfish@gellyfish.com>
Re: Win32 Mail Client <ozette.brown@infotechfl.com>
Re: Writing Binary Files (Daniel Beckham)
Re: Writing Binary Files (Larry Rosler)
Re: Writing Binary Files (Daniel Beckham)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 15 Apr 1999 12:00:25 -0700
From: Greg McCann <gregm@well.com>
Subject: Re: $variables in <FILES>
Message-Id: <37163749.175FCB06@well.com>
timespinner@my-dejanews.com wrote:
>
> Perhaps I am going about what I am doing incorrectly.
>
> What I was originally thinking was making web pages as .htm files, so they
> are not physically embedded in the Perl script, with fields that had
> something like:
>
> <b>Name:</b><input size=50 type="text" name="InputName" value="$name">
Here is what I am doing. It's been pretty successful so far, but I'm a Perl
beginner and this is still under development so I'm open to suggestions from
wiser programmers.
##### Perl Code #####
#!/usr/bin/perl -w
use strict;
my $my_var = 'blahblahblah';
my %hash;
my %form_field;
$hash{test} = 'foo@foo.com';
$form_field{email} = 'me@foo.com';
print "Content-type: text/html\n\n";
print "<HTML>\n";
# open file
open(TEMPLATE, "test.txt") || print "Oops!";
while (<TEMPLATE>) {
s/<<(.*?)>>/$1/eeg;
print;
}
close(TEMPLATE);
print "</HTML>\n";
##### Template file: test.txt #####
<FORM>
My variable is <<$my_var>>.<BR>
<input type=text name=email size=40 value=<<$form_field{email}>>><BR>
You can have it for $5.00.<BR>
Otherwise I will keep my <<$my_var>>!!<BR>
My hash test is <<$hash{test}>>.<BR>
</FORM>
What I'm doing is putting my parameters inside double angle brackets <<...>>.
This elimates confusions about the meaning of "$" in the template as well as the
problem of the \$\w+ substitution breaking on hashes.
BTW, this is discussed on pp721-724 of the Perl Cookbook.
Greg
--
======================
Gregory McCann
http://www.calypteanna.com
"Be kind, for everyone you meet is fighting a great battle." Saint Philo of
Alexandria
------------------------------
Date: Thu, 15 Apr 1999 15:08:41 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: $variables in <FILES>
Message-Id: <pfd5f7.mk8.ln@magna.metronet.com>
timespinner@my-dejanews.com wrote:
: Perhaps I am going about what I am doing incorrectly.
I think so, since Mark-Jason Dominus already posted the
answer yesterday.
: What I was originally thinking was making web pages as .htm files, so they
: are not physically embedded in the Perl script, with fields that had
: something like:
: <b>Name:</b><input size=50 type="text" name="InputName" value="$name">
: Where the Perl script would have populated $name with some value (for this
: case we will say 'Fred Flinstone') and when it displayed on the users
: browser, it would show as:
: Name: Fred Flinstone
: Where Fred is in the Text Box.
You have just described, pretty much exactly, what the
Text::Template module does.
Use that.
: Is there an easier way to do this?
use Text::Template;
: Again, I don't want to have to embed the
: HTML directly into the Perl Script.
Again,
use Text::Template;
[ snip dozens of dozens of quoted lines that did not need to
be quoted.
Please be a little more considerate of our shared
Internet resources.
Don't post worthless bytes.
]
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 15 Apr 1999 14:30:48 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: [help] - please
Message-Id: <37165A88.4E271702@mail.cor.epa.gov>
Adam Dittmer wrote:
>
> i am getting a error message when i try to use my guestbook type script
> and i am not sure wht it means if anyone could please tells me what my
> pro gram is doing wrong i would aprcieate it
>
> Error: HTTPd: malformed header from script
> /usr/local/etc/httpd/htdocs/cgi-bin/tplogbook.cgi
You can look up *all* the Perl errors in the perldiag manpage, i.e.
type 'perldoc perldiag' at a command prompt. But if you do so, you'll
see that this error is *not* coming from Perl.
There is a malformed header from whatever script(s) you are using.
Even if part of this is a Perl program, that doesn't mean Perl is
_de_facto_ the guilty party. And if your Perl program is responsible,
there's not any way we can see that from here: you haven't tracked
down the error and found the part of the program that's causing it.
Since this may not be a Perl problem at all, but a cgi or html problem,
you may need to ask for help elsewhere. Why don't you start with the
author of the guestbook script? Surely he/she/they are responsible
adults who maintain their code...
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: 15 Apr 1999 17:39:00 -0500
From: "erk" <ericw@fikus.com>
Subject: accessing files across UNC paths
Message-Id: <37165c74@discussions>
I am attempting to write a script which
reads and writes files across UNC paths
(ie: \\GEORGE\C$\WINNT\....).
It works when run command line, but fails
to access them when run from the 'Net. Does
anyone know how I can either:
a) get MS-IIS 4.0 to allow the scripts to read
and write across UNC's , or
b) execute a process with username-password
(syntax needed!)
c) get mapped "Logical drive letters"
from UNC paths
Any help would be appreciated, and please
e-mail me if you have a solution.
Thanx :)
e
--Posted from EarthWeb Discussions. http://discussions.earthweb.com
------------------------------
Date: Thu, 15 Apr 1999 19:18:30 GMT
From: martin@cutup.de
Subject: are circular references causing out of memory error?
Message-Id: <7f5e1s$1r3$1@nnrp1.dejanews.com>
Hello!
I am getting an "out of memory" error when running a batch HTML-generation app
from a browser on Win NT (little window with white "X" on red circle pops up.)
The thing is that, even though there are a LOT of operations being performed
the total memory overhead at any one moment should not exceed, generously
estimated: 3MB. The machine has 128MB of RAM with NT taking up 80 so there
should be enough "room".
The HTML result is generated by a set of HTML objects. Among them is a Table
object whose Table_Cell children have a reference back to a Table instance so
that they know which table they belong to.
Is this a case of a circular reference which Perl's garbage detection can not
deal with?
Any help appreciated,
Martin
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 15 Apr 1999 15:11:36 -0400
From: Jonathan Feinberg <jdf@pobox.com>
To: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Can I write a #!-style interpreter with Perl ?
Message-Id: <m3g161vguv.fsf@joshua.panix.com>
merlyn@stonehenge.com (Randal L. Schwartz) writes:
> >>>>> "Jonathan" == Jonathan Feinberg <jdf@pobox.com> writes:
>
> Jonathan> Jorma Laaksonen <jorma.laaksonen@hut.fi> writes:
> >> *** #! /my-perl-script-dir/parser
>
> Jonathan> You'll probably get better help on a newsgroup that deals with
> Jonathan> whatever shell you're using. HTH.
>
> It's not a shell issue. It's a Kernel issue. See my other post.
I stand corrected.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Thu, 15 Apr 1999 19:54:54 GMT
From: martin@cutup.de
Subject: can Perl handle huge files
Message-Id: <7f5g6a$3ti$1@nnrp1.dejanews.com>
Hi,
I have to draw up an offer for a company which wants to, among other things,
feed its Intranet with RichTextFormat files of regularly over a 1000 pages in
length.
The ca. 20.000 documents are to be batch-converted to XML before being entered
in the DB.
I'm thinking of using Perl for the job but am a little wary of the:
open(FILE,$file);
@lines = <FILE>;
close(FILE);
bit.
Specifically, I'm afraid that the whole thing will choke up due to memory
strain, if not after the first then after the hundredth (101,102,103...) file
in a batch.
Does anyone have any information on or experience with how Perl handles very
large (possibly larger than available RAM) files?
Are there tried and true swapping mechanisms (or even modules)?
Thanks,
Martin
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 15 Apr 1999 21:24:01 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: can Perl handle huge files
Message-Id: <7f5ldh$qdk$1@client2.news.psi.net>
martin@cutup.de (martin@cutup.de) wrote on MMLIII September MCMXCIII in
<URL:news:7f5g6a$3ti$1@nnrp1.dejanews.com>:
!! Hi,
!!
!! I have to draw up an offer for a company which wants to, among other things,
!! feed its Intranet with RichTextFormat files of regularly over a 1000 pages in
!! length.
!!
!! The ca. 20.000 documents are to be batch-converted to XML before being entered
!! in the DB.
!!
!! I'm thinking of using Perl for the job but am a little wary of the:
!!
!! open(FILE,$file);
!! @lines = <FILE>;
!! close(FILE);
Don't do it then.
while (<FILE>) {
process $_;
print;
}
Abigail
--
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"
------------------------------
Date: Thu, 15 Apr 1999 17:27:05 -0300
From: "Terra Landry" <terral@cyberplex.com>
Subject: checking filenames..
Message-Id: <7f5i7u$mgi$1@bignews.fundy.net>
I have a script written that checks if a filename exists.. if it does, I
want to add a sequential number to the end of the filename... how do I get
the greatest sequential number from the filenames that already exist??
I'm uploading files and changing the names before they are uploaded, so if I
check to see if it already exists, then that doesn't mean that it won't
exist with a number appended to it..
Can anyone help me?? I need an answer quick!!
Thanks,
Terra
------------------------------
Date: Thu, 15 Apr 1999 15:15:08 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Convert HTML -> Perl
Message-Id: <srd5f7.mk8.ln@magna.metronet.com>
Jan Angerm|ller (Jan@Angermueller.com) wrote:
: Is there a Win95/98 programme to convert a HTML-coded page into Perl ?
Sure:
print "\$html =<<'ENDHTML';\n";
while (<>) { # read body of HTML page
print;
}
print "ENDHTML\n";
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 15 Apr 1999 21:22:40 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Convert HTML -> Perl
Message-Id: <371756c4.1286233@news.skynet.be>
Jan Angerm|ller wrote:
>Is there a Win95/98 programme to convert a HTML-coded page into Perl ?
>This would save a lot of time for creating HTML-outputs in Perl.
#! perl -w
# html2pl.pl
# call as "perl html2pl *.htm" (if file globbing works)
while(my $htmlfile= shift) {
print STDERR "File: $htmlfile\n";
open(HTML,"$htmlfile") or die "Can't read file: $!";
(my $scriptfile = $htmlfile) =~ s/\.\w+$/.cgi/;
open(SCRIPT,">$scriptfile") or die "Can't write to file: $!";
print SCRIPT<<"EOH";
#! /usr/local/bin/perl -w
print "Content-type: text/html\\n\\n";
print <<"END_OF_HTML";
EOH
while(<HTML>) {
s/([\$\@\\])/\\$1/g;
print SCRIPT;
}
print SCRIPT "END_OF_HTML\n\n";
}
__END__
Bart.
------------------------------
Date: Thu, 15 Apr 1999 15:25:59 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: error message
Message-Id: <7ge5f7.9n8.ln@magna.metronet.com>
Adam Dittmer (x30407@wrek1.mar.lmco.com) wrote:
: i am getting a error message when i try to use my guestbook type script
: and i am not sure wht it means if anyone could please tells me what my
: pro gram is doing wrong i would aprcieate it
: Error: HTTPd: malformed header from script
: /usr/local/etc/httpd/htdocs/cgi-bin/tplogbook.cgi
All of the messages that perl might issue are described
in the 'perldiag.pod' doc that comes with perl.
If the message isn't in there, then it isn't a perl message.
Your's is not in there, so it is not a perl message.
So you have landed in the wrong newsgroup.
Try a newsgroup that is connected in some way to WWW
type stuff. (this isn't one of those newsgroups)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 15 Apr 1999 15:10:04 -0500
From: danbeck@scott.net (Daniel Beckham)
Subject: Re: flocking question - worried
Message-Id: <MPG.1180039c7b8dbc7e989695@news.idt.net>
ooh, can you do that? That race condition has always bothered me. I was
under the assumption that you had to unlock it first...
Daniel
In article <slrn7ha4l9.j6n.billynospam@wing.mirror.bt.co.uk>,
>
> are there any fully portable solution to this problem? I'm currently not
> bothering unlock files, but am letting close() do it for me.
>
>
------------------------------
Date: 15 Apr 1999 21:24:47 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: HTTP Cookies and Netscape Browser
Message-Id: <7f5lev$qdk$2@client2.news.psi.net>
padhu@yahoo.com (padhu@yahoo.com) wrote on MMLIII September MCMXCIII in
<URL:news:7f510j$lhi$1@nnrp1.dejanews.com>:
{}
{} I wrote a script to set the HTTP cookies. It seems to work fine in IE. When i
{} go to the Windows/Cookies folder, i see the cookie being set correctly and
{} properly. Even when i close and reopen the IE browser, the cookies are still
{} present. When I try to set the cookie using Netscape (Netscape 4.5), due to
{} some reason the cookies expire as soon as i close the browser. When i open
{} the cookie.txt file, i see that the cookies are not set even when i don't
{} close the browser.
What's your Perl question?
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
------------------------------
Date: 15 Apr 1999 15:15:51 -0400
From: Jonathan Feinberg <jdf@pobox.com>
To: "Bill and Rowena Kennedy" <bkennedy@one.net.au>
Subject: Re: Out of Order
Message-Id: <m3aew9vgns.fsf@joshua.panix.com>
"Bill and Rowena Kennedy" <bkennedy@one.net.au> writes:
> rename(($srcdir.$srcfile),($srcdir.$newfile)) or die "Can't rename
> $srcfile to $newfile\n";
If you include the $! variable in the error output, then perl will
tell you what the problem is.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Thu, 15 Apr 1999 21:20:46 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: Out of Order
Message-Id: <OKsR2.805$Ij2.86493@news.shore.net>
Bill and Rowena Kennedy <bkennedy@one.net.au> wrote:
: If we call it at a DOS prompt in NT like this:
: perl Z:\pbapps\scripts\swf52xout.pl c:\projects\swift\ dsmsg.csv > test.log
: 2>&1
: then if there is an error on the "rename" line the error message "Can't
: rename ..." prints out before the "writemsg" line.
: Of course I'm sure we can come up with a work around but does anyone know
: why this happens.
It may be a buffering issue. Try setting $| to a non-zero value and see
what happens.
--Art
--
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.agitators.com/calendar/
--------------------------------------------------------------------------
------------------------------
Date: 15 Apr 1999 20:31:42 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: position in s///g?
Message-Id: <7f5ibe$kfb$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Andrew Allen
<ada@fc.hp.com>],
who wrote in article <7f589p$1r2$2@fcnews.fc.hp.com>:
> : Adding to other suggestions, note that
>
> : $a=~/0(?{pos})/substr($b,$^R-1,1)/ge;
>
> : should work with bleeding-edge Perls.
>
> corrected version:
>
> $a=~s/0(?{pos($a)})/substr($b,$^R-1,1)/ge;
> ^ ^^^^
> But even that doesn't work. At least not on 5.005_02 (is that bleeding
> edge enough?).
Definitely not. It is pretty old and buggy. I would think _55 or
more should be OK.
Ilya
------------------------------
Date: Thu, 15 Apr 1999 16:41:43 -0500
From: James Hill <jrhill@writeme.com>
Subject: Question about Connection
Message-Id: <37165D17.59AC@writeme.com>
How does one get perl to read an HTML file from another server than the
one it resides on? Thanks!!
------------------------------
Date: 15 Apr 1999 15:14:09 -0400
From: Jonathan Feinberg <jdf@pobox.com>
To: Aidan Rogers <aidan@salvador.blackstar.co.uk>
Subject: Re: Question about variables, and Perl in general
Message-Id: <m3d815vgqm.fsf@joshua.panix.com>
Aidan Rogers <aidan@salvador.blackstar.co.uk> writes:
> Anyhow, the scalar tries to treat the number as a number, and ends
> up giving me incorrect data. If it treated it as a string, however,
> I know I wouldn't get that problem. Hence, the post, because I'm
> unsure how to get Perl to treat the value as a string in this
> instance.
Code?
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Thu, 15 Apr 1999 12:20:04 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Quick Questions WIN32 Extensions.
Message-Id: <37163BE4.10C2F769@mail.cor.epa.gov>
mclaughlinj@leaders.ccl.org wrote:
>
> I have some Perl questions that I can't solve or find info on.
> Thanks for any help..
>
> 1) if i do Win32::AdminMisc::GetDriveSpace($uncpath) and the file is large,
> it returns a negative number ? My file is over 3 gig. My code works for all
> other files.
You're probably getting an overflow. If the data is being stored in a
signed integer on win32, then it's likely that a number over 2**31 will
be misread as a number between -(2**31-1) and 0.. until the number gets
large enough to wrap past zero. And then you'll really be confused by
the results.
You may need to use the Win32API module to get at the direct but
ugly API calls, in order to bypass this. And win32 boxes aren't the
only ones with this sort of problem, now that files and disks are
getting so large.
I don't know what the Perl gurus have planned to address this, but
using the -s filesize operator is becoming problematic on large
filesystems with enormous files.
> 2)if i do $gso_ports = (Win32::RasAdmin::GetPorts($RASServer,,)) over the
> WAN (56k FR) i get Time(in msec) for CALLNAMEDPIPE to complete: 260 - and the
> ports come back in error.
>
> 3)<non perl but i use o/p) if i use dumpel from the NT resource kit utilities
> it works fine for system logs but I get Dr. Watson errors for application logs
> I want to parse the logs from perl
Are you sure this last one is a Perl question? Are the files straight
text? If so, just read them in and parse away. If not, you'll have
to go elsewhere to find out the format structure first.. unless there's
a Win32 module to do just that at CPAN.
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: Thu, 15 Apr 1999 12:07:36 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Recursion not working properly
Message-Id: <371638F8.90459D25@mail.cor.epa.gov>
Mike Rizzo wrote:
>
> I have a perl script in wihch a recursive call that I am attempting is not
> executing properly. The sub is called coparedirs(), when I call comparedirs
> from inside
> comparedirs, it does start exectuing compare dirs, but it seems as if the
> original
> call to comparedirs never completes running. Is there something I am missing
> about recursion in Perl that I should know about before attempting this
> execution.
The first thing you might want to know is that recursion in Perl seems
to work better than in some other langauges where I have fought with it.
The original call won't complete until all recursive calls do. Just
like
anywhere else. But without some code, I can't make much of a guess
what's
going wrong. If I was going to be a smart-@$$ I'd tell you the problem
was on line 17 [the old unix hackers joke].
Did you run your program with the -w flag? With 'use strict;' ?
Did you get any errors? Did you get any output?
Is there the possibility of a link in your directory structure such that
a program might start going around and around through the same
directories
over and over? That wouldn't be good for a recursive program.
But this is not an uncommon Perl task. Lots of people have written
recursive programs in Perl to examine directory trees, or follow links
in web pages, or track files, or... So we probably need to see a short
program from you which replicates the problem you're having.
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: Thu, 15 Apr 1999 14:36:42 -0500
From: Ganesh Srinivasan <gsriniva@ecn.purdue.edu>
Subject: Scalars ..
Message-Id: <37163FCA.AC59B7F@ecn.purdue.edu>
Hi all,
I am relatively new to Perl and was not able to
figure this one out.
I am reading a few numbers from a form and doing some calculations and
spitting out the answers. Is there a way I can round-off the
answers that I get to say 3 decimal places or
sth?
Another thing that was holding me up was that
is there a way I can make the browser not display stuff from the cache
but compare it everytime with the network copy. This is because I was
getting images displayed from the cache when
actually the network copy has been changed. Thanks a lot,
Ganesh
------------------------------
Date: Thu, 15 Apr 1999 14:57:04 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Scalars ..
Message-Id: <371660B0.1F70B655@mail.cor.epa.gov>
Ganesh Srinivasan wrote:
>
> Hi all,
> I am relatively new to Perl and was not able to
> figure this one out.
>
> I am reading a few numbers from a form and doing some calculations and
> spitting out the answers. Is there a way I can round-off the
> answers that I get to say 3 decimal places or
> sth?
This is in the FAQ. If you had used 'perldoc' you would have found the
answer some time ago. Try 'perldoc -q round' and note the remarks
about the sprintf() function.
> Another thing that was holding me up was that
> is there a way I can make the browser not display stuff from the cache
> but compare it everytime with the network copy. This is because I was
> getting images displayed from the cache when
> actually the network copy has been changed. Thanks a lot,
> Ganesh
Now this is a very different problem. Clearly this is a problem
with your browser, and nothing to do with Perl.. unless this is
a browser you have *written* in Perl. But I'll get you started,
since I'm such a nice guy. :-) Go into your browser's 'preferences'
section; find the page where it determines caching frequency; and
change the frequency, which is probably set on 'at startup only'
or some phrase like that.
And in future, please ask browser questions in an appropriate
newsgroup.
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: Thu, 15 Apr 1999 21:19:47 +0200
From: "Thomas" <rawkrawl@rednecks.com>
Subject: Re: SQL and the ODBC module
Message-Id: <37163b1f.0@d2o64.telia.com>
yep,I ran into pretty much the same problem myself some weeks ago,
if you are talking about the Win32::ODBC module..
it seems that Win32::ODBC cannot execute things stated this way:--->>>
$db->Sql("INSERT INTO table1 (fld1, fld2) VALUES ('$var1', '$var2')");
i had to put it this way ,meaning that I had to set *all* table1
fields at once,
which I weren't too happy about.--->>>
$db->Sql("INSERT INTO table1 VALUES ('$var1', '$var2')");
anyone else got a better solution ??
Please let me know...
ok, cdasdd
--
__________________________________
thomas(atty)firstpoint(dotty)se
area [design & reklam institut] sweden.
http://www.area.firstpoint.se
^4'^(4"4*^'^4'^("`4^'*^4'^(`*^'4'^((4`^4'(^4'^(4"4^4'
leejola@my-dejanews.com skrev i meddelandet
<7f3us7$ojh$1@nnrp1.dejanews.com>...
|I am using the ODBC module to interface with and Access 97 database
for a
|web-based project. I need to use an "INSERT INTO" statement to append
a new
|record to the database. I was using the statement shown below and yet
still it
|doesn't work. Any assistance given to help solve this problem would
be greatly
|appreciated.
|
|$db->Sql("INSERT INTO tblPayeeList (Payee, Address, City, PayeeDescr,
AcctNum,
|Phone) VALUES ('$PayeeName', '$Address', '$City', '$PayeeType',
'$AccountNum',
|'$Phone') WHERE Username = '$LoginName'");
|
|-----------== Posted via Deja News, The Discussion Network
==----------
|http://www.dejanews.com/ Search, Read, Discuss, or Start Your
Own
------------------------------
Date: Thu, 15 Apr 1999 12:00:17 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Trying to get the cgi script to print the date last updated rates!
Message-Id: <MPG.117fd720b3f1be819898c1@nntp.hpl.hp.com>
In article <37162AAA.B42D7D7B@mail.cor.epa.gov> on Thu, 15 Apr 1999
11:06:34 -0700, David Cassell <cassell@mail.cor.epa.gov> says...
> Loans2001 wrote:
> >
...
> > $outstr = "3/$day/$yr at ".sprintf("%.2d",$hour).':'.sprintf("%.2d", $min);
Nobody has noted that '3' isn't the month that is being printed at the
website referred to in the original post. (And $mon isn't used at all
here.) So clearly what we are seeing here is *not* the actual code.
...
> > Why does it print a silly "1"?
> >
> > That's the current problem.
My conjecture is that something silly like 'print printf ...' is
happening, where the '1' being printed is the success return from
printf. But then it would come after the printf results, not before.
Hmmm...
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 15 Apr 1999 20:56:06 GMT
From: spg@quokka.com (Gus)
Subject: warnings on Win32
Message-Id: <3716518a.58650915@news.earthlink.net>
Seems simple but I can't figure how to turn on warnings in Win32
scripts (command line is not a problem)
Unix is a layup:
#! /usr/bin/perl -w
but since Win32 doesn't recognize the shebang, how would I turn on
warnings?
Thanks in advance
gus
Oh yeah, getting a real OS is not an option ;
------------------------------
Date: Thu, 15 Apr 1999 14:16:19 -0700
From: Greg McCann <gregm@well.com>
Subject: Re: warnings on Win32
Message-Id: <37165723.1798B13D@well.com>
Gus wrote:
>
> Seems simple but I can't figure how to turn on warnings in Win32
> scripts (command line is not a problem)
>
> Unix is a layup:
> #! /usr/bin/perl -w
>
> but since Win32 doesn't recognize the shebang, how would I turn on
> warnings?
Win32 doesn't recognize the shebang, but perl recognizes the -w in the shebang.
A simple test. Compare...
#! /usr/bin/perl
$foo = 'blah';
to...
#! /usr/bin/perl -w
$foo = 'blah';
Greg
--
======================
Gregory McCann
http://www.calypteanna.com
"Be kind, for everyone you meet is fighting a great battle." Saint Philo of
Alexandria
------------------------------
Date: 15 Apr 1999 17:34:16 -0500
From: "erk" <ericw@fikus.com>
Subject: Re: warnings on Win32
Message-Id: <37165b58@discussions>
Exec as:
perl -w scriptname
spg@quokka.com (Gus) wrote:
>Seems simple but I can't figure how to turn on warnings in Win32>scripts (command line is not a problem)
>
>Unix is a layup:
>#! /usr/bin/perl -w
>
>but since Win32 doesn't recognize the shebang, how would I turn on
>warnings?
>
>Thanks in advance
>
>gus
>
>Oh yeah, getting a real OS is not an option ;
>
------------------------------
Date: 13 Apr 1999 22:02:27 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: what does this error msg mean?
Message-Id: <7f0etj$q8$1@gellyfish.btinternet.com>
On Tue, 13 Apr 1999 16:39:28 -0400 Diane Unger wrote:
> I am using a variation of the Schwartzian Transform to sort some data
> for display on a web page. I keep getting the following error:
>
> "map" may clash with future reserved word at /cgi-bin/logs.cgi line 232.
>
It means that you are running an old version of Perl.
I would ask the admin of your server where (if at all) the Perl 5 resides.
/J\
--
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: Thu, 15 Apr 1999 18:01:47 -0400
From: Ozette Brown <ozette.brown@infotechfl.com>
Subject: Re: Win32 Mail Client
Message-Id: <371661CB.A4B34B56@infotechfl.com>
Greg,
Try the Sendmail from www.demobuilder.com.
Works for me just fine.
Ozette
Greg Griffiths wrote:
> I'm trying to get the equiverlent of Sendmail to work under a win32
> environment, but keep hitting errors, does someone have a nippet of code
> that will allow me to send an email in this environment ?
--
Ozette Brown <Ozette.Brown@Infotechfl.com>
Webmaster - Systems Analyst, Infotech Inc.
5700 S.W. 34th St. Suite 1235 Phone: 352-375-7624
Gainesville, FL 32608-5371 Fax: 352-373-9586
------------------------------
Date: Thu, 15 Apr 1999 15:08:33 -0500
From: danbeck@scott.net (Daniel Beckham)
Subject: Re: Writing Binary Files
Message-Id: <MPG.11800338e6efd970989694@news.idt.net>
You most likely want to use the pack and unpack functions to write and
read binary structures. It looks like you might be trying to write a 32
bit integer, so you would want to use l or L depending if you want to
write signed or unsigned. Just pack your scalar and then write it to the
fh. Don't bother using the binmode stuff.
enjoy!
In article <7f2tdc$smf$1@nnrp1.dejanews.com>, mshntr@mta.ca says...
> Hi,
> I'm trying to write to a file, but I want to write binary not Ascii. Here's
> what I've tried(both result in the ASCII rep of the decimal value of $loca_sig
> to be saved...)(ps - this is running on a dos based machine, hence binmode):
>
> #Attempt1
> open(ZIP,">outfile.zip");
> binmode ZIP;
> binmode STDOUT;
> $local_sig=0x04034b50;
> printf ZIP $local_sig;
> close(ZIP);
>
>
> #Attempt 2
> open(ZIP,">outfile.zip");
> binmode ZIP;
> binmode STDOUT;
> $local_sig=0x04034b50;
> printf ZIP ("%u",$local_sig);
> close(ZIP);
>
> Thanks,
> -=Matt=-
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>
------------------------------
Date: Thu, 15 Apr 1999 12:52:40 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Writing Binary Files
Message-Id: <MPG.117fe36138d36849898c2@nntp.hpl.hp.com>
In article <MPG.11800338e6efd970989694@news.idt.net> on Thu, 15 Apr 1999
15:08:33 -0500, Daniel Beckham <danbeck@scott.net> says...
> You most likely want to use the pack and unpack functions to write and
> read binary structures. It looks like you might be trying to write a 32
> bit integer, so you would want to use l or L depending if you want to
> write signed or unsigned. Just pack your scalar and then write it to the
> fh. Don't bother using the binmode stuff.
That is very bad advice. On DOSish systems, the output routine will
convert a single "\012" character to the pair "\015\012".
Always use binmode to write or read a binary file. On Unixish systems,
it will do no harm.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 15 Apr 1999 16:25:08 -0500
From: danbeck@scott.net (Daniel Beckham)
Subject: Re: Writing Binary Files
Message-Id: <MPG.11801522acc47e7c989696@news.idt.net>
True, true, he should use the binmode function in DOS/Win32
environment... my mistake.
Daniel
In article <MPG.117fe36138d36849898c2@nntp.hpl.hp.com>, lr@hpl.hp.com
says...
> In article <MPG.11800338e6efd970989694@news.idt.net> on Thu, 15 Apr 1999
> 15:08:33 -0500, Daniel Beckham <danbeck@scott.net> says...
> > You most likely want to use the pack and unpack functions to write and
> > read binary structures. It looks like you might be trying to write a 32
> > bit integer, so you would want to use l or L depending if you want to
> > write signed or unsigned. Just pack your scalar and then write it to the
> > fh. Don't bother using the binmode stuff.
>
> That is very bad advice. On DOSish systems, the output routine will
> convert a single "\012" character to the pair "\015\012".
>
> Always use binmode to write or read a binary file. On Unixish systems,
> it will do no harm.
>
>
------------------------------
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 5393
**************************************