[6545] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 169 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 24 19:07:56 1997

Date: Mon, 24 Mar 97 16:00:31 -0800
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, 24 Mar 1997     Volume: 8 Number: 169

Today's topics:
     Re: -d -f options (Nicholas J. Leon)
     Re: -d -f options <rootbeer@teleport.com>
     Re: -d -f options (Nathan V. Patwardhan)
     [Q] Newbie question on getopts. <74602.3516@CompuServe.COM>
     Re: Accessing a database <dmi1@ra.msstate.edu>
     Re: ADVICE NEEDED: timelocal() prints wrong result (Michael Fuhr)
     Re: Another dereferencing bug in 5.003 ? <jhg@austx.tandem.com>
     Re: Basics <tchrist@mox.perl.com>
     Blocking specific countries (was: Question) <rootbeer@teleport.com>
     Calling Perl Script from ServerSide Java applets??????? <mshannon@lds.com>
     Can someone explain this behaviour? <anderson@necsys.gsfc.nasa.gov>
     Re: case sensativity <tchrist@mox.perl.com>
     Re: Casting in Perl <tchrist@mox.perl.com>
     chunk POST and receive with LWP or other module (Keith Dreibelbis)
     Re: Creating arrays... (Honza Pazdziora)
     Re: Creating arrays... <gabriele@clotho.com>
     Dereferencing single value using CGI gives list instead (Brian Lavender)
     Re: Executing a script??? (Geoffrey Hebert)
     File and Disk replication <fairfijr@dadeint.com>
     foreach loop and printing <kaushal@nwdc.com>
     Re: foreach loop and printing (Joel Coltoff)
     Fsdk97 Wbtest4 <cartier@montrouge.geoquest.slb.com>
     help needed connecting character strings <kscott@uab.edu>
     Re: help (Tad McClellan)
     Re: Is CGI a part of or similiar to Perl? <tchrist@mox.perl.com>
     Little beginers question <jjover@correu.andorra.ad>
     Re: Need to extract the text from Microsoft Word 6 file <vladimir@cs.ualberta.ca>
     NetWare: 'send'? (Dirk Treusch)
     New CGI column for an online magazine (Ross D. Perkins)
     Re: Open file works under DOS, not under server (Markus Laker)
     Re: perl -p changes my program in unexpected ways.  Why <tchrist@mox.perl.com>
     PERL Freelancers? (Chester Bullock)
     Re: Perl sendmail problem <rootbeer@teleport.com>
     Perl to interact like "expect" script ? <jtjioe@us.oracle.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 24 Mar 1997 20:52:23 GMT
From: nicholas@neko.binary9.net (Nicholas J. Leon)
Subject: Re: -d -f options
Message-Id: <slrn5jdqb7.3jd.nicholas@neko.binary9.net>

In article <3335B53B.16A6@blarg.net>, dinendra wrote:
>Hi,
>
>I am writing a program in which I want to open a directory and want to read in the entries and find 
>out whether it is a file or a directory. So I do the following

You are real close. The problem is that the files returned by readdir
DO NOT have the leading  "Parentdir" attached.

 ....

>
>opendir(DIRCONTENT,"$parentdir") || die "Cannot open dir $parentdir\n";	
>$dircontent= readdir(DIRCONTENT); 
>$dircontent = readdir(DIRCONTENT); #read and discard the name of directory above
>while($dircontent =  readdir(DIRCONTENT))
>{
>	if(-d $dircontent)

	if (-d "$parentdir/$dircontent")

>	{
>		print "Dir : $dircontent\n";
>	}
>	elsif (-f $dircontent)	

	elsif (-f "$parentdir/$dircontent")

>	{
>		print"File : $dircontent\n";
>	}
>}
>closedir(DIRCONTENT);
>
>
>But this doesn't seem to work. Am I not using -d and -f the right way. Any response would be 
>appreciated.
>
>Deepa Dinendra


-- 
 
N!
------------------------------------------------------------------------------
Nicholas J. Leon                                        <nicholas@binary9.net>
"Elegance through Simplicity"                  http://www.binary9.net/nicholas

                   Under NO circumstances buy a Packard Bell.
                     They are substandard pieces of shit.



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

Date: Mon, 24 Mar 1997 14:30:54 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: dinendra <dinendra@blarg.net>
Subject: Re: -d -f options
Message-Id: <Pine.GSO.3.96.970324142500.20610J-100000@kelly.teleport.com>

On Sun, 23 Mar 1997, dinendra wrote:

> opendir(DIRCONTENT,"$parentdir") || die "Cannot open dir $parentdir\n";	
> $dircontent= readdir(DIRCONTENT); 
> $dircontent = readdir(DIRCONTENT); #read and discard the name of directory above

That may be a rash assumption, that the first two entries will always be
"." and "..". It's probably safer to use a line like this inside the 
loop.

        next if $dircontent =~ /^\.\.?$/;

> while($dircontent =  readdir(DIRCONTENT))
> {
> 	if(-d $dircontent)

The -d operator is looking in the current directory, rather than in the
directory opened with opendir. You probably want something like this.

        my $fullname = "$parentdir/$dircontent";
        if (-d $fullname) {  ...

Then, once you've done that test, you can speed up later tests by using
the special underscore filehandle to use the results from the previous
test.

        } elsif (-f _) {  ...

Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: 24 Mar 1997 22:40:57 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: -d -f options
Message-Id: <5h6vtp$dj@fridge-nf0.shore.net>

Nathan V. Patwardhan (nvp@shore.net) wrote:

: opendir(DIRCONTENT,"$parentdir") || die "Cannot open dir $parentdir\n";	
: while($dircontent =  readdir(DIRCONTENT)) {
: 	if(-d $dircontent) {
: 	  print "Dir : $dircontent\n";
[snip]

Brain fart!

this should work:

while($dircontent = readdir(DIRCONTENT)) {
     if(-d "$parentdir/$dircontent") {
etc etc etc

Sorry for the confusion.

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: 24 Mar 1997 21:05:56 GMT
From: Scott Cairns <74602.3516@CompuServe.COM>
Subject: [Q] Newbie question on getopts.
Message-Id: <5h6qbk$qte$1@mhade.production.compuserve.com>

I have written a perl script which, among other options, takes a 
-F option in the form:

foo -F[pathname].

My problem lies with either the getopts package or the '/' 
character.  If I supply the argument with something like
-F/unix/filename, the script seemingly takes each letter in the 
path as a separate argument and can't digest it.  I'm sure there 
is a simple solution to this but I can't find an example 
anywhere.

Thanks in advance.

Please respond to cairs@tmgfp.com instead of my compuserve 
account which originated this post.

-- 
The beatings will continue until morale improves.


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

Date: 24 Mar 1997 13:20:26 -0600
From: David Ishee <dmi1@ra.msstate.edu>
Subject: Re: Accessing a database
Message-Id: <m3iv2hgkqt.fsf@gsubc.dot.edu>

Nader Ziada <nziada@idsc.gov.eg> writes:


> > I am about to write a CGI script in perl that will need to use a rather
> > large database.
> > Does anyone know how I should do this. Should i create an SQL hello

There are alot of free databases out there. Some that come to mind are
mSQL, mySQL, Postgress, etc. Many of these databases have perl
interfaces that can be used to get data out, or search for info which
can be used in a CGI program. A list of free databases is at:

http://cuiwww.unige.ch/~scg/FreeDB/FreeDB.list.html

-- 

David

+--------------------------------------------------------------------+
| David Ishee                                                        |
| Mechanical Engineer, MS grad student         dmi1@ra.msstate.edu   |
| Mississippi State University                                       |
|                                                                    |
+------------- http://www2.msstate.edu/~dmi1/index.html -------------+


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

Date: 24 Mar 1997 10:23:32 -0700
From: mfuhr@dimensional.com (Michael Fuhr)
Subject: Re: ADVICE NEEDED: timelocal() prints wrong result
Message-Id: <5h6dak$9uu@nova.dimensional.com>

    [ cc to author ]
dusanb@syd.csa.com.au (VK2COT) writes:

>I have written a Perl5 script (I am running Solaris 2.5.1 with Perl 5.003) which calculates differences between certain dates. It all works fine, except that the
>results are wrong when timelocal() is used on dates that start in different months.

[ snip ]

>I am aware of other Perl5 date manipulation modules. At this stage, I would like
>to "stick" to standard Perl5 (if possible).

Why limit yourself to just the modules in the Perl distribution?  A lot
of the more useful ones are contributed:  Date::Manip, for example, will
do your calculations quite easily.  A lot of people have gone to a lot
of work so you don't have to.  Please take advantage of their efforts and
visit the Comprehensive Perl Archive Network (CPAN) at:

    http://www.perl.com/CPAN/CPAN.html

Hope this helps.
-- 
Michael Fuhr
http://www.dimensional.com/~mfuhr/


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

Date: Mon, 24 Mar 1997 09:11:52 -0600
From: Jim Garrison <jhg@austx.tandem.com>
To: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Another dereferencing bug in 5.003 ?
Message-Id: <333699B8.28CC@austx.tandem.com>

Randal Schwartz wrote:
[snip]
> Here are the legal dereferencing forms,
> using SREF for scalar ref, HREF for hash ref, and AREF for array ref,
> and $x and @y for just a couple of ordinary expressions:
> 
>         ${SREF}
>         @{AREF}
>         ${AREF}[$x] or AREF->[$x]
>         @{AREF}[@y]
>         %{HREF}
>         ${HREF}{$x} or HREF->{$x}
>         @{HREF}[@y]
[snip]

THANK YOU! Finally, in one single place, a list of canonical
dereference forms.  I highly recommend this be included in 
Camel-3.  Now the question becomes "What are the formal rules
governing the elision of braces in compound dereferencing expressions.

I.e., when is '($|@|%)$xxx' (regex notation) valid, and what are
the formal precedence (binding) rules governing evaluation of the
expression? (Camel-2's ad-hoc informalism in this regard is VERY
frustrating ;-)


-- 
James Garrison			mailto:jhg@mpd.tandem.com
Tandem Computers, Inc
14231 Tandem Blvd, Rm 2346	Phone: (512) 432-8455
Austin, TX 78728-6699		Fax:   (512) 432-2118


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

Date: 24 Mar 1997 22:57:46 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Basics
Message-Id: <5h70ta$8f$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl, a dead dead ex-newsgroup,
    Pascal Deschenes <davinci@videotron.ca> writes:
:And you just start your script with something like this:
:#program_name.pl
:#description
:**code here**

It is a mistake to assume that any flie ending in dot-pl is a rpel
executable.  This is the wrong way to go about it.  Otherwise you subvert
the purpose of the perl library files, like foo.pl .  This is a problem
that you also see on systems that asssume tht anything ending in .cgi
is to be executed as a cgi program.  In both cases, how do you expect
to use the file normally in a non executable way?  You won't be able to.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    #else /* !STDSTDIO */     /* The big, slow, and stupid way */
        --Larry Wall in str.c from the 4.0 perl source code


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

Date: Mon, 24 Mar 1997 15:00:09 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Andrew Koons <andy@wwdatalink.com>
Subject: Blocking specific countries (was: Question)
Message-Id: <Pine.GSO.3.96.970324144727.20610N-100000@kelly.teleport.com>

On Sun, 23 Mar 1997, Andrew Koons wrote:

Subject: Question

(Aren't they all questions? There's a frequent posting about choosing good
subject lines; check it out.)

> Does anyone know of a way to block specific countries from entering a
> page, using either a perl program or the server setup.

I usually just require that each electron have its passport stamped at
customs when it enters and leaves the country. :-)

There is, in general, no way to know for sure where your data goes when it
leaves your site. Sure, it's addressed to a particular IP address, but
what happens when it gets there? Maybe that site is a proxy which forwards
every packet over a satellite link to the private dacha of Boris Badinov. 

On the other hand, depending upon what you want to do, there may be a way
to do it. For example, you could conceivably have a chart of IP addresses
and their countries, and set up your server to only allow accesses to
certain ones. Although that can't guarantee that your data will only go
where you want, it could mean that you aren't exporting it yourself, if
you're merely wanting to comply with export restrictions. Is that it? 

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Mon, 24 Mar 1997 18:27:08 -0500
From: Michael Shannon <mshannon@lds.com>
Subject: Calling Perl Script from ServerSide Java applets???????
Message-Id: <33370DCC.1FE7@lds.com>

Hi,

I have always gotten great response from this news group, so I will try
again. 

I have written a Server side Java applet for the Netscape Environment. I
had to do this because I need to invoke a client/server Java application
that returns some data from a remote database. The results of this call
I would like to pass to a legacy perl/cgi script and have the output of
the perl script handled by the java applet. Does anyone have any
experience with this, that might be able to shed some light.

Thanks...mike
-- 
Michael J. Shannon, Jr.    
mshannon@lds.com             Logical Design Solutions, Inc.
201-971-0100 ext 161         465 South Street   Suite 103
201-971-0103 (fax)           Morristown,  NJ  07960

"Why cut a tree to build a church when you could just worship the tree?"


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

Date: 24 Mar 1997 15:55:33 -0500
From: Ken Anderson <anderson@necsys.gsfc.nasa.gov>
Subject: Can someone explain this behaviour?
Message-Id: <y7xbu89vwl6.fsf@necsys.gsfc.nasa.gov>

Hi,

i ran into some curious behaviour that i just can't explain.
check this out:


	% foo 
	string list? (Exit with ^D):1 2 3 4
	1 2 3 4
	1 2 3 4
	1 2 3 4
	4 3 2 1


as a simple example, this script asks for input line(s) (1 2 3 4)
here is the script that did this:


	print "string list? (Exit with ^D):"; chop(@str=<STDIN>);
	print @str,"\n";
	print $str[0],"\n";
	print reverse(@str),"\n";
	print reverse(@str)."\n";


As you can see, it puts the line into an array .
The curious behaviour comes in the following print statements as i print
the array, @str.  Of course, the 1st line is in $str[0] and reverse does
not reverse the one element.  Now, why is the . (concat) operator getting
perl to "reverse" the one, and only one, element in the array? Concat with
a null string does this too.  In fact, if you go   
	
	print "help".reverse(@str),"\n";

you get this:

	help4 3 2 1


huh?   At first i thought it was just operator precedence, but that does 
explain things really.  At least, not as far as my understanding of 
precedence goes. 


any enlightenment will be greatly appreciated.


thanks

-ken


	The earth is spinning madly through space and I
	sit in front of a TV screen all bloody day.
--------------------------------------------------------------------
Kenneth Anderson                |    Code631 Astrophysics Data Facility
Hughes STX                      |    email: anderson@ssvs.gsfc.nasa.gov
Goddard Space Flight Center     |    ph:    301 286 1375
Greenbelt, MD                   |
--------------------------------------------------------------------


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

Date: 24 Mar 1997 21:49:43 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: case sensativity
Message-Id: <5h6stn$par$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    aml@world.std.com (Andrew M. Langmead) writes:
:He can use mixed case. He just needs to keep consistant when refering
:to the same variable. I don't see why he is complaining he can't.

Someone who cannot be consistent about case in identifiers probably
can't be consistent when referring to filenames or URLs either, in which
case they will have a serious problem.

I think what Dijkstra said about COBOL causing brain-damage needs to
be extended to MS-DOS and BASIC.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    s = (char*)(long)retval;                /* ouch */
        --Larry Wall in doio.c from the perl source code


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

Date: 24 Mar 1997 18:37:16 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Casting in Perl
Message-Id: <5h6hks$cvd$3@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, German Cancio Melia <German.CancioMelia@cern.ch> writes:
:I'm in need of doing a casting in Perl but I don't know how. 
:Suppose I've got a class A, with methods M1 and M2, and M1 calling
:M2. 
:Now, I create a class B which inherits from A, also with methods M1 and
:M2 which override M1 and M2 from A. In method M1 I have to call
:A->M1. The problem is that M1 from A will call M2 from B where it is
:supposed to call M2 from A!!
:
:Is there a way to avoid this??

Have you read what perltoot says about SUPER?

    http://www.perl.com/CPAN/doc/manual/html/pod/perltoot.html

See the section on overridden methods.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
"Espousing the eponymous /cgi-bin/perl.exe?FMH.pl execution model is like 
reading a suicide note -- three days too late."
	    --Tom Christiansen <tchrist@mox.perl.com>


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

Date: 24 Mar 1997 21:34:14 GMT
From: dribbs@netspace.org (Keith Dreibelbis)
Subject: chunk POST and receive with LWP or other module
Message-Id: <5h6s0m$41k@cocoa.brown.edu>

Hello,

In looking through LWP and friends I found that if you wish to retrieve a
large file from an HTTP::Request, there is a nice way to process the file
in chunks, or to export the output to a file.

I am curious if the opposite is possible, i.e. if you can have a variable
to POST that actually comes from a file.  And then there is the problem of
having a CGI to receive the file.  I'm wondering if i'm going to have to
do it myself, going into the low-level CGI stuff, since it doesn't seem
that any modules do this. ("thou shalt not reinvent the wheel")

Unfortunately, the sender is inside a firewall, and the receiver is
outside the firewall, so I can't have a trio of CGIs, where the first one
tells the second one to go ask the 3rd one to GET the file.  That would
have allowed me to use LWP's lovely handling of large GETs, but the
firewall prevents that.

Any suggestions are greatly appreciated.
--
Keith Dreibelbis
dribbs@netspace.org


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

Date: Mon, 24 Mar 1997 18:15:03 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Creating arrays...
Message-Id: <adelton.859227303@aisa.fi.muni.cz>

Mr Matty <hayes@coventry.ac.uk> writes:

> Can anyone help.. I am after a bit of a pointer,
> 
> I want to take in a string and convert each word within that is delimited 
> by a space into an array. For instance..
> 
> Hello My Name Is
> 
> would create
> 
> @sentance{1} = "hello"
> @sentance{2} = "My"
> etc...
> 
> and then print them out individually..

Well, I am not sure that what you have shown is what you really want.
Let me assume that you meant

$sentence[0] = "Hello";
$sentence[1] = "My";
$sentence[2] = "Name";

and so on. What I have created is an array where each element is
a string. The array is indexed from zero. Oh yes, how do you create
that?

$string = "Hello My Name Is";
@sentence = split / /, $string;

Function split returns list of strings that are between what was
matched by the thing inside slashes. So it returns list of words and
you can assign this list into an array.

Then you can print the array using

$" = ':';
print "@sentence\n";

or

for (@sentence)
	{ print $_, "\n"; }

or

for $i (0 .. $#sentence)
	{ print $sentence[$i], "\n"; }

or so, depending on what you need. So this was about getting words of
a sentence into an array.

What you showed was an associative array (hash) and unless that was
what you wanted (which I doubt) I will not comment on it unless
requested.

Hope this helps.

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: Mon, 24 Mar 1997 16:31:38 -0600
From: Gabriele R Fariello - 608-576-8660 <gabriele@clotho.com>
Subject: Re: Creating arrays...
Message-Id: <333700CA.70E3CC89@clotho.com>

Mr Matty wrote:
> 
> Can anyone help.. I am after a bit of a pointer,
> 
> I want to take in a string and convert each word within that is delimited
> by a space into an array. For instance..
> 
> Hello My Name Is
> 
> would create
> 
> @sentance{1} = "hello"
> @sentance{2} = "My"
> etc...

How about 

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

$string = "Hello My Name Is Bongo";
@array = split( / /, $string);
# This is just something to print it out in an odd way ;)
foreach(@array)
  {
  print "Doing the array check -> '$_'\n";
  sleep 1;
  }
__END__

> 
> and then print them out individually..
> 
> Ta
> 
> Matty.

If that's not what you wanted, then I guess I don't understand the
question.

-Gabriele

-- 
Gabriele R. Fariello  | Clotho Internet Consulting
gabriele@clotho.com   | 33 University Square No. 251
(608)-576-8660        | Madison, WI  53715


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

Date: Mon, 24 Mar 1997 20:20:28 GMT
From: brian@brie.com (Brian Lavender)
Subject: Dereferencing single value using CGI gives list instead
Message-Id: <3336e182.8965519@nntp.netcruiser>

I have a problem with this perl script using CGI. I just want the
value printed when I dereference $query for the parameter. Instead it
is printing a list of all the parameters submitted to the query. Try
the code with the following parameters. How can I make it so it just
dereferences the value for the paramter fed through the @items
array? 

Brian

individual_day=3
twodayearly=5

#!/usr/bin/perl

use CGI;
$query = new CGI;
@items = qw(individual_day twodayearly twodaypaytron tent dry_camp
rv_limited rv_full);
print $query->header;
print $query->start_html("List dump Problem");
foreach $item (@items) {
   next unless ( $query->param($item) > 0);
   print "The world is $query->param($item)\n";
}

print $query->end_html;
----------------
Brian Lavender
Napa, CA
Brie Business Directory - Napa Valley     http://www.brie.com/bbd 
(707) 226-8891

"The world is a good place if you are in a good position."


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

Date: Mon, 24 Mar 1997 23:32:23 GMT
From: soccer@microserve.net (Geoffrey Hebert)
Subject: Re: Executing a script???
Message-Id: <5h720n$qt5$1@news3.microserve.net>


"Stephen Hill" <scs@huron.net> wrote:

>How can you have a script execute automatically when your page is
>loaded....SSI works if the script is on the same server as the page, but
>does not seem to work if the html page and the script are on different
>servers.

>Is there some way you can use the image tag to do this?

Not for this group - but here are threee methods I used recently:

Method 1.  Redirection 
                  print "Location: http://www.my.com\n\n";

Method 2.  Meta refresh

<html>
<head>
<title>Advertisement</title>
<META HTTP-EQUIV='Refresh' conteNT='1;
URL=http://www.microserve.net/~soccer/
indexb.html'>
</head>
<BODY BGCOLOR='#000000'
LINK='#FF0000' VLINK='#FF0000'
ALINK='#FF0000' TEXT='#FF0000' >
<p><p><p><p><p>
<hr>
<center>
<font size=+3>
One Moment Please
</BODY>
</HTML>
~

Method 3. Frames

<HTML>
<HEAD>
<TITLE>All Soccer</TITLE>
<frameset cols="18%,*" frameborder="NO">
<frame src="left.cgi?soccer::" name="left"  marginwidth=1
marginheight=1
           SCROLLING=AUTO>
<frameset rows="10%,*,17%" frameborder="NO">
<frame src="top.html" name="top" marginwidth=1 marginheight=1
            SCROLLING=NO>
<frame src="rtn.cgi?soccer::" name="mid"  marginwidth=1 marginheight=1
           SCROLLING=AUTO>
<frame src="adv.cgi?soccer::" name="adv"  marginwidth=1 marginheight=1
           NORESIZE SCROLLING=AUTO>
</frameset>
</frameset>
<NOFRAMES>




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

Date: Mon, 24 Mar 1997 13:42:50 -0500
From: "John R. Fairfield" <fairfijr@dadeint.com>
Subject: File and Disk replication
Message-Id: <3336CB2A.1761@dadeint.com>

Does any have any experience doing file and disk replication in perl?
Looking for examples!  I have a remote (mirror) site which I only want
do an update once a night because of network traffic during the day.
I have a small program which will replace new files in a directory tree
structure but doesn't delete missing files.  Still learning!
-- 
      | John Fairfield                | DADE INTERNATIONAL           |
      | CAD Support Analyst           | Dade Chemistry System Inc.   |
      | Phone (302) 451-9022          | P.O. Box 6101 Mail Stop B506 |
      | Fax   (302) 451-9716          | Newark DE 19714-6101         |
      | E-Mail fairfijr@dadeint.com   |                              |


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

Date: 24 Mar 1997 22:03:27 GMT
From: "Kaushal Shah" <kaushal@nwdc.com>
Subject: foreach loop and printing
Message-Id: <01bc389f$88f45240$6ead3b80@Thunder.Columbia>

Why won't the following code create a file called uid.log assuming there is
some data in
%dir?

@dirs = keys (%dir);
open (LOG, ">uid.log");
foreach $entry (@dirs) {
    print LOG $entry." ".$dir{$entry}."\n";
}
close (LOG);

Thanks.

-Kaushal.


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

Date: Mon, 24 Mar 1997 22:12:06 GMT
From: joel@wmi0.wmi.com (Joel Coltoff)
Subject: Re: foreach loop and printing
Message-Id: <5h6u77$jsp@netaxs.com>

In article <01bc389f$88f45240$6ead3b80@Thunder.Columbia>,
Kaushal Shah <kaushal@nwdc.com> wrote:
>Why won't the following code create a file called uid.log assuming there is
>some data in
>%dir?
>
>@dirs = keys (%dir);
>open (LOG, ">uid.log");
>foreach $entry (@dirs) {
>    print LOG $entry." ".$dir{$entry}."\n";
>}
>close (LOG);
>
>Thanks.
>
>-Kaushal.

It could be because your system doesn't allow files with '.' in the
name. Or it could be something as simple as you can't write in
the directory you are using. Maybe someone has a script that sits
in a tight loop looking for a file called "uid.log" and when it
finds one it deletes it. Why don't you let perl tell you why?

    open (LOG, ">uid.log") || die "Can't create output file because $!\n";

-- 
Joel Coltoff

I'd explain it, but there's a lot of math. -- Calvin


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

Date: Mon, 24 Mar 1997 17:20:32 +0100
From: Nathalie Cartier <cartier@montrouge.geoquest.slb.com>
Subject: Fsdk97 Wbtest4
Message-Id: <3336A9D0.6A2E@montrouge.geoquest.slb.com>

Hi,

I try to use the SDK examples to create WebBots for Frontpage 97.
I have some problems to use Wbtest4 which use a perl script.

Thanks so much for your help!! If possible, respond to my email!!

			Nathalie.


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

Date: 24 Mar 1997 22:06:00 GMT
From: Kathy Scott <kscott@uab.edu>
Subject: help needed connecting character strings
Message-Id: <5h6ts8$n5r@maze.dpo.uab.edu>

I have a string of characters assigned in the variable $helixname
For example $helixname=helix25
I have had no problem refering to a file as $helixname.dt so that the file
that is being dealt with is helix25.dt
However, when I tried this line
rename("existingfile", $helixname.dt);
The computer leaves out the period before the extension; so, the file's new
name is helix25dt
Can anyone explain this?
Thank you very much,
Kathy Scott



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

Date: Mon, 24 Mar 1997 12:22:35 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: help
Message-Id: <bpg6h5.um2.ln@localhost>

Paul Swan (sales@jewellery.com) wrote:
: Does any one have a small self serch program


No.


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: 24 Mar 1997 18:29:08 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Is CGI a part of or similiar to Perl?
Message-Id: <5h6h5k$cvd$2@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, ccrox39754@aol.com writes:
:I've seen numerous references in this newsgroup to cgi. Is CGI a part <SNIP>

You should do something about your newsreader.  You're posting lines
that are too long, so they tend to get snipped or formatted like crud.
This is normally a PC bug, but sometimes manifests on Unix systems that
are misconfigured, especially when running a stupid web browser instead
of a newsreader.

Anyway CGI is a protocol, just as TCP is a protocol.  Neither is a language.
One writes TCP programs, or CGI programs, in any language.  Programming
languages include C, Pascal, and Perl.  They are not protocols.  And while
you hear people talk about writing "a perl" or "a cgi", they are confused.

        Perl != CGI
           C != TCP
    Language != Protocol

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
*** The previous line contains the naughty word "$&".\n
                if /(ibm|apple|awk)/;      # :-)
            --Larry Wall in the perl man page


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

Date: 24 Mar 1997 18:30:16 GMT
From: "Josep Jover" <jjover@correu.andorra.ad>
Subject: Little beginers question
Message-Id: <01bc3880$c9e30900$ca419ec2@SUZUKA.andorpac.ad>

Hello,
Just two little questions to help a beginner that doesn't write english
very well ;-)

How can I retrieve the current directory where I am ('chdir' is only use to
change it ?)
How can I know the number of elements in a table. I try $len=@array but it
don't seems to work well.
With the regular expression $body=~/xxx/ we can know if the expression xxx
is contained in $body, how can I know the number of times, and the location
to retrieve a part of the string ?

Best reguards
Josep Jover
jjover@andorra.ad


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

Date: 24 Mar 1997 16:19:33 -0700
From: Vladimir Alexiev <vladimir@cs.ualberta.ca>
To: John Clutterbuck <John.Clutterbuck@sbs.siemens.co.uk>
Subject: Re: Need to extract the text from Microsoft Word 6 files
Message-Id: <omhgi0x4hm.fsf@tees.cs.ualberta.ca>

http://www.cs.cmu.edu/afs/andrew/usr/sumner/www/catdoc.c


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

Date: 24 Mar 1997 19:04:00 +0200
From: dirk@good-news.swb.de (Dirk Treusch)
Subject: NetWare: 'send'?
Message-Id: <6TUzKrheJAB@good-news.swb.de>

Hi,

who else is using the Perl 4 port for NetWare?

There is one problem I just can't solve:

How can I issue an internal console command, e.g. 'send', from within a  
Perl script?
'exec' or 'system' only seem to work on NLMs, not on internal commands.

Any comments are much appreciated.

Regards,

Dirk


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

Date: Mon, 24 Mar 1997 22:13:19 GMT
From: sysadmin@silkspin.com (Ross D. Perkins)
Subject: New CGI column for an online magazine
Message-Id: <3336fbba.158213709@news.cc.utexas.edu>

Hello!

I have recently attained the position of a writer for Go Insider
(http://goinside.com), a wonderful online magazine. I'm going to be writing a
CGI-specific column, dealing with Perl and C.

What I would like to know is what are the types of things that all of you would
be interested in hearing about? Do you think that most people would benefit from
"How To" tutorials, or commentary, or something else?

Also, what types of issues would you like to see covered in this column? Do you
have any suggestions that you would like to see me implement?

Thank you for your time,
Ross

______________________________________________________________
R o s s   P e r k i n s                  sysadmin@silkspin.com
Systems Administrator                  http://www.silkspin.com

                           SILKSPIN
               THE FULL SERVICE INTERNET COMPANY


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

Date: Mon, 24 Mar 1997 16:02:13 GMT
From: mlaker@contax.co.uk (Markus Laker)
Subject: Re: Open file works under DOS, not under server
Message-Id: <5h68fs$ar$1@newsserver.dircon.co.uk>

brian@brie.com (Brian Lavender) wrote:

> In Unix
> there is the pwd command, but off the top of my head I can't think of an
> equivalent in DOS.

The cd command prints the current working directory if you don't give
it any arguments.



Markus Laker



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

Date: 24 Mar 1997 22:59:03 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: perl -p changes my program in unexpected ways.  Why?
Message-Id: <5h70vn$8f$2@csnews.cs.colorado.edu>
Keywords: HTML, SGML, parse, multiline regexp

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    jamie@csd.uwo.ca writes:
:
:     I'm trying to use regexps to pull out lines between two patterns that
:may themselves be on different lines.  When I use the example from the FAQ:
:
:  perl -0777 -pe \
:   'print "PARA " . $pcount++ . "\"$1\"\n" while m{<P>(.*?)</P>}gs'

You have confused -n with -p.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com


    What I tell you three times is true.


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

Date: Mon, 24 Mar 1997 20:50:00 GMT
From: chester@black-diamond.com (Chester Bullock)
Subject: PERL Freelancers?
Message-Id: <5h6pgv$lkm@wayback.orci.com>

I am in need of a PERL programmer to do create a script.  If
interested, e-mail me at chesterb@toski.com and I will give you more
details.



-- Chester Bullock
chester@black-diamond.com
Affordable Web Design and Hosting for Small Businesses
http://www.black-diamond.com



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

Date: Mon, 24 Mar 1997 15:42:14 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: LAM Chi-fung <cflam@hk.super.net>
Subject: Re: Perl sendmail problem
Message-Id: <Pine.GSO.3.96.970324153238.20610Q-100000@kelly.teleport.com>

On 24 Mar 1997, LAM Chi-fung wrote:

> Newsgroups: comp.lang.perl.misc, comp.lang.perl.modules, comp.lang.perl.tk
> Subject: Perl sendmail problem

What does this have to do with modules or tk? Maybe you should have posted
this to only one newsgroup...

> Hello all, I am now writing a perl program to send e-mail from a mailing
> list, the send e-mail code is:
>  for ($i=1;$i<=$maillistcount;$i++)
>  {
>    open (SM,"|/usr/lib/sendmail -f$FromAddress $maillistacount[$i-1]");
>    print SM "Subject: $MailSubject\n\n";
>    print SM "$MailBody\n.\n";
>    close (SM); 
>  }
> 
> However, I find that not all the e-mail are sendout e.g. if the list
> contains 10 people, sometime, only 5 of them receive e-mail and some 8
> of them!!!! And never got 10!!! What happen ? I know C/C++ but is new to
> perl and UNIX, thanks a lot.

It seems you're using many sendmail processes at once. Ouch! In general,
you should probably send one message to ten addressees rather than sending
the same message again and again. (Hey, you wouldn't happen to be sending
junk email, would you? If you are, please ignore this and any other
helpful messages you receive. :-)

But you're never checking to see whether your open is successful. Always
check the return value from open and other system calls. Maybe the sixth
call to open is failing due to the large number of processes you're
running at once, perhaps?

Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: 24 Mar 1997 22:19:38 GMT
From: <jtjioe@us.oracle.com>
Subject: Perl to interact like "expect" script ?
Message-Id: <5h6ulq$e57@inet-nntp-gw-1.us.oracle.com>

All,
Can Perl interact with program or shell just like "expect" ?
I usually use expect script to do interaction with program say
installation program, remote login etc.

Is this possible with Perl also?

Thanks in advance,
--
Joe Chitrady    
jtjioe@us.oracle.com 


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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


------------------------------
End of Perl-Users Digest V8 Issue 169
*************************************

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