[16929] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4341 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 16 09:05:35 2000

Date: Sat, 16 Sep 2000 06:05:11 -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: <969109511-v9-i4341@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 16 Sep 2000     Volume: 9 Number: 4341

Today's topics:
    Re: [Newbie]File::Find question <gellyfish@gellyfish.com>
        [Perl] How to find the Perl FAQ <rootbeer&pfaq*finding*@redcat.com>
        Attachments in email sent using Perl (Msoni23)
    Re: Attachments in email sent using Perl (Abigail)
    Re: Attachments in email sent using Perl (Gwyn Judd)
    Re: can i run a cgi script within javascript tag? <georgegg@magnolia.net>
    Re: can i run a cgi script within javascript tag? <klidge@mailbox.gr>
        Check DIR? <brian@ukdj.freeserve.co.uk>
    Re: Check DIR? <philipg@atl.mediaone.net>
    Re: Compiling SSLeay on RedHat ? <gellyfish@gellyfish.com>
    Re: Copying Files <patrickjos@hotmail.com>
    Re: Easy question, I think (Abigail)
    Re: Error message (Abigail)
        Free for all script help (lawrence)
    Re: Getting File stats on a remote file <gellyfish@gellyfish.com>
    Re: how could I get a file by http path? (Abigail)
        how to insert an HTML page into another perl generated  <d@i.am>
        open(FNAME...) versus FileHandle <bcaligari@my-deja.com>
        Pass parameter to Perl CGI using SSI (Bryan Jensen)
    Re: Pass parameter to Perl CGI using SSI <flavell@mail.cern.ch>
    Re: Perl and Org. Chart (Chris Fedde)
        Pipe to string <gottschl@in.tum.de>
    Re: print and CGI scripts <gellyfish@gellyfish.com>
    Re: Problem with refresh <gellyfish@gellyfish.com>
    Re: Problem with STDIN (newbie question) <gellyfish@gellyfish.com>
    Re: re: Problem running script from within a script <gellyfish@gellyfish.com>
    Re: Req.: The perfect Perl Editor? (Abigail)
    Re: Req.: The perfect Perl Editor? i0519@my-deja.com
    Re: self writing program <tony@pyxis.blackstar.co.uk>
    Re: syslog in perl (Robert Jan Schaper)
    Re: tutorial for advanced experimental regex  features? <jeffp@crusoe.net>
    Re: tutorial for advanced experimental regex  features? (Andrew Johnson)
    Re: tutorial for advanced experimental regex  features? (Abigail)
    Re: Unicode (Joe Smith)
    Re: uninitialized variables (Keith Calvert Ivey)
        Where can we get the PDK? i0519@my-deja.com
        Win32 Perl and WMI  <carvdawg@patriot.net>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 14 Sep 2000 12:48:22 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: [Newbie]File::Find question
Message-Id: <8pqdu6$mae$1@orpheus.gellyfish.com>

On 13 Sep 2000 21:20:29 GMT Steve K. Brown wrote:
> My code is:
> 
> sub wanted{
>    push @FileNames, $File::Find::name;
>    print "\$File::Find::name:  $File::Find::name\n";
>    print "\$j:  $j\n";
>    chdir $vss;
> }
> 
> for $i (values %Crc){
>    chdir $vss;
>    find(\&wanted, $i);
> }
> 
> $vss is the orginal directory
> %Crc is the list of file names
> 

Surely you want to do it the other way round :

  sub wanted 
  {
     push @filenames, $File::Find::name if exists $Crc{$_};
  }

  find \&wanted, $vss;

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


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

Date: Sat, 16 Sep 2000 10:22:17 GMT
From: Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
Subject: [Perl] How to find the Perl FAQ
Message-Id: <pfaqmessage969099845.3249@news.teleport.com>

Archive-name: perl-faq/finding-perl-faq
Posting-Frequency: weekly
Last-modified: 29 Apr 2000

[ That "Last-modified:" date above refers to this document, not to the
Perl FAQ itself! The last _major_ update of the Perl FAQ was in Summer
of 1998; of course, ongoing updates are made as needed. ]

For most people, this URL should be all you need in order to find Perl's
Frequently Asked Questions (and answers).

    http://www.cpan.org/doc/FAQs/

Please look over (but never overlook!) the FAQ and related docs before
posting anything to the comp.lang.perl.* family of newsgroups.

For an alternative way to get answers, check out the Perlfaq website.

    http://www.perlfaq.com/

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

Beginning with Perl version 5.004, the Perl distribution itself includes
the Perl FAQ. If everything is pro-Perl-y installed on your system, the
FAQ will be stored alongside the rest of Perl's documentation, and one
of these commands (or your local equivalents) should let you read the FAQ.

    perldoc perlfaq
    man perlfaq

If a recent version of Perl is not properly installed on your system,
you should ask your system administrator or local expert to help. If you
find that a recent Perl distribution is lacking the FAQ or other important
documentation, be sure to complain to that distribution's author.

If you have a web connection, the first and foremost source for all things
Perl, including the FAQ, is the Comprehensive Perl Archive Network (CPAN).
CPAN also includes the Perl source code, pre-compiled binaries for many
platforms, and a large collection of freely usable modules, among its
560_986_526 bytes (give or take a little) of super-cool (give or take
a little) Perl resources.

    http://www.cpan.org/
    http://www.perl.com/CPAN/
    http://www.cpan.org/doc/FAQs/FAQ/html/
    http://www.perl.com/CPAN/doc/FAQs/FAQ/html/

You may wish or need to access CPAN via anonymous FTP. (Within CPAN,
you will find the FAQ in the /doc/FAQs/FAQ directory. If none of these
selected FTP sites is especially good for you, a full list of CPAN sites
is in the SITES file within CPAN.)

    California     ftp://ftp.cdrom.com/pub/perl/CPAN/
    Texas          ftp://ftp.metronet.com/pub/perl/
    South Africa   ftp://ftp.is.co.za/programming/perl/CPAN/
    Japan          ftp://ftp.dti.ad.jp/pub/lang/CPAN/
    Australia      ftp://cpan.topend.com.au/pub/CPAN/
    Netherlands    ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
    Switzerland    ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
    Chile          ftp://ftp.ing.puc.cl/pub/unix/perl/CPAN/

If you have no connection to the Internet at all (so sad!) you may wish
to purchase one of the commercial Perl distributions on CD-Rom or other
media. Your local bookstore should be able to help you to find one.

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

Comments and suggestions on the contents of this document
are always welcome. Please send them to the author at
<pfaq&finding*comments*@redcat.com>. Of course, comments on
the docs and FAQs mentioned here should go to their respective
maintainers.

Have fun with Perl!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/


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

Date: 16 Sep 2000 05:27:43 GMT
From: msoni23@aol.com (Msoni23)
Subject: Attachments in email sent using Perl
Message-Id: <20000916012743.09099.00000067@ng-da1.aol.com>

Hi!

I need to send email with attachments to a list of recipients. I know how to
send simple text messages using perl but I have not clue how can I use Perl to
send emails that also have attachments. The attachments will be files picked
from the local directories.

Can someone help...

Thanks.

Maneesh (maneeshsoni@hotmail.com)


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

Date: 16 Sep 2000 06:32:40 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Attachments in email sent using Perl
Message-Id: <slrn8s64u6.4mc.abigail@alexandra.foad.org>

Msoni23 (msoni23@aol.com) wrote on MMDLXXIII September MCMXCIII in
<URL:news:20000916012743.09099.00000067@ng-da1.aol.com>:
## 
## I need to send email with attachments to a list of recipients. I know how to
## send simple text messages using perl but I have not clue how can I use Perl t
## send emails that also have attachments. The attachments will be files picked
## from the local directories.


Did you bother looking at CPAN to see someone created some ready 
to use code?



Abigail
-- 
perl -we 'print q{print q{print q{print q{print q{print q{print q{print q{print 
               qq{Just Another Perl Hacker\n}}}}}}}}}'    |\
perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w


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

Date: Sat, 16 Sep 2000 12:03:42 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Attachments in email sent using Perl
Message-Id: <slrn8s6ojt.3ij.tjla@thislove.dyndns.org>

I was shocked! How could Msoni23 <msoni23@aol.com>
say such a terrible thing:
>Hi!
>
>I need to send email with attachments to a list of recipients. I know how to
>send simple text messages using perl but I have not clue how can I use Perl to
>send emails that also have attachments. The attachments will be files picked
>from the local directories.
>
>Can someone help...

You want to use the MIME::Lite module.

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Nobody expects the Spanish Inquisition!


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

Date: Sat, 16 Sep 2000 05:30:43 GMT
From: GGScript.Com <georgegg@magnolia.net>
Subject: Re: can i run a cgi script within javascript tag?
Message-Id: <8pv0i4$p0r$1@nnrp1.deja.com>

In article <8prduu$cn2$1@ulysses.noc.ntua.gr>,
  "klidge" <klidge@mailbox.gr> wrote:
> I would like to ask you if it's possible for a cgi script written in
perl
> to run from within a javascript script
> example:
> Html source:
> <script language="javascript">
> --the code i need here---
> </script>
> In order for the "result" after accessing the page would be the same
as the
> htm source was:
> <script language="javascript">
> document.write('this line has been generated from a cgi perl script');
> </script>
>
> thank you in advance

Check:
http://www.canufly.net/~georgegg/call-js.htm

Access's a server cgi "jscalled.cgi" that returns a variable
back to the client as a JavaScript variable.

Perl cgi as text file:
http://www.canufly.net/~georgegg/jscalled.txt

George Girard, Programmer/FiddlerArounder, georgegg@magnolia.net
You See All.. You Show All.. You Use GGScript.. http://www.ggscript.com


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


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

Date: Sat, 16 Sep 2000 11:28:37 +0300
From: "klidge" <klidge@mailbox.gr>
Subject: Re: can i run a cgi script within javascript tag?
Message-Id: <8pvatn$bu1$1@ulysses.noc.ntua.gr>

this is EXACTLY what i tried yesterday,
it seems that re Content-type string made the difference
but well...virtualave.net adds its own code to the end of the .cgi as one
access it(that is -> banner code)
screwing up the code.Anyway,at least I tried :)

Thanks guys for your help,
you've been very helpful

klidge

GGScript.Com <georgegg@magnolia.net> wrote in message
news:8pv0i4$p0r$1@nnrp1.deja.com...
> In article <8prduu$cn2$1@ulysses.noc.ntua.gr>,
>   "klidge" <klidge@mailbox.gr> wrote:
> > I would like to ask you if it's possible for a cgi script written in
> perl
> > to run from within a javascript script
> > example:
> > Html source:
> > <script language="javascript">
> > --the code i need here---
> > </script>
> > In order for the "result" after accessing the page would be the same
> as the
> > htm source was:
> > <script language="javascript">
> > document.write('this line has been generated from a cgi perl script');
> > </script>
> >
> > thank you in advance
>
> Check:
> http://www.canufly.net/~georgegg/call-js.htm
>
> Access's a server cgi "jscalled.cgi" that returns a variable
> back to the client as a JavaScript variable.
>
> Perl cgi as text file:
> http://www.canufly.net/~georgegg/jscalled.txt
>
> George Girard, Programmer/FiddlerArounder, georgegg@magnolia.net
> You See All.. You Show All.. You Use GGScript.. http://www.ggscript.com
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.




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

Date: Sat, 16 Sep 2000 05:07:53 +0100
From: "Brian" <brian@ukdj.freeserve.co.uk>
Subject: Check DIR?
Message-Id: <8pus46$nln$1@news8.svr.pol.co.uk>

Hi All

I am trying to find our if a directory exists or not. below is the code but
doesn't work, any ideas?

opendir (DIR,"photos/$dirname");
   print "The DIR is photos/$dirname<BR>";
   if (DIR) {
    print "It's There";
    $dirset=1
   }
   else {
    print "OH God, who stole it?";
    $dirset=0
   }

Oh and thanks to all who helped me out on the posting 'Why Don't this work'
on the 12/09/00 :)

Brian








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

Date: Sat, 16 Sep 2000 06:33:33 GMT
From: "Philip Garrett" <philipg@atl.mediaone.net>
Subject: Re: Check DIR?
Message-Id: <1vEw5.3124$jC4.785113@typhoon.southeast.rr.com>

Brian <brian@ukdj.freeserve.co.uk> wrote in message
news:8pus46$nln$1@news8.svr.pol.co.uk...
> Hi All
>
> I am trying to find our if a directory exists or not. below is the code
but
> doesn't work, any ideas?
>
> opendir (DIR,"photos/$dirname");
>    print "The DIR is photos/$dirname<BR>";
>    if (DIR) {
>     print "It's There";
>     $dirset=1
>    }
>    else {
>     print "OH God, who stole it?";
>     $dirset=0
>    }

You're making this much too hard.  All you need is the -d function.

$dirset = -d "photos/$dirname";

For more info, try 'perldoc perlfunc', and look for the heading "-X EXPR"

hth,
Philip




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

Date: 14 Sep 2000 11:13:27 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Compiling SSLeay on RedHat ?
Message-Id: <8pq8c7$m1n$1@orpheus.gellyfish.com>

On Thu, 14 Sep 2000 10:29:12 +0200 Thomas Fahle wrote:
> Hello all,
> 
> 
> SSLeay compiles well but
> /usr/local/src/SSLeay 0.9b/perl/ not.
> 
> make returns the following error messages
> bio.xs: In function `p5_bio_callback':
> bio.xs:36: `sv_undef' undeclared (first use in this function)
> bio.xs: In function `XS_SSLeay__BIO_new':
> bio.xs:140: `na' undeclared (first use in this function)
> ...
> make: *** [bio.o] Error 1
> 

run Makefile.PL with POLLUTE=1 and then everything will be fine.

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


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

Date: Fri, 15 Sep 2000 21:03:49 -0700
From: Patrick Connolly <patrickjos@hotmail.com>
Subject: Re: Copying Files
Message-Id: <39C2F124.A481C65F@hotmail.com>

Lauren,
    Well, I'm not in front of an NT box right now, but I believe I tried
that one and there is no such option.  But thanks anyway !   It's hard to
believe that such a simple task should be difficult in perl, isn't it?

Patrick

gtown97@my-deja.com wrote:

> In article <39C2DBBF.A7D3A993@hotmail.com>,
>   Patrick Connolly <patrickjos@hotmail.com> wrote:
> >
> > I'm trying to develop a perlscript to copy files (on windows nt)  from
> > one directory to another.  The simple requirements are:
> > 1.  The timestamp of the file must NOT be modified.
> > 2.  There must be no "noise" output to the screen.
> > 3.  There should be a way to verify that the copy was successful.
> >
> > The problem:
> > 1. I've tried the copy() function from File::Copy module. On windows
> > NT,  it modifies the timestamp to current time.
> > 2. I've tried using  system("copy sourcefile destfile")  but it prints
> > out noise to the screen for every file it copies.
>
> If it's just a matter of copying files on NT, you may want to see NT's
> copy documentation.  It's probably got something in there about making
> it silent.
>
> copy /?
>
> Lauren
> --
> Call today for your copy of my latest book, "Giving off-topic answers".
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.



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

Date: 16 Sep 2000 06:29:08 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Easy question, I think
Message-Id: <slrn8s64ni.4mc.abigail@alexandra.foad.org>

James (jluongo@mediaone.net) wrote on MMDLXIX September MCMXCIII in
<URL:news:39BD925A.C32A4C47@mediaone.net>:
:: Hmm, I cannot seem to figure this out.  I'm a little new with Perl.  Say
:: you had a string that contained a sentence.
:: eg "This line is a sentence"
:: What would be the regular expression to search and replace the first
:: letter of each work with a capital so the sentence would now be:
:: "This Line Is A Sentence"  ??


If you think it's an easy question, perhaps someone asked it before.
Perhaps it's even frequently asked.

Perhaps you should look at the documents discussing such questions.



Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
#    A raven flying
#    away. A Bard dying near
#    a rose bush. Mumon.


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

Date: 16 Sep 2000 06:31:46 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Error message
Message-Id: <slrn8s64sh.4mc.abigail@alexandra.foad.org>

Abel Almazan (abel@inlander.es) wrote on MMDLXIX September MCMXCIII in
<URL:news:39BDDC36.E487CA61@inlander.es>:
[] 
[] 
[] But when i execute the perl script, i get the next error message:
[]
[]   <<SNIP>>
[] 
[] What happens??


What did the manual say?



Abigail
-- 
perl -wle'print"Κυστ αξοτθες Πεςμ Θαγλες"^"\x80"x24'
#    A duck flies away
#    from a monastry. Tor Kin
#    Tun laughing. A fly.


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

Date: Sat, 16 Sep 2000 11:54:34 GMT
From: lawrencedeans@NoSpaM.genie.co.uk (lawrence)
Subject: Free for all script help
Message-Id: <39c35f35.7883630@news.freeserve.net>

Hi
I'm having a couple of problems trying to set up a modified Matt
Wright's perl script. I have the HTM file uploaded to
http://www.flytyer.free4all.co.uk/links/links.htm
and the script is in the cgi-bin.
The form works and the script is running as the correct error pages
appear when you do not enter data. However the script is not adding
the form data to the links.htm file. The script runs okay then returns
to the htm page with no server errors but missing the new URL etc. 
I have saved the script as a UNIX file and chmod to 755 both the
script and the htm file and a database.txt file which is supposed to
be written to also.
My hunch is that it is the paths to these files but I can't figure it
out. The paths and variables used are below if anyone has any ideas
please let me know. I have tried with and without the first slash.

# Define Variables

$filename = "links/links.htm";
$linksurl = "http://www.flytyer.free4all.co.uk/links/links.htm";
$linkscgi = "http://www.flytyer.free4all.co.uk/cgi-bin/links.cgi";
$linkstitle = "Fishing On The Fly: Free For All Links Page";
$database = "links/database.txt";

# Done

PS I can run the same script, with no problems, on my local PC. I have
to modify the above paths to my c: drive but it works fine, so the
main script code is okay. It has to be the path or something similar
:-(
Thanks in advance 
Lawrence
-- 
http://www.f-deans.freeserve.co.uk
http://www.flytyer.co.uk


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

Date: 14 Sep 2000 11:22:29 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Getting File stats on a remote file
Message-Id: <8pq8t5$m3v$1@orpheus.gellyfish.com>

On 14 Sep 2000 04:17:27 GMT Haazi2 wrote:
> I'm accessing audio files on a remote server and I need to retrieve the last
> modified time of these files. How can I do this in Perl. Can I use File::stat
> on files located on a remote server? 

If the filesystem on which those files reside is mounted by your local
machine by NFS or CIFS or similar then yes, but if you are accessing them
by HTTP or FTP or something like that then no - you will need to use the
methods provided by the protocol (if any ) to determine information from the
file.

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


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

Date: 16 Sep 2000 04:37:24 GMT
From: abigail@foad.org (Abigail)
Subject: Re: how could I get a file by http path?
Message-Id: <slrn8s5u62.4mc.abigail@alexandra.foad.org>

Lucas Tsoi (lucas@cplhk.com) wrote on MMDLXXIII September MCMXCIII in
<URL:news:8pung7$qpo2@imsp212.netvigator.com>:
~~ Hi how could I get a image file that by direct
~~ http path liked http://www.domain.com/image.gif ?


What do you mean? 



Abigail
-- 
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))


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

Date: Sat, 16 Sep 2000 14:26:59 +0700
From: "Dimitri" <d@i.am>
Subject: how to insert an HTML page into another perl generated HTML page
Message-Id: <8pv7l7$e6e$1@news.asiaaccess.net.th>

How to insert an HTML page into another perl generated HTML page ?
I think I need to remove what is not in the <body> of the page first?
How to do?  (Beginner) Thank you.  Dimitri.




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

Date: Sat, 16 Sep 2000 11:25:15 GMT
From: Brendon Caligari <bcaligari@my-deja.com>
Subject: open(FNAME...) versus FileHandle
Message-Id: <8pvlaj$ekl$1@nnrp1.deja.com>



so far, for source code manageability, I've been localising file
handles in subroutines.

what is the recommended practice?  To keep on doing so, or
"use FileHandle"?

Brendon
++++


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


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

Date: 16 Sep 2000 06:07:16 GMT
From: blj@xmission.MOC (Bryan Jensen)
Subject: Pass parameter to Perl CGI using SSI
Message-Id: <8pv2mk$9hu$1@news.xmission.com>

I'm trying to pass a parameter from HTML code using SSI (Apache) to a perl CGI 
script.  Here's what I initially thought would work:

(HTML file)
<!--#exec cgi="perlscript.cgi?param_to_pass" -->

Perl Script, perlscript.cgi:
$param = $ENV{'QUERY_STRING'};
print $param;
 ...etc...

Apparently SSI won't let you supply a '?' in the SSI entry in the HTML file 
(you get an ERROR PROCESSING REQUEST)  What am I doing wrong?  Should I use 
SSI #set? If so, how?

Thanks
Bryan
blj@xmission.com

Please email me your response, if possible.



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

Date: Sat, 16 Sep 2000 14:03:04 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Pass parameter to Perl CGI using SSI
Message-Id: <Pine.GHP.4.21.0009161357010.22343-100000@hpplus03.cern.ch>


[f'up temporarily overridden, and set to what seems to be the relevant
servers group]

On 16 Sep 2000, Tony L. Svanstrom wrote:

[about an Apache question involving that old chestnut:]

> : <!--#exec cgi="perlscript.cgi?param_to_pass" -->

> You should have asked this in comp.infosystems.www.authoring.cgi, it is
> considered to be off-topic in c.l.p.misc

Agreed with the latter, but SSI is not an interworking specification,
and the relevance to CGI is somewhat tenuous.  Questions about SSI
should be addressed by consulting the documentation for the specific
server being used, since they differ significantly from one to
another.

I would recommend the questioner to read their Apache documentation,
where this point is clearly addressed.  The question is also
frequently asked and answered, which makes me think they didn't bother
to check with a usenet archive either.



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

Date: Sat, 16 Sep 2000 06:02:05 GMT
From: cfedde@u.i.sl3d.com (Chris Fedde)
Subject: Re: Perl and Org. Chart
Message-Id: <x1Ew5.184$W3.171026944@news.frii.net>

In article <8puae2$1cm$1@nnrp1.deja.com>,  <dougawells@my-deja.com> wrote:
>Has anyone ever created an org chart either with PERL or a compatible
>3rd party program  which could read directly out of a database, maybe
>with a PERL front end? Trying to create a complex org chart using HTML
>tables is not pleasant, nor does it look too hot.
>
>Any ideas would be appreciated.
>
>Thanks
>
>

There is a tool called GraphVis that is available from
http://www.research.att.com/sw/tools/graphviz/ .  It is not a perl
module but is a "little language" for drawing graphs,
trees and such.  It'd be pretty easy to get Perl to read the database
and translate the relations there into input for graphvis.

good luck
chris
-- 
    This space intentionally left blank


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

Date: Sat, 16 Sep 2000 14:52:59 +0200
From: Heiko Gottschling <gottschl@in.tum.de>
Subject: Pipe to string
Message-Id: <39C36D2B.B859F962@in.tum.de>

Hi,

is there an easy way to establish a pipe to a string, like StringWriter
in Java?

What I want is something like this:

open STRING, "| ?? don't know?";
print STRING "This will be the content of the string";
$content = <STRING>;
close STRING;

(Please don't take this code fragment too literally. What I want is a
filehandle to which I can "print" like usual, but the output is not to
go to a file but to a string)

thx
Heiko


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

Date: 14 Sep 2000 11:35:22 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: print and CGI scripts
Message-Id: <8pq9la$m4s$1@orpheus.gellyfish.com>

On Thu, 14 Sep 2000 15:31:09 +1000 Dave O'Brien wrote:
> 
> I am writing a CGI script that takes some user settings, and then then
> processes, and creates some new files.
> 

<snip>

> 
> As you can see, very simple.  All I want to do, is temporarily redirect
> print statements back to the terminal, and not the browser.
> 

open(CONSOLE,'>/dev/console') || die "Whoah - can't open Console - $!\n";
select CONSOLE;

# print now goes to /dev/console

select STDOUT;

# print now goes to wherever STDOUT was going before

Of course your 'terminal' might not be /dev/console but we can't help you
determine that.

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


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

Date: 14 Sep 2000 11:36:22 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Problem with refresh
Message-Id: <8pq9n6$m4v$1@orpheus.gellyfish.com>

On Thu, 14 Sep 2000 10:42:19 +0100 Tom Fotheringham wrote:
> If I make a from, the user enters the data, then if they keep refreshing
> the page created by the script that accepts the form, it keeps
> re-entering the form.
> 
> How can I redirect the user to a different page after the data has been
> accepted?
> 

With a redirection - I would ask in comp.infosystems.www.authoring.cgi

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


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

Date: 14 Sep 2000 12:28:16 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Problem with STDIN (newbie question)
Message-Id: <8pqcog$m8i$1@orpheus.gellyfish.com>

On Wed, 13 Sep 2000 20:20:43 -0700 kk wrote:
> I can't get it to run in Linux with this command: ./test1.pl   nor can I get
> it to run under either of my two windows machines using Perl Builder 2.0. I
> wonder if it's a problem with my machines.
> Here's the error report from Perl Builder:
> Global symbol "$name" requires explicit package name at 1.pl line 3.
> Global symbol "$name" requires explicit package name at 1.pl line 4.
> Global symbol "$name" requires explicit package name at 1.pl line 5.
> Execution of 1.pl aborted due to compilation errors.
> 

These messages are explained in the perldiag manpage.  In this case it
is simply because you put in 'use strict;' and need to either give
an explicit package name as the message says (i.e. $main::name ) or give
the variable lexical scope with 'my' i.e make the line :

  $name = <STDIN>;

be

  my $name = <STDIN>;

I have a gut feeling that running the program under 'Perl Builder' 
(whatever that might be) might be the cause of your earlier problem as
in my experience these things tend to monkey with STDIN in unknown ways.

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


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

Date: 14 Sep 2000 12:32:38 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: re: Problem running script from within a script
Message-Id: <8pqd0m$m8v$1@orpheus.gellyfish.com>

On Wed, 13 Sep 2000 16:42:44 +0100 John Plaxton wrote:
> Hi there, this newby needs help!
> 
> I'm trying to open a script i.e. 'test.cgi' from within another script. How
> is it done.
> 
> 
> I'm using cgi.pm
> 
> I've tried :
> $foo->redirect('http://www.thisdontwork.com/cgi-bin/test.cgi'); which gives
> a blank screen
> 

You need to print that.

print $foo->redirect('http://www.thisdontwork.com/cgi-bin/test.cgi');

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


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

Date: 16 Sep 2000 04:31:49 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Req.: The perfect Perl Editor?
Message-Id: <slrn8s5tri.4mc.abigail@alexandra.foad.org>

Mark-Jason Dominus (mjd@plover.com) wrote on MMDLXXI September MCMXCIII
in <URL:news:39c139f5.4036$1d@news.op.net>:
;; In article <slrn8s0tfu.4t8.tim@degree.ath.cx>,
;; Tim Hammerquist <tim@degree.ath.cx> wrote:
;; >	pico
;; 
;; I find pico impossible because it doesn't do line numbering.  When the
;; compiler says you have an error on line 57, you have to count 57 lines
;; down manually. 


This is a good reason to put everything on one line.



Abigail
-- 
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");


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

Date: Sat, 16 Sep 2000 05:01:11 GMT
From: i0519@my-deja.com
Subject: Re: Req.: The perfect Perl Editor?
Message-Id: <8puuqh$nd9$1@nnrp1.deja.com>

I believe that the Ultraedit is a good tool

In article <slrn8s5tri.4mc.abigail@alexandra.foad.org>,
  abigail@foad.org wrote:
> Mark-Jason Dominus (mjd@plover.com) wrote on MMDLXXI September
MCMXCIII
> in <URL:news:39c139f5.4036$1d@news.op.net>:
> ;; In article <slrn8s0tfu.4t8.tim@degree.ath.cx>,
> ;; Tim Hammerquist <tim@degree.ath.cx> wrote:
> ;; >	pico
> ;;
> ;; I find pico impossible because it doesn't do line numbering.  When
the
> ;; compiler says you have an error on line 57, you have to count 57
lines
> ;; down manually.
>
> This is a good reason to put everything on one line.
>
> Abigail
> --
> sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}
n2o}00}t324i;
> h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]
&@a5`"':&^;&^,*&^$43##@@####;
> c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.
{{],,,1278@#@);
> print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)
&&$llama."\n");
>


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


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

Date: Sat, 16 Sep 2000 11:19:53 GMT
From: Tony Bowden <tony@pyxis.blackstar.co.uk>
Subject: Re: self writing program
Message-Id: <tHIw5.1036$6T1.9595@news2-win.server.ntlworld.com>

Marcel Grunauer <marcel@codewerk.com> wrote:
>>I wanted to write a program in perl that when invoked
>>prints out a copy of exactly itself.

>     open+0;print<0>

I know it wasn't in the OP's spec, but any time I've encountered
this problem it was either prohibited, or considered bad form,
for the program to examine its own source ...

Tony
-- 
-----------------------------------------------------------------------------
 Tony Bowden | Belfast, NI | tb@tmtm.com | www.tmtm.com | www.blackstar.co.uk
 whatever we lose(like a you or a me)it's always ourselves we find in the sea 
-----------------------------------------------------------------------------


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

Date: 16 Sep 2000 12:56:28 GMT
From: r.schaper@chello.nl (Robert Jan Schaper)
Subject: Re: syslog in perl
Message-Id: <slrn8s6166.13g.r.schaper@sun-tzu.notstok.com>

On Fri, 15 Sep 2000 22:49:43 GMT, Dave Sherohman <esper@news.visi.com> wrote:
>Any suggestions as to why this code doesn't produce anything in my logs?  The
>system in question is running Debian Linux with their latest perl-5.005
>package installed.

Try to set the to unix instead of the default inet:

	Sys::Syslog::setlogsock('unix'); 




>
>---
>  sub create_account {
>    use Sys::Syslog;
>
>    my ($acct_name, $acct_pass);
>
>    openlog($appname, 'cons,pid', 'user');
>    #openlog($appname, 'pid', 'authpriv');
>    while ($#_ > 0) {
>      $acct_name = shift;
>      $acct_pass = shift;
>
>      if (defined getpwnam($acct_name)) {
>        my $new_name = generate_name($acct_name);
>        print "$acct_name exists.  Try $new_name?\r\n";
>      } else {
>        my $message = "Would create user $acct_name, password $acct_pass\r\n";
>        print $message;
>        syslog('info', $message);
>        #syslog('notice', $message);
>      }
>    }
>    closelog();
>  }
>---
>
>If I send a batch of three user/password pairs into this sub, the second
>appears on an xconsole, but the other two do not.  All three appear on
>STDOUT.
>
>I also have
>---
># Log everything on tty9
>*.*                     /dev/tty9
>---
>in /etc/syslog.conf, but nothing shows up there either.
>
>syslog.ph exists; it was installed by apt as part of the perl-5.005 package
>in /usr/lib/perl5/5.005/i386-linux/ and /usr/lib/perl5/5.005/i386-linux/sys/,
>but they don't appear to be the same - the one in sys is much larger (3574
>bytes vs. 53) than the other.
>
>I initially tried logging the messages as authpriv/notice (the lines that are
>commented out), but switched it to user/info because that's what the examples
>on the manpage use and I thought I might have just gotten the facility/
>priority strings wrong.
>
>-- 
>"Two words: Windows survives." - Craig Mundie, Microsoft senior strategist
>"So does syphillis. Good thing we have penicillin." - Matthew Alton
>Geek Code 3.1:  GCS d- s+: a- C++ UL++$ P+>+++ L+++>++++ E- W--(++) N+ o+
>!K w---$ O M- V? PS+ PE Y+ PGP t 5++ X+ R++ tv b+ DI++++ D G e* h+ r++ y+


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

Date: Sat, 16 Sep 2000 00:26:07 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: tutorial for advanced experimental regex  features?
Message-Id: <Pine.GSO.4.21.0009152355560.12100-100000@crusoe.crusoe.net>

[posted & mailed]

On Sep 16, Bart Lateur said:

>I cannot make mluch sense of the advanced experimental regex features
>that are documented in perlre: 
>
>	(?{...})

That executes Perl code in a zero-width, always-true assertion.

>	(?(cond)patyes|patno)

Two forms:

  (?(NNN)yes|no)

where NNN is a number representing a previously matched parenthesized
pattern.  Ex. $str =~ /(?:(foo)|(bar))(?(1)bar|foo)/ matches 'foobar' or
'barfoo' (in a rather obtuse sort of way).

  (?(cond)yes|no)

where cond is a look-ahead or look-behind or other zero-width
assertion.  Ex. "jeffrey" =~ /(?(?=[aeiou])(.)|(..))/ looks ahead to match
a vowel (fails, 'j' is not a vowel), so it sets $2 to "je".  The fail
pattern can be left off.  Ex. "jeffrey" =~ /(?(?=[aeiou])(.))/ does not
match.

>	(??{...})

This postpones evaluating a pattern until it gets here.  This is good for
matching recursive things.  The example in perlre about matching nested
parens is good.

>perlre is just a refrence manual, and that's precisely the problem. Does
>anybody have any idea on for example an online tutorial with lots of
>examples?

I'm planning on writing one for PerlArchive.com's Learning Center.

>The feature I'd like to implement, is executing some Perl code at
>certain times in the matching process, which would optionally make the
>regex fail and backtrack, searching for alternatives. I just don't know
>where to start. I'm not yet even convinced it can be done.

This is a kludgy hack:

  #!/usr/bin/perl -l

  $str = "ABCDEF";
  $str =~ m{
    (...)
    (??{
      eval '$i++ ? qr/(?=)/ : qr/(?!)/'
    })
  }x;
  print $1;

That prints BCD.  I don't know why I had to wrap the code inside the
(??{...}) inside an eval, but Perl wanted to dump core if I didn't.  I
don't know how to make the fail regex jump ahead the next two characters
(to make it match, and not allow backtracking, and then fail... I even
tried (?>..)(?!), but to no avail).

Like I said, it's kludgy.  And probably mostly magical.  And unstable.

-- 
Jeff "japhy" Pinyan     japhy@pobox.com     http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine            http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc.    http://www.perlarchive.com/
CPAN - #1 Perl Resource  (my id:  PINYAN)        http://search.cpan.org/



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

Date: Sat, 16 Sep 2000 04:27:04 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: tutorial for advanced experimental regex  features?
Message-Id: <sECw5.17943$a5.253215@news1.rdc1.mb.home.com>

In article <g4p5ssgk7ml4jfvljhckrhq0hlc01gdhd8@4ax.com>,
 Bart Lateur <bart.lateur@skynet.be> wrote:

! I cannot make mluch sense of the advanced experimental regex features
! that are documented in perlre:
! 
!         (?{...})
!         (?(cond)patyes|patno)
!         (??{...})
! 
! perlre is just a refrence manual, and that's precisely the problem. Does
! anybody have any idea on for example an online tutorial with lots of
! examples?

Check out Mark Kvale's regex tutorials (I think they are destined to be
part of the standard docs):

    http://keck.ucsf.edu/~kvale/perlrequick.pod
    http://keck.ucsf.edu/~kvale/perlretut.pod

I also have a POD that covers some of the same ground as Mark's
retut (that's the one that gets to advanced features). I was writing
up an intro to newer regex features for our local PM group before I
saw his docs ... otherwise I would have saved myself some work,
though I did see it in time to rework his fibonacci example:
    
    http://members.home.net/andrew-johnson/perl/regextut.pod

regards,
andrew

-- 
Andrew L. Johnson   http://members.home.net/andrew-johnson/
      I drink to make other people interesting.
          -- George Jean Nathan
      


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

Date: 16 Sep 2000 04:41:24 GMT
From: abigail@foad.org (Abigail)
Subject: Re: tutorial for advanced experimental regex  features?
Message-Id: <slrn8s5udi.4mc.abigail@alexandra.foad.org>

Bart Lateur (bart.lateur@skynet.be) wrote on MMDLXXIII September MCMXCIII
in <URL:news:g4p5ssgk7ml4jfvljhckrhq0hlc01gdhd8@4ax.com>:
!! I cannot make mluch sense of the advanced experimental regex features
!! that are documented in perlre: 
!! 
!! 	(?{...})
!! 	(?(cond)patyes|patno)
!! 	(??{...})
!! 
!! perlre is just a refrence manual, and that's precisely the problem. Does
!! anybody have any idea on for example an online tutorial with lots of
!! examples?
!! 
!! The feature I'd like to implement, is executing some Perl code at
!! certain times in the matching process, which would optionally make the
!! regex fail and backtrack, searching for alternatives. I just don't know
!! where to start. I'm not yet even convinced it can be done.


You might want to use Parse::RecDescent instead.

I recently tried using (?{ .. }) and (??{ .. }) and within a few minutes,
I stumbled upon several cases that made Perl core dump. 

I quickly went back to Parse::RecDescent. P::RD might be slow, but at
least it won't bring down perl.


Abigail
-- 
perl -we 'eval {die ["Just another Perl Hacker\n"]}; print ${$@}[$#{@${@}}]'
#    An old man near the
#    Shaolin temple. A songbird
#    nesting. A fox.


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

Date: 16 Sep 2000 08:35:15 GMT
From: inwap@best.com (Joe Smith)
Subject: Re: Unicode
Message-Id: <8pvbc3$27nf$1@nntp1.ba.best.com>

In article <8puk7u$e1t$1@nn-os105.ocn.ad.jp>,
sang <laoxiu100@hotmail.com> wrote:
>Hi,alls
>
>How can i access unicode file in Perl?

Perl version 5.6.0 can write Unicode to a file, but it currently cannot
read Unicode properly.  Wait a month or two for perl-5.6.1 to be announced.
	-Joe

--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.


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

Date: Sat, 16 Sep 2000 03:45:32 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: uninitialized variables
Message-Id: <39c2ec51.4918071@news.newsguy.com>

Larry Rosler <lr@hpl.hp.com> wrote:

>(I really would do it all in one line, with map and the -l 
>flag or local $| = "\n".)
               ^^
Lingering a little too long on the shift key.
You mean $\, of course.

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


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

Date: Sat, 16 Sep 2000 04:56:57 GMT
From: i0519@my-deja.com
Subject: Where can we get the PDK?
Message-Id: <8puuij$n3t$1@nnrp1.deja.com>

As title.


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


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

Date: Sat, 16 Sep 2000 08:41:26 -0400
From: H C <carvdawg@patriot.net>
Subject: Win32 Perl and WMI 
Message-Id: <39C36A76.F93F05D8@patriot.net>

I've been to the Win32 scripting site
http://cwashington.netreach.net/main_site/default.asp?topic=news

And there are several good WMI scripts available at the site.  Does
anyone
have a good resource that they can point me to that talks about WMI
programming
in Perl on NT/2K?

Thanks,
Carv



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

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 4341
**************************************


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