[13311] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 721 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 6 04:22:59 1999

Date: Mon, 6 Sep 1999 01:05:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 6 Sep 1999     Volume: 9 Number: 721

Today's topics:
    Re: "use strict" errors are second-class exceptions? <rick.delaney@home.com>
        "useradd" permission denied with Setuid Perl script. <john@hendigital.com.au>
    Re: "useradd" permission denied with Setuid Perl script <jeremy@exit109.com>
        CGI module problem <drhodes@deakin.edu.au>
        DBI static link <jcohen@together.net>
        DBI static link <jcohen@together.net>
        How to make a dynamically updating Tk page? <douglas@home.com>
    Re: IO::Select (Martin Redmond)
    Re: is our reese the author of mysql book? george_reese@my-deja.com
    Re: is our reese the author of mysql book? <uri@sysarch.com>
    Re: is our reese the author of mysql book? <borg@imaginary.com>
    Re: is our reese the author of mysql book? <uri@sysarch.com>
    Re: is our reese the author of mysql book? (Abigail)
    Re: mysql interview <borg@imaginary.com>
    Re: mysql interview (Abigail)
        newbie suffering with modules <xujin@mail.wwwinfo.net.cn>
    Re: Newbie (Remco Gerlich)
        Problems with close <twade@nobmispam.net>
        Removing the formfeed when using a format <rrogers@naisp.net>
        what am doing wrong creating an html page using a templ <Jason_nyny@NOSPAMhotmail.com>
    Re: Wow! Praises from a Newbie <mpersico@erols.com>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Mon, 06 Sep 1999 04:51:55 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: "use strict" errors are second-class exceptions?
Message-Id: <37D3485F.3D3129F4@home.com>

[posted & mailed]

Sean McAfee wrote:
> 
> perldiag classifies strictness violations in precisely the same category as
> other trappable errors which put errors into $@ when encountered inside an
> eval.  In my admittedly not-totally-exhaustive perusal of the Perl docs,
> I can't find any documented reason for this difference in behavior.  Is this
> then a bug?

Could be.  This has been mentioned here a couple of times before. 
Here's one of them

http://x46.deja.com/getdoc.xp?AN=483645444

> 
> I'm using Perl 5.005_03.
> 
> Man, what a bummer.  It's rather crucial for the code I'm writing now to be
> able to distinguish warnings from fatals.

I remember this trick from Mike Guy to check compilation with eval.

    use strict;
    my $code = 'FOO; print "made it\n";';
    eval "die 'Compiled OK';$code";
    print "failed strict\n" if $@ !~ /Compiled OK/;

It could still have side effects if you have BEGIN or use in $code,
though.  And you have to eval again if you actually want to run $code.

I'd at least like to see $@ =~ /eval had compilation errors/ when the
code fails the strict test, even if all the warnings couldn't be jammed
in there.

-- 
Rick Delaney
rick.delaney@home.com


------------------------------

Date: Mon, 06 Sep 1999 13:00:07 +0800
From: John Hennessy <john@hendigital.com.au>
Subject: "useradd" permission denied with Setuid Perl script.
Message-Id: <37D34A57.F5C3A4E8@hendigital.com.au>

I am running Solaris x86 2.5.1 and Perl 5.005_02. Installation of  Perl
from source reported that it was a secure environment for running
setuid/setgid programs. I assume this is why I can not locate "sperl" or
"suidperl" anywhere on this server as they are not required.

The file is currently set with the following permissions...

-rwsrws---   1 root     sysadmin    2053 Sep  6 12:40 Add.pl

Executing the Perl script containing the following line results in "UX:
useradd: ERROR: Permission denied."

system("/usr/sbin/useradd", "-c", $real, "-g", $group, "-m", $login);

For diagnostic purposes I am printing out the Real and Effective User
and Real and Effective group.
The Effective user changes correctly to 0.

Real User = 1001
Effective User is now 0
Real Group = 14 100 102 101 14
Effective Group is now 14 100 102 101 14
UX: useradd: ERROR: Permission denied.

If the same script is run as root all is well as expected.

What am I missing ?


Assistance would be most appreciated.

John.





------------------------------

Date: Mon, 06 Sep 1999 07:58:37 GMT
From: Jeremy <jeremy@exit109.com>
Subject: Re: "useradd" permission denied with Setuid Perl script.
Message-Id: <rt6t1d588os74@news.supernews.com>

John Hennessy  <john@hendigital.com.au> wrote:

> The file is currently set with the following permissions...
> 
> -rwsrws---   1 root     sysadmin    2053 Sep  6 12:40 Add.pl
> 
> Executing the Perl script containing the following line results in "UX:
> useradd: ERROR: Permission denied."
> 
> system("/usr/sbin/useradd", "-c", $real, "-g", $group, "-m", $login);

The useradd program itself is giving that error; it's not file permissions.
It doesn't like to run if the real UID isn't root.

Add this to the beginning of the Perl program:

$< = $>;

That'll set your real UID to the effective UID (so both will be 0), and
useradd will run.

-- 
Jeremy  |  jeremy@exit109.com
"Do you think a princess, and a guy like me..."  --Han Solo


------------------------------

Date: Mon, 06 Sep 1999 16:35:28 +1000
From: David Rhodes <drhodes@deakin.edu.au>
Subject: CGI module problem
Message-Id: <37D360AF.EC6E8839@deakin.edu.au>


Hi all,

I am running the script below but self_url does not seem to be perfoming

as expected. Instead of printing out the user directory path, it drops
it. Any ideas why?  My system is solaris 2.6, it's running through
apache and the perl version is 5.005. The url of the script is :

www.deakin.edu.au/~drhodes/cricket/test.cgi

Cheers

David

------------------------------------
Expected Output:
I'm talking to myself
http://www.deakin.edu.au/~drhodes/cricket/test.cgi?test=myTest.


Actual Output:
I'm talking to myself http://www.deakin.edu.au?test=myTest.


------------------------------------

Script:

#!/usr/local/bin/perl -w

use CGI;

$query = new CGI;

$query->param('test', 'myTest');
$myself = $query->self_url;
print $query->header;

print "<HTML><HEAD></HEAD><BODY><A HREF=$myself>I'm talking to myself
$myself.<
/A>";

print <<HTMLEND;
</BODY>
</HTML>
HTMLEND






------------------------------

Date: Mon, 06 Sep 1999 00:09:08 -0700
From: Jeff Cohen <jcohen@together.net>
Subject: DBI static link
Message-Id: <37D36894.B64A27F2@together.net>

How do i create a static link in the DBI.pm to perl on linux?



------------------------------

Date: Mon, 06 Sep 1999 00:09:20 -0700
From: Jeff Cohen <jcohen@together.net>
Subject: DBI static link
Message-Id: <37D368A0.45B96463@together.net>

How do i create a static link in the DBI.pm to perl on linux?



------------------------------

Date: Mon, 06 Sep 1999 07:56:21 GMT
From: Douglas Galbraith <douglas@home.com>
Subject: How to make a dynamically updating Tk page?
Message-Id: <37D37399.780853E@home.com>

I would like to use Tk to make a page that updates its contents
continuously. I believe that I saw an example using a simple clock (time 
and date updating continually), but I can't find the code for it.  If
anyone has an example of code that continually updates the contents of a
page, I'd appreciate a copy (examples are the best teachers).

Thanks for the help,
DGalbra862@aol.com


------------------------------

Date: 6 Sep 1999 03:56:39 GMT
From: redmondm@yahoo.com (Martin Redmond)
Subject: Re: IO::Select
Message-Id: <slrn7t7p03.745.redmondm@mayo.kells>

On Sat, 04 Sep 1999 17:22:39 +0200, The RoYMaN <royman@bart.nl> wrote:

>When i trie to run it it says: "Can't locate auto/IO/Select.al in @INC
>
IO::Select is defined in /perl lib root/5.00502/i586-linux/IO/Select.pm
so you need to add 
use Select; 
to you script.

>Roger
>
Martin
redmondm@yahoo.com



------------------------------

Date: Mon, 06 Sep 1999 03:10:59 GMT
From: george_reese@my-deja.com
Subject: Re: is our reese the author of mysql book?
Message-Id: <7qvbbs$st5$1@nnrp1.deja.com>

OMG, you guys are seriously obsessed. I just
stumbled onto this gem of a thread. Abigail
flaming me over code I wrote in 1992 for a
pathetic little game. Wanna show us some of your
first code Abigail? Uri slamming me because I
think perl sucks and for a chapter I obviously
had nothing to do with. I only grudgingly
included a chapter on perl in my outline. I
certainly would never have anyting to do with
writing any perl chapters; not only am I not
qualified to write on perl, I think it is
worthless in 1999.

In article <x7d7wu9uso.fsf@home.sysarch.com>,
  Uri Guttman <uri@sysarch.com> wrote:
>
>
> posted to c.l.p.misc and emailed to o'reilly.
>
> >>>>> "A" == Abigail  <abigail@delanet.com>
writes:
>
>   A> I'd rather have a Matt Wright every day,
then a George Reese once in
>   A> a lifetime.
>
> it's funny how well known matt is but you never
see him post (at least
> not here where he is most revered). i remember
how you said similar
> things back when reese was contaminating this
group. the new book has 2
> other authors so he might be diluted to only
class C pollution. sorta
> partly like treated sewage.
>
> the chapter on the o'reilly site is on perl and
has these gems:
>
> $server = param('server') or $server = '';
>
> we are partial to the object-oriented syntax,
if only because the arrow
> makes the relationship between class and method
clear.
>
> <that is fine but then i found this code>
>
> my $output = new CGI;
>
> here is an ugly one:
>
> if (not @databases) {
>
> they never heard of, or like unless. this is a
common idiom they use.
>
> the indenting online looks very odd. some code
is on the left margin and
> some is not. could just be html crap. i haven't
seen the book.
>
> here is some real buggy stuff
>
> my $table_data = $dbh->prepare("select * from
$table");
> # Now send the query to the server.
> $table_data->execute;
>
> # If the return value is undefined, the table
must not exist. (Or it could
> # be empty; we don't check for that.)
> if (not $table_data) {
>         print header, start_html('title'=>
>
> they are checking the wrong thing. how could
$table_data get changed by
> the method call to execute? and if it was
false, the call to execute
> would blow up.
>
> # using the MySQL driver and accessing
the 'teach' database.
> my $dbh = DBI->connect('DBI:mysql:teach');
> The add action itself is broken up into three
separate functions. The first
> function, add, prints out the template form for
the user to create a new
> test.
> sub add {
>
> someone forgot the # for comments in the above
section.
>
>    my @ids = ();
>    my %subjects = ();
>
> useless init with ().
> for scalars, initing to '' or 0 makes some
sense with -w but not with
> aggregates.
>
>    my $subject = param('subjects');
>    my $num = param('num');
>    $name = param('name') if param('name');
>
>    my $out = $dbh->prepare("select name from
subject where id=$subject");
>    $out->execute;
>    my ($subname) = $out->fetchrow_array;
>
> $name is not declared. and they are
inconsistant with () around the my
> args.
>
> in general it looks like this chapter was not
tech reviewed by anyone
> who knows perl very well. i blame o'reilly as
much as the trio of
> authors.
>
> on the good side all the examples use -w and
strict but i doubt they all
> run as i have shown several real bugs in both
syntax and code. and i
> have only gone thru half the chapter and not
with a finetoothed comb.
>
> anyone from o'reilly lurking here? i will cc
this to them.
>
> uri
>
> --
> Uri Guttman  -----------------  SYStems
ARCHitecture and Software Engineering
> uri@sysarch.com  ---------------------------
Perl, Internet, UNIX Consulting
> Have Perl, Will Travel  ------------------------
-----  http://www.sysarch.com
> The Best Search Engine on the Net -------------
  http://www.northernlight.com
> "F**king Windows 98", said the general in South
Park before shooting Bill.
>

George Reese (borg@imaginary.com)




Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


------------------------------

Date: 06 Sep 1999 00:09:55 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: is our reese the author of mysql book?
Message-Id: <x7ogfgof3g.fsf@home.sysarch.com>

>>>>> "gr" == george reese <george_reese@my-deja.com> writes:

  gr> OMG, you guys are seriously obsessed. I just stumbled onto this
  gr> gem of a thread. Abigail flaming me over code I wrote in 1992 for
  gr> a pathetic little game. Wanna show us some of your first code
  gr> Abigail? Uri slamming me because I think perl sucks and for a
  gr> chapter I obviously had nothing to do with. I only grudgingly
  gr> included a chapter on perl in my outline. I certainly would never
  gr> have anyting to do with writing any perl chapters; not only am I
  gr> not qualified to write on perl, I think it is worthless in 1999.

hey georgie boy,

your name is listed as an author of the book. it doesn't say what
chapters you did or didn't write. given the low quality of the perl in
that chapter, it wasn't a big leap to assume you had some guilt
there. even if you didn't write it, you have to take you share of the
blame for letting the book go out with poor code examples. so your claim
that it is a good book is weaker from this one chapter alone. that
reflects so brightly on you.

and the only thing worthless in this thread or 1999 is your opinions on
perl.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


------------------------------

Date: Mon, 06 Sep 1999 04:37:28 GMT
From: George Reese <borg@imaginary.com>
Subject: Re: is our reese the author of mysql book?
Message-Id: <cyHA3.182$96.7818@ptah.visi.com>

Uri Guttman <uri@sysarch.com> wrote:
:>>>>> "gr" == george reese <george_reese@my-deja.com> writes:

:   gr> OMG, you guys are seriously obsessed. I just stumbled onto this
:   gr> gem of a thread. Abigail flaming me over code I wrote in 1992 for
:   gr> a pathetic little game. Wanna show us some of your first code
:   gr> Abigail? Uri slamming me because I think perl sucks and for a
:   gr> chapter I obviously had nothing to do with. I only grudgingly
:   gr> included a chapter on perl in my outline. I certainly would never
:   gr> have anyting to do with writing any perl chapters; not only am I
:   gr> not qualified to write on perl, I think it is worthless in 1999.

: hey georgie boy,

: your name is listed as an author of the book. it doesn't say what
: chapters you did or didn't write. given the low quality of the perl in
: that chapter, it wasn't a big leap to assume you had some guilt
: there. even if you didn't write it, you have to take you share of the
: blame for letting the book go out with poor code examples. so your claim
: that it is a good book is weaker from this one chapter alone. that
: reflects so brightly on you.

: and the only thing worthless in this thread or 1999 is your opinions on
: perl.

The fact that you say the quality of the perl code is low means
nothing to me. I honestly am not qualified to comment on the quality
of the code in the perl chapters. I do know that O'Reilly has good
people for doing tech reviews of Perl stuff.

Remember, the post in question to which I was responding was you
dismissing the book out of hand because I was an author. It seems more
likely to me you are dismissing Randy's work because of his
association with me than it is likely that the code is wrong.

Either way, however, dismissing a book on MySQL and mSQL because one
of the three authors of the book thinks Perl is crap is absurd. Being
obsessed with someone who posted that opinion a year ago is pathetic.

-- 
		  George Reese (borg@imaginary.com)
		    http://www.imaginary.com/~borg
       "The dead know only one thing: it's better to be alive"
		     -Joker in Full Metal Jacket


------------------------------

Date: 06 Sep 1999 01:43:36 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: is our reese the author of mysql book?
Message-Id: <x7lnakoarb.fsf@home.sysarch.com>

>>>>> "GR" == George Reese <borg@imaginary.com> writes:

  GR> The fact that you say the quality of the perl code is low means
  GR> nothing to me. I honestly am not qualified to comment on the
  GR> quality of the code in the perl chapters. I do know that O'Reilly
  GR> has good people for doing tech reviews of Perl stuff.

it doesn't matter that you don't know perl, which was demonstrated by
you so capably last year, your name is on the book. a whole chapter is
devoted to using my?sql via perl and it was mediocre to middling quality
code. now perl is probably one of the most (if not the most) commonly
used languages with my?sql users. so the quality of that chapter falls
on the authors heads. it has an effect on the market's perception of the
quality of book and is can be indicative of the actual quality of the
rest of it. i have only reviewed the chapter was selected to put on the
web.

  GR> Remember, the post in question to which I was responding was you
  GR> dismissing the book out of hand because I was an author. It seems
  GR> more likely to me you are dismissing Randy's work because of his
  GR> association with me than it is likely that the code is wrong.

i would lower my judgment of quality of any books that you write. it is
my opinion and i will stnad by it. your lack of understanding of computer
languages and systems is apalling.

  GR> Either way, however, dismissing a book on MySQL and mSQL because
  GR> one of the three authors of the book thinks Perl is crap is
  GR> absurd. Being obsessed with someone who posted that opinion a year
  GR> ago is pathetic.

you just posted it now, a year later. oh, well, we just were happy you
were gone. make us happy again? i am sorry i eevn mentioned your name
here wondering if you were the name on this book. you must scan deja for
mentions of your name.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


------------------------------

Date: 6 Sep 1999 01:41:35 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: is our reese the author of mysql book?
Message-Id: <slrn7t6om9.l54.abigail@alexandra.delanet.com>

Uri Guttman (uri@sysarch.com) wrote on MMCXCVII September MCMXCIII in
<URL:news:x7lnakoarb.fsf@home.sysarch.com>:
// >>>>> "GR" == George Reese <borg@imaginary.com> writes:
// 
//   GR> Remember, the post in question to which I was responding was you
//   GR> dismissing the book out of hand because I was an author. It seems
//   GR> more likely to me you are dismissing Randy's work because of his
//   GR> association with me than it is likely that the code is wrong.
// 
// i would lower my judgment of quality of any books that you write. it is
// my opinion and i will stnad by it. your lack of understanding of computer
// languages and systems is apalling.

<aol>
Me too!
</aol>

George, I've seen a lot more than just your first code. Over the years
I've seen enough code, articles and other writings by your hand to
instantly dismiss anything bearing your name as something worth reading.

Don't bother replying; I know your spiel.


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: Mon, 06 Sep 1999 03:07:47 GMT
From: George Reese <borg@imaginary.com>
Subject: Re: mysql interview
Message-Id: <7eGA3.158$96.6798@ptah.visi.com>

Abigail <abigail@delanet.com> wrote:
: Makarand Kulkarni (makkulka@cisco.com) wrote on MMCLXXXV September
: MCMXCIII in <URL:news:37C36944.2BB77495@cisco.com>:
: __ [ barrytownbb@yahoo.com wrote:
: __ 
: __ > I wanted to get a headstart on essential reading for being "tech-ed out"
: __ 
: __ A new book is now out --
: __ MySQL and mSQL (Nutshell Series)
: __ by Randy Jay Yarger, George Reese, Tim King


: *ahum* Better not get me as the interviewer then.

: Me:        Did you learn anything from George Reese?
: Candidate: *nod* *nod*
: Me:        You will be hearing from us. Goodbye.

Jesus, Abigail, did I shoot your dog or something?

You have no basis of making such a claim, and it is a completely
absurd statement. The book is a good book.

-- 
		  George Reese (borg@imaginary.com)
		    http://www.imaginary.com/~borg
       "The dead know only one thing: it's better to be alive"
		     -Joker in Full Metal Jacket


------------------------------

Date: 6 Sep 1999 01:44:44 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: mysql interview
Message-Id: <slrn7t6os0.l54.abigail@alexandra.delanet.com>

George Reese (borg@imaginary.com) wrote on MMCXCVII September MCMXCIII in
<URL:news:7eGA3.158$96.6798@ptah.visi.com>:
~~ 
~~ Jesus, Abigail, did I shoot your dog or something?

Why don't you just do what you suggested in
<news:335A228D.80E9C5FA@imaginary.com>?

~~ You have no basis of making such a claim, and it is a completely
~~ absurd statement. The book is a good book.

It has your name on it. How can it be?


Abigail
-- 
perl -wle\$_=\<\<EOT\;y/\\n/\ /\;print\; -eJust -eanother -ePerl -eHacker -eEOT


  -----------== 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: Mon, 6 Sep 1999 15:55:38 +0800
From: "xujin" <xujin@mail.wwwinfo.net.cn>
Subject: newbie suffering with modules
Message-Id: <rt6sp5qh8os53@news.supernews.com>

Hi

I am newbie to perl and programming. Where can I find some documents about
module and existing modules(such as ftp,socket)?

Any suggestion and idea would be appreciated.

Thanks in advance.

Good luck!

My email: xujin@mail.wwwinfo.net.cn




------------------------------

Date: 6 Sep 1999 06:53:47 GMT
From: scarblac-spamtrap@pino.selwerd.cx (Remco Gerlich)
Subject: Re: Newbie
Message-Id: <slrn7t6p36.haf.scarblac-spamtrap@flits104-37.flits.rug.nl>

JT <axiomwest@home.com> wrote:
> I was wondering if i can get some hints or a Faq or something when working
> with Perl ?

There is a *huge* FAQ that comes with perl, and a lot of other
documentation as well.

Try "man perlfaq", or if that fails "perldoc perlfaq".

Also the page for "perl", and take it from there...

-- 
Remco Gerlich,  scarblac@pino.selwerd.cx
  Murphy's Rules, "Sinus Trouble":
   In FGU's adventure The King over the Water, a character must make a
   Sense Acuity roll to detect a pile of sixteen dead rats.


------------------------------

Date: Mon, 6 Sep 1999 00:35:25 -0700
From: "meteorman" <twade@nobmispam.net>
Subject: Problems with close
Message-Id: <rt6rlub18os25@corp.supernews.com>

I am having problems with the below code when I call the system cp command.
Basically, the filehandle SPOT is not being saved before the cp command is
called.  I believe, it has something to do with delayed flushing of the
buffer which holds all my new data.  As a result, I get the old contents
cp'd to $newfile instead of the newer contents.  Is there a way to avoid
this.  I have read from other posts and FAQ that opening and closing the
same file consequtively can lead to problems, but, at this time, I know of
no other way to do what needs to be done.  Any comments or suggestions would
be greatly appreciated.

#####################

$newname = "spot" . $num . ".html";
  undef $/;
  open (TMPSPOT, ">$storage");
  open (HDR, "$hdr");
  $tmpstr=<HDR>;  # attach html header
  close HDR;
  print TMPSPOT "$tmpstr\n";
  close TMPSPOT;
  open (TMPSPOT, ">>$storage");
  print TMPSPOT "$spot\n";  # attach spot forecast
  open (FTR, "$ftr");
  $tmpstr=<FTR>;
  close FTR;
  print TMPSPOT "$tmpstr";  # attach html footer
  close TMPSPOT;
  open (TMPSPOT, "$storage");
  $file = join '', $fwsdir,$newname;
  open (SPOT, ">$file") || die "Could not open $file";
  print SPOT <TMPSPOT>; # replace original spot with updated spot
  close TMPSPOT;
  close SPOT;
  $newfile = join '', $htmldir,$newname;
  system ("cp $file, $newfile");

#########################

Thanks in advance,

 ...Wade...





------------------------------

Date: Mon, 06 Sep 1999 03:31:10 -0700
From: Rob Rogers <rrogers@naisp.net>
Subject: Removing the formfeed when using a format
Message-Id: <37D397EE.B51EBC2B@naisp.net>

After some searching I found this in perlform:

The string output before each top of page (except the first) is stored
in $^L ($FORMAT_FORMFEED)

Which is set to \f as a default. I needed to get that out of there
because the output of this is being opened in a richedit field in a
Win32::Gui program for reviewing (it's a payroll report) and then after
any changes the file gets read in and re-output to a different file
handle with a different format.

Setting $^L to ""  keeps the form feed from being printed but I still
get an extra newline (actualy CRLF on Win32) Can anyone tell me a way to
avoid this? I tried undef($^L) but that just resulted in a runtime error
when it hit the end of the first page.

Thank you,
Rob Rogers


------------------------------

Date: Mon, 6 Sep 1999 01:06:16 -0400
From: "Jason" <Jason_nyny@NOSPAMhotmail.com>
Subject: what am doing wrong creating an html page using a template and database?
Message-Id: <7qvi9q$okb@dfw-ixnews5.ix.netcom.com>

Hello,

I am writing a script where a person will have
-a database of data
-an html file that needs to be used as a template .... top and bottom parts
not be repeated but the middle part that is going to contain the records
should be generated ...  the script needs to take !0! and change it to
field[0]     !1! to field[1] and son on ..

Can some one please tell me what am I doing wrong?


#!/usr/bin/perl
use CGI qw(:standard);

print "Content-type:text/html\n\n";


my $template = param("template");
my $outputfile = param("outputfile");
my $file = param("datafile");
my $delimator = param("delimator");


unless (open (TEMPL, $template))
 {
 print "Cannot open $template";
 exit;
 }
undef ($/);
$template=<TEMPL>;
close TEMPL;
($top, $record, $bottom)=split(/<!--record-->/, $template);


# matching
$count=0;
unless (open (FILE, $file))
 {
 print "Cannot open $file";
 exit;
 }

@data=<FILE>;
close FILE;

LOOP: for ($a=$start; $a<@data; $a++)
 {
 $data[$a]=~s/$delimator//;
  {
  @fields=split(/\$delimator/, $data[$a]);

  $line=$record;

  $line=~s/!(\d+)!/$fields[$1]/g;

  print $line;



  }

 }





------------------------------

Date: Mon, 06 Sep 1999 00:22:40 -0400
From: root <mpersico@erols.com>
Subject: Re: Wow! Praises from a Newbie
Message-Id: <37D34190.21BE64A3@erols.com>

Patrick Timmins wrote:
> 
> In article <37D1C7EF.6EE99548@erols.com>,
>   "Matthew O. Persico" <mpersico@erols.com> wrote:
> 
> > robert_kolker@hotmail.com wrote:
> > >
> > > After nibbling around the edges of PERL for several months I have
> > > finally gotten down to doing some substantial programming in the
> > > language.
> > >
> > > Even though I am a rank Newbie, I have been able to write some
> > > "quick and dirty" utilities in under 5 minutes that would have taken
> > > an hour to write in a programn language such as C, C++ or Java.
> [snip]
> > Yep, that's exactly the same feeling I got on the day that I finally
> > grokked $,@,%. I call it the Epiphany Effect. Wait until you start
> 
> Honestly, although I've never really thought about it before, this
> *is* a real thing, at least for me. Only I've sort of referred to
> it in my own mind as the 'Oh Sh--!' Effect, because this is
> generally what I verbalize, either internally or out loud, when it
> hits me.

Well, yes, that is what I actually say to myself also, but I really
didn't feel like naming an effect after it.

> It usually happens upon re-visiting something I've previously
> brushed over in one of tom c's FMTEYEWTK, or Sriram Srinivasan's
> 'Advanced Perl Programming', or an article in TPJ.
> 
> Building up complex data structures on the fly did it for me. Later
> on, realizing I can, at will, turn chunks of a really complex
> data structure into self contained objects, which can be stored away
> or passed around, did it for me again. Finding that perfect little
> Perl module (most recently, Graham Barr's LDAP module) that already
> has everything I need, will often set off a string of serial
> 'Oh Sh--!' stammerings over the course of an evening, as I play
> with the methods and work through the documentation.

Usually, I'll string together a multi part map/grep/sort/anonymous sub
mess of code and when it 'does the right thing', I'll sit back and give
thanks that Larry was a linguist first.

> 
> 'Oh Sh--!' may not be terribly articulate, but I can assure you,
> it is sincere. In fact in Nebraska, people will routinely hear their
> neighbor down the road shout 'Oh Sh--!' and they'll start talking
> back and forth amongst themselves:
> 
> Bill: 'Sounds like Bob is having an epiphany again.'
> Tom : 'Yep ... sure does.'
>     (long Nebraska lull in the "conversation")
> Tom: 'You had an epiphany lately?'
>     (another lull)
> Bill: 'I ... a ... did get my Perl scripts that read in my GPS data
>        and use my fixed Nitrogen levels working with the GD module.'
> Tom:  'Oh Sh--! So you can automatically plot all that out now!'
> Bill: 'Yep. And build a gif-loop to watch the changes over time.'
> Tom:  'Oh Sh--!'
> Bill: 'Yep.'

In certain sections of New York City, the term most often used is a more
gutteral form of "one who engages maternal intercourse". I'll take the
articulate Nebraskans anyday. At least they have reason to be hung on up
on sh--; I bet the majority of them step in it every day. :-)

> 
> $monger{Omaha}[0]
> Patrick Timmins
> ptimmins@itd.sterling.com
> 
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.

--
Matthew O. Persico (root)
Running Netscape on Linux. Is the glass half empty
or half full?


------------------------------

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 721
*************************************


home help back first fref pref prev next nref lref last post