[16808] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4220 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 4 11:05:43 2000

Date: Mon, 4 Sep 2000 08:05:21 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <968079920-v9-i4220@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 4 Sep 2000     Volume: 9 Number: 4220

Today's topics:
    Re: A Challenge (Tony L. Svanstrom)
    Re: A Challenge <bart.lateur@skynet.be>
        apache and perl cgi <vtinsley@mediaone.net>
    Re: apache and perl cgi <lincolnmarr@nospam.europem01.nt.com>
    Re: apache and perl cgi (Jonaskuh)
    Re: apache and perl cgi <nickco3@yahoo.co.uk>
        Appending two arrays fast? <Mads@Troest.NEVERMORE.dk>
    Re: Appending two arrays fast? <stephenk@cc.gatech.edu>
    Re: Backslash usage? <gellyfish@gellyfish.com>
        Convert UNIX Timestamp to DateTime (Jonaskuh)
    Re: Convert UNIX Timestamp to DateTime (Andrew J. Perrin)
    Re: Convert UNIX Timestamp to DateTime (Jonaskuh)
    Re: cookies and SSI's <jpryan@labs.tamu.edu>
        Dear friends, help in locking *.db databases <paul@pco.iis.nsk.su>
    Re: exec, Apache, win32 <chs@netlink.com.au>
    Re: Extra ^M in text file <Joshua.Levy@nortel-dasa.de>
        Flock being stubborn <lincolnmarr@nospam.europem01.nt.com>
    Re: Flock being stubborn (Rafael Garcia-Suarez)
        RE: Help !!! (HPUX11+Oracle8+DBD) ishulz@lycosmail.com
    Re: HELP with WWWBoard Script natsurfer@my-deja.com
    Re: HELP with WWWBoard Script <lincolnmarr@nospam.europem01.nt.com>
    Re: HELP with WWWBoard Script <mtaylorlrim@my-deja.com>
        How to copy directory tree <lincolnmarr@nospam.europem01.nt.com>
    Re: How to truncate file after nth occurrence of string <gustfrnt@globalvision.net>
        HTML::parse bug <T.Cockle@staffs.ac.uk>
    Re: Inserting todays date (Jonaskuh)
    Re: Inserting todays date <bart.lateur@skynet.be>
        intranet using perl cgi richard_dobson@my-deja.com
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Mon, 4 Sep 2000 15:40:13 +0200
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: A Challenge
Message-Id: <1egfy5f.k2x1nx1viclejN%tony@svanstrom.com>

Randy <randy_734@my-deja.com> wrote:

> tjla@guvfybir.qlaqaf.bet (Gwyn Judd) wrote:
> 
> >here:
> >
> >#!/usr/bin/perl -w
> >use strict;
> >use Telephony::Telephone;
> >
> >my $telephone = new Telephony::Telephone;
> >
> >$telephone->dial('1-800-PIZZA');
> >
> >print $telephone <<END_OF_CALL;
> >Mushrooms
> >Olives
> >Pepperoni
> >Coke
> >END_OF_CALL
> >
> ># yeah I know it's not lasagne

Could you write one that picks up women too? ;-)


     /Tony
-- 
     /\___/\ Who would you like to read your messages today? /\___/\
     \_@ @_/  Protect your privacy:  <http://www.pgpi.com/>  \_@ @_/
 --oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
   on the verge of frenzy - i think my mask of sanity is about to slip
 ---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
    \O/   \O/  ©99-00 <http://www.svanstrom.com/?ref=news>  \O/   \O/


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

Date: Mon, 04 Sep 2000 14:07:43 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: A Challenge
Message-Id: <d4b7rsckgtg9lueh7ed6t3asnhhoq2gjq2@4ax.com>

Randy wrote:

>I would like to thank you for your excellent program. I ran it earlier
>this evening and the pizza arrived about 30 minutes later.

Can you modify it, so the delivery is late, and I don't have to pay?
Free pizza, wow! It'll be cold, but you can't have everything.

-- 
	Bart.


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

Date: Mon, 04 Sep 2000 10:53:11 GMT
From: "mom in nh" <vtinsley@mediaone.net>
Subject: apache and perl cgi
Message-Id: <raLs5.18316$pu4.1347337@typhoon.ne.mediaone.net>

No matter what I do, I get a "no such file or directory..." error message
when attempting to run a perl script from cgi-bin.  The error log spells out
the directory perfectly and says it doesn't exist.
I am going crazy.
How do I run perl cgi from apache server?
thanks for saving my sanity...




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

Date: Mon, 4 Sep 2000 14:12:36 +0200
From: "Lincoln Marr" <lincolnmarr@nospam.europem01.nt.com>
Subject: Re: apache and perl cgi
Message-Id: <8p03jb$cgp$1@qnsgh006.europe.nortel.com>

> No matter what I do, I get a "no such file or directory..." error message
> when attempting to run a perl script from cgi-bin.  The error log spells
out
> the directory perfectly and says it doesn't exist.
> I am going crazy.
> How do I run perl cgi from apache server?
> thanks for saving my sanity...
>

Make sure that your cgi-bin isn't running with another alias.... to check
this either ask your sysadmin or if you have access have a look around for
the file srm.conf - on my server it's located at
/www/httpd_1.5/conf/srm.conf - but this may vary greatly on your server. If
you can have a look at this file then try and find any ScriptAliases - this
will tell you whether the address you're using for your script is the
address you should be using.

If you can't get it running then try another group - this question isn't
Perl-related.

--Lincoln




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

Date: Mon, 04 Sep 2000 13:33:53 GMT
From: jonaskuh@tell-em-off.com (Jonaskuh)
Subject: Re: apache and perl cgi
Message-Id: <39b3a384.2625879@news.coastalnet.com>

Sounds like it might be a configuration problem with Apache. Are you
able to run anything else out of the cgi-bin directory? If so, make
sure those other programs are in the same directory as the one you
just created. If you can't run anything out of the cgi-bin directory,
check your httpd.conf file in you conf directory of your webserver and
be sure that you have both of the following in the file:

ScriptAlias /cgi-bin/ /usr/local/etc/httpd/cgi-bin/

and

<Directory /usr/local/etc/httpd/cgi-bin>
AllowOverride None
Options None
</Directory>

Of course you would change the path of both to whatever your path is.
It doesn't sound like you are having file permission errors, but you
might after you get the directory set up correctly. If you do, just do
a chmod +x (filename). (Assuming you are using Unix). If you have any
other questions, just ask.

Jonaskuh

On Mon, 04 Sep 2000 10:53:11 GMT, "mom in nh" <vtinsley@mediaone.net>
wrote:

>No matter what I do, I get a "no such file or directory..." error message
>when attempting to run a perl script from cgi-bin.  The error log spells out
>the directory perfectly and says it doesn't exist.
>I am going crazy.
>How do I run perl cgi from apache server?
>thanks for saving my sanity...
>
>



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

Date: Mon, 04 Sep 2000 14:56:14 +0100
From: Nick Condon <nickco3@yahoo.co.uk>
Subject: Re: apache and perl cgi
Message-Id: <39B3A9FE.3688867C@yahoo.co.uk>

mom in nh wrote:

> No matter what I do, I get a "no such file or directory..." error message
> when attempting to run a perl script from cgi-bin.  The error log spells out
> the directory perfectly and says it doesn't exist.
> I am going crazy.
> How do I run perl cgi from apache server?
> thanks for saving my sanity...

Wrong newsgroup, we don't do webservers here. Try one the comp.infosystems.www
groups.



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

Date: Mon, 4 Sep 2000 15:15:15 +0200
From: "Mads Orbesen Troest" <Mads@Troest.NEVERMORE.dk>
Subject: Appending two arrays fast?
Message-Id: <39b3a084@194.255.58.12>

Hi;

I want to append an array to an array (of considerable size) that I already
have. The following works, but I suspect it might be a slow way to do
something which might be done better:

  @Results = ( @Results, @$paResults ); ### Sluggish?

Is there a better (i.e. faster) way?

TIA,
   /\/\\ads O. Troest




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

Date: Mon, 04 Sep 2000 09:45:03 -0400
From: Stephen Kloder <stephenk@cc.gatech.edu>
Subject: Re: Appending two arrays fast?
Message-Id: <39B3A75F.E06AFE41@cc.gatech.edu>

Mads Orbesen Troest wrote:

> Hi;
>
> I want to append an array to an array (of considerable size) that I already
> have. The following works, but I suspect it might be a slow way to do
> something which might be done better:
>
>   @Results = ( @Results, @$paResults ); ### Sluggish?
>
> Is there a better (i.e. faster) way?
>

perldoc -f push

--
Stephen Kloder               |   "I say what it occurs to me to say.
stephenk@cc.gatech.edu       |      More I cannot say."
Phone 404-874-6584           |   -- The Man in the Shack
ICQ #65153895                |            be :- think.




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

Date: 4 Sep 2000 08:30:47 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Backslash usage?
Message-Id: <8ovj37$asa$1@orpheus.gellyfish.com>

On Sat, 02 Sep 2000 15:45:23 GMT Keith Calvert Ivey wrote:
> newsgroups@ckeith.clara.net (Colin Keith) wrote:
>>"James R" <reevehotNOSPAM@hotmail.com> wrote:
> 
>>>\$cmd = $cmd
>>
>>\$var is a reference 
> 
> That would be a syntax error. 
> 

Its not a syntax error per-se:

Can't modify single ref constructor in scalar assignment at refthing.pl line 1, near "$cmd;"

Although if the RHS was a scalar containing a reference to a type the same
as the LHS then this would be just a round about way of dereferencing:

my $foo = {blah => 1,
           zub  => 2};

my %gh;

\%gh = $foo;

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: Mon, 04 Sep 2000 13:25:10 GMT
From: jonaskuh@tell-em-off.com (Jonaskuh)
Subject: Convert UNIX Timestamp to DateTime
Message-Id: <39b3a256.2323210@news.coastalnet.com>

Is there any way in Perl (Modules, Equations, Functions) where I can
convert a Unix timestamp into a regular datetime (i.e. 2000-09-04
09:24:00)?? Any help would be greatly appreciated.

Thanks,
Jonaskuh


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

Date: 04 Sep 2000 10:18:57 -0400
From: aperrin@demog.berkeley.edu (Andrew J. Perrin)
Subject: Re: Convert UNIX Timestamp to DateTime
Message-Id: <u1yz0me9a.fsf@demog.berkeley.edu>

jonaskuh@tell-em-off.com (Jonaskuh) writes:

> Is there any way in Perl (Modules, Equations, Functions) where I can
> convert a Unix timestamp into a regular datetime (i.e. 2000-09-04
> 09:24:00)?? Any help would be greatly appreciated.
> 
> Thanks,
> Jonaskuh

perldoc -f stat
perldoc -f localtime

-- 
----------------------------------------------------------------------
Andrew Perrin - Solaris-Linux-NT-Samba-Perl-Access-Postgres Consulting
       aperrin@igc.apc.org - http://demog.berkeley.edu/~aperrin
----------------------------------------------------------------------


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

Date: Mon, 04 Sep 2000 14:48:28 GMT
From: jonaskuh@tell-em-off.com (Jonaskuh)
Subject: Re: Convert UNIX Timestamp to DateTime
Message-Id: <39b3b5b4.7278393@news.coastalnet.com>

On 04 Sep 2000 10:18:57 -0400, aperrin@demog.berkeley.edu (Andrew J.
Perrin) wrote:

>jonaskuh@tell-em-off.com (Jonaskuh) writes:
>
>> Is there any way in Perl (Modules, Equations, Functions) where I can
>> convert a Unix timestamp into a regular datetime (i.e. 2000-09-04
>> 09:24:00)?? Any help would be greatly appreciated.
>> 
>> Thanks,
>> Jonaskuh
>
>perldoc -f stat
>perldoc -f localtime
>
>-- 
>----------------------------------------------------------------------
>Andrew Perrin - Solaris-Linux-NT-Samba-Perl-Access-Postgres Consulting
>       aperrin@igc.apc.org - http://demog.berkeley.edu/~aperrin
>----------------------------------------------------------------------

That's not exactly what I want to do.. what I meant is to take a Unix
timestamp, (i.e. 968078883) and convert it to the above date format,
or even (Mon Sep  4 08:48:31 MDT 2000) I could still work with that..

Thanks!!


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

Date: Mon, 04 Sep 2000 09:42:21 -0500
From: James Philip Ryan <jpryan@labs.tamu.edu>
Subject: Re: cookies and SSI's
Message-Id: <39B3B4CD.39FA8EFB@labs.tamu.edu>

The CGI::Cookie manual said the path was being set as "/" by default; I didn't even
consider that to be the problem.  Thanks for your help...  you rock

-James

--
"If you ever have any trouble sounding condescending, leave it to a UNIX user to
show you how its done."

jason wrote:

> James Philip Ryan <jpryan@labs.tamu.edu> wrote ..
> >"Tony L. Svanstrom" wrote:
> >
> >> James Ryan <jpryan@cis.tamu.edu> wrote:
> >>
> >> > This is my circumstance:  all of the HTML files are SHTML, and each SHTML
> >> > file runs a script via server-side-include that displays a navigation
> >> > panel if the user is logged in.  how do I access the client's cookie data
> >> > from a script that is run as an SSI?
> >>
> >> The same way that you would if it'd been a normal CGI-script.
> >
> >I may be doing something wrong, but when I run the script by itself (as in not
> >an SSI directive), the $ENV{'HTTP_COOKIE'} variable contains the cookie data.
> >When I run the script from an SSI (<!--#exec cgi=/cgi-bin/nameofscript.pl -->
> >), the variable is empty.  Any other suggestions?
>
> for a start .. please post *this* way round .. ie. your reply *beaneath*
> what you're replying to .. it's just the way things are done around here
>
> to your problem .. do you know much about cookies ? .. you have probably
> set the cookie to be specific to the script that it was written by (by
> not including a PATH attribute)
>
> this is not really any long a Perl question .. because Tony was correct
> - you *do* access cookies in SSI scripts *exactly* the same was as in
> standard CGI scripts .. it's just that you need to have the PATH
> attribute of the cookie set so that you can see it from the script that
> you're reading it in as well as the script that it was written from
>
> see one of the numerous resources that cover cookies .. or even look in
> the CGI::Cookie manual
>
>   perldoc CGI::Cookie
>
> it covers the topic reasonably well
>
> --
>   jason -- elephant@squirrelgroup.com --



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

Date: Mon, 4 Sep 2000 21:58:36 +0600
From: "Paul Dortman" <paul@pco.iis.nsk.su>
Subject: Dear friends, help in locking *.db databases
Message-Id: <8p0d4b$2ntj$1@news.itfs.nsk.su>

Dear Friends,

Please help, I get error and I can not find how to fix it.

I'm working with DB_File module,
I try to open database to read some information, after that I close
database.
Than I open database to write some information and close it. Of course,
I lock database while open and unlock it while close

Please look at this simple code below, And tell me what's wrong  or give me
advice where
can I find information that could help me!

This program does not work. I got error   "Bad file descriptor at ./test5.pl
line 38." when I tried to run it.
(Error occured when Program tried to open data.db file second time)

I will happy If somebody helps me

Thank you.

Paul

#!/usr/bin/perl

use DB_File;

sub LOCK_SH { 1 }
sub LOCK_EX { 2 }
sub LOCK_NB { 4 }
sub LOCK_UN { 8 }


#open for reading

my($tr_db, $fd_tr_db);

$tr_db = tie(%tr_db, 'DB_File', "/home/paul/temp/data.db", O_CREAT|O_RDWR,
0666)
         or die "db  /home/paul/temp/data.db : $!";
$fd_tr_db = $tr_db->fd;
open(TR_DB_FH, "+<&=$fd_tr_db") or die "error, $fd_tr_db : 1 : $!";
unless (flock(TR_DB_FH, LOCK_SH)) {
        die "can not get lock on file /home/paul/temp/data.db";
}

#processing

foreach $user (@ARGV) {
               print "$user\t$tr_db{$user}\n";
}

#close
$tr_db -> sync;
flock(TR_DB_FH,    LOCK_UN);
untie %tr_db;
close(TR_DB_FH) or die "Could not close TR_DB_FH: $!";

#open for writing
$tr_db = tie(%tr_db, 'DB_File', "/home/paul/temp/data.db", O_CREAT|O_RDWR,
0666)
         or die "db /home/paul/temp/data.db : $!";
$fd_tr_db = $tr_db->fd;
open(TR_DB_FH, "+<&=$fd_tr_db") or die "error, $fd_tr_db : 2 : $!";
unless (flock(TR_DB_FH, LOCK_EX)) {
        die "can not get lock on file /home/paul/temp/data.db";
}

#processing

foreach $user (@ARGV) {
               $tr_db{$user}++;
}

#close
$tr_db -> sync;
flock(TR_DB_FH,    LOCK_UN);
untie %tr_db;
close(TR_DB_FH) or die "Could not close TR_DB_FH: $!";







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

Date: Mon, 4 Sep 2000 23:24:20 +1000
From: "Chris Seeling" <chs@netlink.com.au>
Subject: Re: exec, Apache, win32
Message-Id: <8p08a3$qpd$1@news.netlink.com.au>


jason <elephant@squirrelgroup.com> wrote in message
news:MPG.141d8880b67dddbd98974e@localhost...

> now .. all that having been said .. and realising that I'm not sure
> about any of it .. you can probably still do what you want with the
> Win32::OLE module .. look it up in the documentation .. it allows you to
> interact with excel.exe (in a window-less mode) and run your macros from
> within the Perl code


Thanks, the Win32::OLE module did the trick.





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

Date: Mon, 04 Sep 2000 11:38:47 +0200
From: "Levy, Joshua" <Joshua.Levy@nortel-dasa.de>
Subject: Re: Extra ^M in text file
Message-Id: <39B36DA7.9E233657@nortel-dasa.de>


If when u transfer from unix/linux to NT you tar the files, the ^M won't
appear, it only affects text files, tar & Zip will be spared.


J.



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

Date: Mon, 4 Sep 2000 16:23:26 +0200
From: "Lincoln Marr" <lincolnmarr@nospam.europem01.nt.com>
Subject: Flock being stubborn
Message-Id: <8p0b8h$gbk$1@qnsgh006.europe.nortel.com>

I posted a while back about a problem I was having with flock - I couldn't
get it to work. I've since read all your advice and written a test script,
which theoretically should lock the file perfectly (isn't theory
wonderful??).

So, below is my complete test script.

####### begin script here ################
#!/bin/perl -w
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
use Fcntl qw(:flock);
$script_name = "flock.cgi";
$file = "flock_file";
$q = new CGI;
$action = $q->param("action");
$information = $q->param("information");

if($action =~ /lock file/i) { &lock_file; exit; }
else { &print_default; exit; }

############## print default ###############
sub print_default {
&html_header;
print<<HTML;
<FORM ACTION="$script_name" METHOD="post">
<INPUT TYPE="text" NAME="information" SIZE=50>
<p>
<INPUT TYPE="submit" NAME="action" VALUE="Lock File">
</FORM>
HTML
&html_footer;
}

############## lock file ################## - this is where the real guts
starts
sub lock_file {
$index = time();
$record = $index . "\|$information";
open(FILE,">>$file") || die "Can't open file, $!\n";
flock FILE, LOCK_EX || die "Can't lock file, $!\n";
seek FILE, 0, 2;
print FILE "$record\n";
sleep 2;
close(FILE);
flock FILE, LOCK_UN || die "Can't unlock file, $!\n";
&html_header;
print<<HTML;
The file has been updated.
HTML
&html_footer;
}

############## html header ################
sub html_header {
print "Content-type: text/html \n\r\n\r";
print<<HTML;
<HTML><HEAD><TITLE>Flock test</TITLE>
</HEAD><BODY BGCOLOR="FFFFFF">
HTML
}

############## html footer ################
sub html_footer {
print<<HTML;
</BODY></HTML>
HTML
}

############# end of script ###################

ok, so you're probably wondering why I made it 'sleep 2' when the file is
open. Simple. I'm using time() as a unique index - meaning that I cannot
have two lines both starting with the same time (and since it takes less
than a second for the script to do its stuff I made it sleep). If there are
any alternatives to time which are guaranteed to be totally unique then I'm
open to suggestions too, as I know this sleep idea is totally silly.

Ok anyway, my problem is that even with sleep it's still very possible to
have two lines starting with the same index, which is a big no-no. According
to my reasoning (which is most likely very amateur), if the script sees that
the file is locked when it tries to open it for appending, it should die or
else wait until it can access the file. But why doesn't it ?? I'm very stuck
here.

Any help VERY much appreciated, believe me.

--Lincoln




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

Date: Mon, 04 Sep 2000 14:44:27 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: Flock being stubborn
Message-Id: <slrn8r7dlq.f9p.rgarciasuarez@rafael.kazibao.net>

Lincoln Marr wrote in comp.lang.perl.misc:
>I posted a while back about a problem I was having with flock - I couldn't
>get it to work. I've since read all your advice and written a test script,
>which theoretically should lock the file perfectly (isn't theory
>wonderful??).
>
>So, below is my complete test script.

[...snip...]

>flock FILE, LOCK_EX || die "Can't lock file, $!\n";
                     ^^
                     or
(avoids precedence problems)

-- 
Rafael Garcia-Suarez


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

Date: Mon, 04 Sep 2000 10:40:11 GMT
From: ishulz@lycosmail.com
Subject: RE: Help !!! (HPUX11+Oracle8+DBD)
Message-Id: <8ovu6a$gpf$1@nnrp1.deja.com>

Thanks to ALL

I suspected that Oracle was installed not enough correclty.

Having Oracle reinstalled, DBD was compiled and tested ok

and I like it!!!


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Mon, 04 Sep 2000 10:06:47 GMT
From: natsurfer@my-deja.com
Subject: Re: HELP with WWWBoard Script
Message-Id: <8ovs7h$eu1$1@nnrp1.deja.com>

Hey Thanks a Lot !! This works :)
Maybe you can help me with this too: How can I implement the following
code aswell?

link="#F1D256" bgproperties="fixed" style="font-family: Tempus Sans
ITC; color: #F1D256"

Thanks !!
Marc

<style TYPE="text/css">
BODY {background-image: url(Background.jpg); background-position: -
120px -83px; background-attachment: fixed; }
</style>

In article <8ovq54$cqu$1@nnrp1.deja.com>,
  Mark <mtaylorlrim@my-deja.com> wrote:
> Edit print NEWFILE "  <body>\n";
> to:
> print NEWFILE "  <body
> background=\"http://domain.com/path/to/image.gif\">\n";
>
> Mark
>
> In article <8ovpjt$c8k$1@nnrp1.deja.com>,
>   natsurfer@my-deja.com wrote:
> > Hi folks,
> > I'm running a WWWBoard script on my Site. Every time a visitor
posts a
> > message the script writes it in a new file and saves it in messages
> > directory. What do I have to change in the newfile subroutine
(below)
> > to make the script use my Background image and font style/size/color
> > for these automatically generated pages??
> >
> > Part of the Script:
> >
> > #####################
> > # New File Subroutine
> >
> > sub new_file {
> >
> >    open(NEWFILE,">$basedir/$mesgdir/$num\.$ext") || die $!;
> >    print NEWFILE "<html>\n";
> >    print NEWFILE "  <head>\n";
> >    print NEWFILE "    <title>$subject</title>\n";
> >    print NEWFILE "  </head>\n";
> >    print NEWFILE "  <body>\n";
> >    print NEWFILE "    <center>\n";
> >    print NEWFILE "      <h1>$subject</h1>\n";
> >    print NEWFILE "    </center>\n";
> >    print NEWFILE "<hr size=7 width=75%>\n";
> >    if ($show_faq == 1) {
> >
> > Any help will be appreciated
> > Thanks a lot!
> > Marc
> >
> > btw: the WWWBoard can be found at www.natalie-imbruglia.ch
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
> >
>
> --
> Please reply to this newsgroup as my Deja mail
> is used as a spam catcher only!
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Mon, 4 Sep 2000 14:23:28 +0200
From: "Lincoln Marr" <lincolnmarr@nospam.europem01.nt.com>
Subject: Re: HELP with WWWBoard Script
Message-Id: <8p047j$cqs$1@qnsgh006.europe.nortel.com>


<natsurfer@my-deja.com> wrote in message news:8ovs7h$eu1$1@nnrp1.deja.com...
> Hey Thanks a Lot !! This works :)
> Maybe you can help me with this too: How can I implement the following
> code aswell?
>
> link="#F1D256" bgproperties="fixed" style="font-family: Tempus Sans
> ITC; color: #F1D256"
>
> Thanks !!
> Marc
>
This is a html question. Post it to a html group




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

Date: Mon, 04 Sep 2000 14:34:22 GMT
From: Mark <mtaylorlrim@my-deja.com>
Subject: Re: HELP with WWWBoard Script
Message-Id: <8p0btd$uqn$1@nnrp1.deja.com>

Put it right after the background code as well, just preface the quotes
and # with a backslash.

print NEWFILE "  <body
background=\"http://domain.com/path/to/image.gif\" link=\"\#F1D256\"
bgproperties=\"fixed\" style=\"font-family: Tempus Sans ITC; color:
\#F1D256\">\n";

Although not sure about the style code...

Mark


In article <8ovs7h$eu1$1@nnrp1.deja.com>,
  natsurfer@my-deja.com wrote:
> Hey Thanks a Lot !! This works :)
> Maybe you can help me with this too: How can I implement the following
> code aswell?
>
> link="#F1D256" bgproperties="fixed" style="font-family: Tempus Sans
> ITC; color: #F1D256"
>
> Thanks !!
> Marc
>
> <style TYPE="text/css">
> BODY {background-image: url(Background.jpg); background-position: -
> 120px -83px; background-attachment: fixed; }
> </style>
>
> In article <8ovq54$cqu$1@nnrp1.deja.com>,
>   Mark <mtaylorlrim@my-deja.com> wrote:
> > Edit print NEWFILE "  <body>\n";
> > to:
> > print NEWFILE "  <body
> > background=\"http://domain.com/path/to/image.gif\">\n";
> >
> > Mark
> >
> > In article <8ovpjt$c8k$1@nnrp1.deja.com>,
> >   natsurfer@my-deja.com wrote:
> > > Hi folks,
> > > I'm running a WWWBoard script on my Site. Every time a visitor
> posts a
> > > message the script writes it in a new file and saves it in
messages
> > > directory. What do I have to change in the newfile subroutine
> (below)
> > > to make the script use my Background image and font
style/size/color
> > > for these automatically generated pages??
> > >
> > > Part of the Script:
> > >
> > > #####################
> > > # New File Subroutine
> > >
> > > sub new_file {
> > >
> > >    open(NEWFILE,">$basedir/$mesgdir/$num\.$ext") || die $!;
> > >    print NEWFILE "<html>\n";
> > >    print NEWFILE "  <head>\n";
> > >    print NEWFILE "    <title>$subject</title>\n";
> > >    print NEWFILE "  </head>\n";
> > >    print NEWFILE "  <body>\n";
> > >    print NEWFILE "    <center>\n";
> > >    print NEWFILE "      <h1>$subject</h1>\n";
> > >    print NEWFILE "    </center>\n";
> > >    print NEWFILE "<hr size=7 width=75%>\n";
> > >    if ($show_faq == 1) {
> > >
> > > Any help will be appreciated
> > > Thanks a lot!
> > > Marc
> > >
> > > btw: the WWWBoard can be found at www.natalie-imbruglia.ch
> > >
> > > Sent via Deja.com http://www.deja.com/
> > > Before you buy.
> > >
> >
> > --
> > Please reply to this newsgroup as my Deja mail
> > is used as a spam catcher only!
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
> >
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>

--
Please reply to this newsgroup as my Deja mail
is used as a spam catcher only!


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Mon, 4 Sep 2000 12:03:53 +0200
From: "Lincoln Marr" <lincolnmarr@nospam.europem01.nt.com>
Subject: How to copy directory tree
Message-Id: <8ovs1u$8r7$1@qnsgh006.europe.nortel.com>

Hi,

I've had a look in the perldocs and deja to see how I can do this, but i
can't find anything. So could somebody tell me how to copy an entire
directory structure and all the files in it to another directory?
I looked at File::Path and File::Copy but all I understood was moving and
removing directories, not making copies of them or renaming them.

Thanks,

--Lincoln




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

Date: Mon, 4 Sep 2000 06:02:20 -0400
From: "Bryan McAvoy" <gustfrnt@globalvision.net>
Subject: Re: How to truncate file after nth occurrence of string
Message-Id: <sr6ss29oa6e137@corp.supernews.com>


"Godzilla!" <godzilla@stomp.stomp.tokyo> wrote in message
news:39B2B1C8.22DA1BE1@stomp.stomp.tokyo...
> Bryan McAvoy wrote:
>
> > Ouch. Well, thanks for setting me straight on how to ask the question.
> > I guess what I asked didn't make a lot of sense. Anyway, let's try
> > this again.
>
> Clarity in communication is critical, especially when
> engaging an English teacher, such as myself, in dialog.
>
>
> > Here is a snippet of the log file from which I wish to grab
> > the 5 most recent products.
>
> > Products are appended to the beginning of the file

[snipped remaining, though I hardly feel worthy of so doing]

Arigato gozaimasu Godzilla, and to all the others who have replied. There
really is more than one way to do it in perl. It almost looks like a room
full of monkeys with 100 copies emacs could have pounded it out in a day or
two. Me no, monkeys yes. Oh well. The use of the $/ almost makes life too
easy. I can see that I will employ this often in the future. For now I did
take the quick and dirty route (as q&d as use strict will allow) which was
basically 0) set counter 1) read file 2) iterate for each '$$' 3) copy to
the output file 4) end at the 5th '$$'.

I really like the output of your script Dr. Schilitubi. I can see this is
where I'll take this once I get past the "proof of concept" stage, (oh, ok,
and once I figure it out completely).

Thanks again,

Bryan




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

Date: Mon, 04 Sep 2000 14:23:15 +0100
From: Tim Cockle <T.Cockle@staffs.ac.uk>
Subject: HTML::parse bug
Message-Id: <39B3A243.7B9A19EE@staffs.ac.uk>

Hi,

I have found a bug somwwhere in HTML::parse. I have written a simple
server wich works fine. However if I convert it into a forking server it
crashes out.

Does this sound fermular to anyone?

If no one has seen this problem don't worry. I going to restart my
investigation into the bug so will be able to proved a much better
description shortly.

I have just comeback from holiday and so am a lttle lost right now and
thought I would just try this as a quick check... well you never know
your luck!!!

Tim



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

Date: Mon, 04 Sep 2000 13:44:10 GMT
From: jonaskuh@tell-em-off.com (Jonaskuh)
Subject: Re: Inserting todays date
Message-Id: <39b3a58e.3148156@news.coastalnet.com>

Easy, just do the following:

$datetime = localtime(time);

Then you can just print the $datetime var, it will give you an output
like this:

Mon Sep  4 09:40:25 2000

you can also do the same with the `date` function, but it needs to be
assigned to a variable too.

$datetime = `date`

It will give you an output like this when you print it:

Mon Sep  4 09:41:06 EDT 2000

Only difference is the timezone, I prefer the first because you're not
actually running any programs, although it does leave out the
TimeZone, but you should know what timezone you're server is set for.

Jonaskuh

On Mon, 04 Sep 2000 09:47:27 GMT, appsman1368@my-deja.com wrote:

>I use Perls FORMAT facility to produce formatted hard-copy reports from
>a database output file - with excellent results.
>
>However, I now need to be able to print these reports to include
>'todays' date.  I have tried using `date` but to no avail.  Has anyone
>got any ideas please??
>
>Thanks in advance
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.



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

Date: Mon, 04 Sep 2000 14:11:33 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Inserting todays date
Message-Id: <9bb7rsoo759gn5sl5b9ftil9g3gigoakqm@4ax.com>

appsman1368@my-deja.com wrote:

>However, I now need to be able to print these reports to include
>'todays' date.  I have tried using `date` but to no avail.  Has anyone
>got any ideas please??

	scalar localtime

Just extract the bits that you need from this string.

-- 
	Bart.


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

Date: Mon, 04 Sep 2000 11:07:36 GMT
From: richard_dobson@my-deja.com
Subject: intranet using perl cgi
Message-Id: <8ovvpj$iea$1@nnrp1.deja.com>

Please could someone give me some ideas? I have to come up with some
good ideas for a research companies intranet. They would like it to
become a vital information resource for the workers, and an invaluable
forum for information interchange. All I can think of really is using
a bulletin board or chatgroup/newsgroup kind of setup.
Are there any perl cgi scripts around for this, or does anyone have any
impressive ideas for an intranet, using perl maybe?

thanks
Rich


Sent via Deja.com http://www.deja.com/
Before you buy.


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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

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


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


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