[8504] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2121 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 17 21:07:25 1998

Date: Tue, 17 Mar 98 18:00:34 -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           Tue, 17 Mar 1998     Volume: 8 Number: 2121

Today's topics:
        "Getting data from another machine" <74331.3261@CompuServe.COM>
        (Newbie to Perl) - can you improve my program? <q9522772@mail.connect.usq.edu.au>
    Re: ? retrieve meta tag information from a HTML documen <fp@pmpcs.com>
    Re: [Q] MacPerl - How to use libraries? (Paul J. Schinder)
        Calling all "Newbies" <stackhou@execpc.com>
    Re: Chicago Perl Mongers <scribble@pobox.com>
        Date function - yyyymmdd format jmohr@grizzly.ccsd.k12.wy.us
    Re: Dynamically checking for existing functions (Jason Gloudon)
        HI!PERL/CGI Websites? <abhutkar@synopsys.com>
        How do I parse this file? Argh! murple@erols.com
        How to use "@" literally in perl scripts (Hiren Shah)
    Re: How to use "@" literally in perl scripts <zenin@archive.rhps.org>
    Re: Illegal octal digit error? (Jason Gloudon)
    Re: Is there a "Newsgroup" for Newbies to Perl? (Nicholas Carey)
    Re: libnet/Net::FTP-- accessing FTP within an intranet. (Jeffrey Drumm)
        Module for copying directories (Scott Nipp)
    Re: Net::FTP & firewalls? (Jerry Talkington)
    Re: parsing perl <chasecreek.systemhouse@usa.net>
        Perl Script Challange (Sporty)
        Running CGI-Scripts on a webserver <ralphmoch@swol.de>
    Re: Running CGI-Scripts on a webserver <rhawkins@navix.net>
    Re: Setting locale failed. (Tom Grydeland)
    Re: splitting by one or more spaces <bbrown@sna.com>
    Re: trying to rename files in perl <chasecreek.systemhouse@usa.net>
        Variable question <kellysm@ix.netcom.com>
    Re: Variable question (Craig Berry)
        VERY URGENT !!! <webmaster@portugalsystems.pt>
        Wanted: email address gleaner <jp@glpbooks.BADMAIL.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Tue, 17 Mar 1998 16:17:45 -0500
From: Terry Michaels <74331.3261@CompuServe.COM>
Subject: "Getting data from another machine"
Message-Id: <OwJUioeU9GA.70@ntawwabp.compuserve.com>

How can I get system information from another machine
through my script.  I want to launch a script from "predator"
which can look at other machines and read the results from
"df -a" or "df -k" into an array for reporting.

Thanks in advance,

Terry Michaels
Apache Corporation
Houston, Texas
terrence.michaels@apachecorp.com


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

Date: Wed, 18 Mar 1998 11:24:32 +1100
From: Matthew Kennedy <q9522772@mail.connect.usq.edu.au>
Subject: (Newbie to Perl) - can you improve my program?
Message-Id: <350F1440.68B8DCEF@mail.connect.usq.edu.au>

Hello fellow Perl users,

I wrote the following program (psfragx.pl) which is supposed to search a
encapsulated postscript file produced from matlab. It's desinged to scan
though the file, find all text labels which only contain numbers and
write a set of (LaTeX) commands to standard output. 

It's my first Perl program. Can you suggest any improvements to make
better use of the Perl language? Also how would I use split (or maybe
some other command) to extract the number part of PS command like:
"(-3.14) s"?

Please email me directly if you can.

Thanks,
Matthew

if ($#ARGV != 0) {
    warn "Syntax: perl psfragx eps_file";
    exit 1;
} else {
    $file = $ARGV[0];
    # check if file exists and ready to be read
    if (-r $file) { 
	open(INPUT,$file);
	# find a PostScript text label containing a number
	@labels = grep /^(\(\-?\d+(\.?\d+)?\) s)/, <INPUT>;
	foreach $label (@labels) {
	    # extract just the number and send the PSfrag command to SDOUT
	    $number = substr($label,1,-4);
	    print "\\psfrag{$number}{$number}\n";
	}
	close INPUT;
	exit 0;
    } else {
	warn "Error: Cannot read '$file'";
	exit 1;
    }
}


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

Date: Tue, 17 Mar 1998 18:17:18 -0500
From: "Peter Perchansky" <fp@pmpcs.com>
Subject: Re: ? retrieve meta tag information from a HTML document with Perl ?
Message-Id: <6en05n$eko$1@usenet43.supernews.com>

Hi Martin:

Martin Vorlaender wrote in message
<350ede50.524144494f47414741@radiogaga.harz.de>...
>It might be overkill for this purpose, but have a look at the
>HTML::Parser module, which is part of the LWP.

I'm reading Web Client Programming (it goes over LWP and HTML::Parse et
all).  However, I'm having an interesting time find really good
documentation on the various modules ("Web Client Programming" skips some).

Do you know of any books or web sites that really go over HTML:Parse and the
other modules that make up the LWP set?

Thank you.

--
===========================================================
Peter Perchansky,  Computer Consultant & Microsoft FrontPage MVP
Dynamic Net, Inc. DBA PMP Computer Solutions
Providing Dynamic Databases, Design, &  Electronic Commerce Solutions
FrontPage Web Hosting at http://www.pmpcs.com/services/fpwebhosting.htm
FrontPage Support http://www.pmpcs.com/support/frontpage.htm





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

Date: Tue, 17 Mar 1998 19:17:44 -0500
From: schinder@leprss.gsfc.nasa.gov (Paul J. Schinder)
Subject: Re: [Q] MacPerl - How to use libraries?
Message-Id: <schinder-1703981917450001@schinder.clark.net>

In article <1d61fj6.13ys5vh14bde7vN@roxboro0-003.dyn.interpath.net>,
phenix@interpath.com (John Moreno) wrote:

}  I've looked in Shuck, I've looked in the MacPerl FAQ (which needs to be
}  updated) I've read the standard perl docs, and I still can't figure out
}  why:
}  
}  #!/usr/local/bin/perl -w
}  
}  use Mac::Memory;
}  use Mac::Resources;
}  
}  gives me:
}  
}  # Can't locate Mac/Memory.pm in @INC.
}  File 'Programming:MacPerl :testres'; Line 3
}  # BEGIN failed--compilation aborted.
}  File 'Programming:MacPerl :testres'; Line 3
}  
}  
}  Obviously it's not finding it or the directory inside lib, but
}  everything looks like it's in the right place to me.
}  
}  This is obviously some stupid thing that I'm overlooking and will kick
}  myself in the ass for missing, but I just can't figure it out and can't
}  think of anywhere else to look!

Run this and see what it says:

print join("\n",@INC)."\n";

Is the folder ":MacPerl :lib:" one of the entries?  If not, discard your
MacPerl preferences and start over.

For the record, this script 

#!/usr/local/bin/perl -w
 
use Mac::Memory;
use Mac::Resources;

print $INC{"Mac/Memory.pm"}."\n"; #yes, it's / in %INC even under MacPerl
print $INC{"Mac/Resources.pm"}."\n";

gives the appropriate response for my machine:

The Black Pits:Applications:MacPerl :lib:Mac:Memory.pm
The Black Pits:Applications:MacPerl :lib:Mac:Resources.pm

}  
}  Help?
}

-- 
Paul J. Schinder
NASA Goddard Space Flight Center
Code 693, Greenbelt, MD 20771
schinder@leprss.gsfc.nasa.gov


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

Date: Tue, 17 Mar 1998 17:17:55 -0600
From: Mark Stackhouse <stackhou@execpc.com>
Subject: Calling all "Newbies"
Message-Id: <6en0j2$gr8@newsops.execpc.com>

All,

Since we seem to be the "Log Jamb" on this Usenet, maybe we
can do something to help ourselves and alleviate some of the
problem at the same time.

Every time I read a good post that has an exceptionally well
worded response, I cut and paste it into a text file that I
have named "Perl_notes".  Now I can query my notes with the
editor of my choice and possibly find the answer to my own
question!!  I tend to save things that I know I'll be
working on soon or think I'll need somewhere down the road. 
I've separated each entry with the same script as a
delimiter (I think that's the right term).  As the file
grows and is no longer manageable, I plan on writing a Perl
script to separate notes out into different files by
category.  The more I collect, the less likely I'll have to
dive into the FAQ or Perl docs.  If enough of us did
something similar, we could then periodically post our
"Newbie Crib Notes" for others to cut and paste from. 
Expert solutions without Expert involvement!

If enough "Newbies" take part in this exercise, we should be
able to reduce some of the traffic here.  Maybe the Experts
would gives us some
real great answers, especially if we inform them of the fact
we save all
posts in our "Newbie Crib Notes".  I'm not sure this will
work, but I know it will work for me.

Here's what I have so far:

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

Open a com port

open( PORT, "+>COM1" ) or die "Can't open COM1: $!";

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

>I have tried the perl documentation but was not able to find any source
>for my following problem:
>I would like to remove everything between '<' and '>' in a line and for
>all the instances.  I am trying to work out a script that basically
>removes all the formatting tags in an HTML document.  For the script:

How about:

 $line =~ s/<[^>]*>//g;

Note: The above example *will* run into problems if '<' or
'>' actually
appear 
in the desired text (in the text they should be represented
as &lt; and &gt;
or 
if each '<' is not properly matched with its corresponding
'>'.

What you want is
  $line =~ s/<.+?>//g;

Look for the term "greedy" in the perlre manpage.

    try    $line =~ s/<.*?>//g;      -   the *? is a
non-greedy pattern
match ie it matches the shortest as opposed to the longest
pattern

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

A script like this means you don't have to put
anything in the <>:

  #!/bin/perl -w

  print reverse <>;

Call this 'tac' and run it like this:

  $ tac /etc/termcap

This prints termcap out line-reversed.

  $ tac /etc/termcap /etc/passwd

This prints out both files line-reversed.

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

This is fine if you are just looking for a single character.
However, if you
are
trying to count multiple
character substrings within a larger string, tr/// won't
work. What you can
do
is wrap a while loop
around a global pattern match. For example, let's count
negative integers:

    $string = "-9 55 48 -2 23 -76 4 14 -44";
    while ($string =~ /-\d+/g) { $count++ }
    print "There are $count negative numbers in the string";

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

You could create a DOS batch file like the following:

        @echo off
        if "%1"=="" goto ERROR
        perl %1 | more
        goto END

        :ERROR
        echo "ERROR: No perl file specified."

        :END
        echo.

Then associate the .pl file type in windows with this batch
file.

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

access the last element in an array

$last_value=$array[-1]

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

it sounds like what you want to do is look at the beginning
and end of
each word.  is that right?  if so, how about this?

# don't read the whole file into an array.  instead, read it
in line
# by line:

open(IN, "your_file_name_here") || die "your_message_here";

while ($line = <IN>) {

# now split that line up into an array.  i'll assume that
the line
# is separated by spaces...

        @words = split(' ', $line);

# each element of the array @words is a word.  now you can
go thru
# the words, using perl's frolicsome foreach operator:

        foreach $word (@words) {
                look_at_beginning;
                look_at_end;
        }

}

on the other hand, if i misunderstood your question and you
really do
need an array of arrays, i refer you to "Perl 5 for
dummies", by paul
e. hoffman, pp. 258-261.  this will help you build the data
structure
and then iterate thru it.

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

given the scalar $string, split it into characters thusly:

@chars = split //, $string;

Now $chars[0] is the first character and $chars[$#chars] is
the last.

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

I have a perl script to send mail.

When the email address is good everything works.

When the email address is invalid, nothing happens.  I would
like to get
returned
to the sender the same thing I get when I use email and get
returned
email because
the email address was not correct.

I added REPLY-TO in my last attempt.  It did not work.

Here is my code:

   open (MAIL,"| sendmail $emailList")
      or die "Can not open mail at this time, try later";
   print MAIL "FROM: $fromEmail \($fromFirst $fromLast
$Llong_name Team
$fromTeam\)\n";
   print MAIL "SUBJECT: $subject\n";
   print MAIL "REPLY-TO: $fromEmail\n";
   print MAIL "\n";
   print MAIL "$desc\n";
   print MAIL "\n";
   print MAIL "$Llong_name at
www.all-soccer.com/leagues/$league/\n";
   print MAIL "email $admin\n";
   print MAIL "AAA000\n";
   close (MAIL);

Did you try
print MAIL "Return-path: whoever\@whereever.net\n";

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

Regards,

--
Mark Stackhouse

***********************************************************************

homepage: http://www.execpc.com/~stackhou

"The best things in life aren't things."
--Art Buchwald

***********************************************************************


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

Date: 17 Mar 1998 19:20:19 -0600
From: Tushar Samant <scribble@pobox.com>
Subject: Re: Chicago Perl Mongers
Message-Id: <6en7gj$ha4@tekka.wwa.com>

petdance@maxx.mc.net writes:
>: it's about time to set up a group in Chicago. I've made tentative
>: contact with a couple people, but now I'm officially announcing my
>: intent. All you Windy City Perl M(o|u)ngers interested in participating,
>
>You didn't mention the donuts and dancing girls.  How do you expect us to
>get any members if you don't?  Duh.
>
>DONUTS AND DANCING GIRLS!  At EVERY meeting!

How about, uh -- burritos, and, dancing chihuahuas?

No?

Well it was just a suggestion...



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

Date: Tue, 17 Mar 1998 19:35:29 -0600
From: jmohr@grizzly.ccsd.k12.wy.us
Subject: Date function - yyyymmdd format
Message-Id: <6en89p$s73$1@nnrp1.dejanews.com>

I've been searching for a couple hours.  Is there a perl function that returns
a date in yyyymmdd format?  I can write my own but why re-invent the wheel?
It's the principal of the thing, you know.


--
John Mohr
Communications Specialist/Analyst
Campbell County School District
Gillette, Wyoming
jmohr@grizzly.ccsd.k12.wy.us

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Wed, 18 Mar 1998 00:02:08 GMT
From: jgloudon@manitoba.bbn.com (Jason Gloudon)
Subject: Re: Dynamically checking for existing functions
Message-Id: <slrn6gu3lf.b07.jgloudon@manitoba.bbn.com>

In article <350EDF9B.1A0107F5@tasmanet.com>, Cole Tuininga wrote:
>Is there a way in perl to check for the existence of a function?  I know
>about autoloading, but as far as I can tell, there's no way for
>autoloading to check that without actually making the call to the
man perlfunc

	You may also use defined() to check whether a
   subroutine exists.  On the other hand, use of

Jason Gloudon


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

Date: Tue, 17 Mar 1998 16:57:00 -0800
From: Ani Bhutkar <abhutkar@synopsys.com>
Subject: HI!PERL/CGI Websites?
Message-Id: <350F1BDC.B9753246@synopsys.com>

HI!
Does anybody know how to solve this?
I have an html online form. What should be the script to
save my incoming data, in simple perl(cgi) format code?
Does anybody know a good website for beginnners at perl/cgi.
please suggest, your reply requested at :
shivanjali@hotmail.com



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

Date: 17 Mar 1998 23:26:42 GMT
From: murple@erols.com
Subject: How do I parse this file? Argh!
Message-Id: <6en0ri$j79$1@winter.news.erols.com>

OK, I've got a system here which basically deals with Internic stuff (sends
forms, parses returning mail, etc). When it's completed its thing with the
NIC, it looks at the customers record in its mySQL database, and creates a
file which gets sent to our DNS setup scripts (which arent maintained by me).
The files it sends off look something like this:


dns +salesxxx@www.permanizesigns.com vw 15
mail salesxxx permanizesigns.com
dns activate permanizesigns.com
dns +t2509@www.globalelegance.com vw 15
mail t2509 globalelegance.com
dns activate globalelegance.com
dns +erictvl@www.homes2discover.com vw 15
mail erictvl homes2discover.com
dns activate homes2discover.com
dns +.asianhoroscope.com
mail video4u asianhoroscope.com
dns activate asianhoroscope.com

This is sending back 4 domains for setup, 3 of which have virtual web, all
have mail aliases, etc. Anyway, this is all well and good, the problem is
parsing the logs which return from the DNS scripts. These logs look like
this:

[status] copying domreg.out from domreg.bsg.erols.net
[status] reading input from ./data/domreg.out/domreg.out
[dns] command: +.rarechance.com
[dns] Warn: zone 'rarechance.com' exists
[dns] Ok: added rarechance.com zone file
[mail] command: thomasapple@rarechance.com
[mail] Ok: added thomasapple@rarechance.com mail alias
[dns] command: activate rarechance.com
[dns] Ok: added rarechance.com to named.boot.real
[dns] command: +.blrreggae.com
[dns] Ok: added blrreggae.com zone file
[mail] command: blrreggae@blrreggae.com
[mail] Ok: added blrreggae@blrreggae.com mail alias
[dns] command: activate blrreggae.com
[dns] Ok: added blrreggae.com to named.boot.real
[dns] command: +.tencal.com
[dns] Warn: zone 'tencal.com' exists
[dns] Ok: added tencal.com zone file
[mail] command: rtener@tencal.com
[mail] Ok: added rtener@tencal.com mail alias
[dns] command: activate tencal.com
[dns] Ok: added tencal.com to named.boot.real
[status] commiting changes
[status] writing changes
[system] ssh -l ns tool.erols.com addrem 'thomasapple@rarechance.com'
>> >addrem: Done.
[system] ssh -l ns tool.erols.com addrem 'blrreggae@blrreggae.com'
>> >addrem: Done.
[system] ssh -l ns tool.erols.com addrem 'rtener@tencal.com'
>> addrem - entry for rtener@tencal.com exists in remaliases.
[remote_cmd] Failed: tool.erols.com addrem 'rtener@tencal.com': 
[system] ssh -l ns ns0 updb
>> Generating named.conf for master and secondary servers.
>> Reloading master server.
[status] Pushing out the results log...
[status] domain_factory v2.0 exited


As you can see, theyre quite human readable. But what I need is a way to split
this up into sections for each domain. As you can see, there's no real
division between domains. Nor are the same things always going to be done for
each domain, so there's not much regularity to work with. Any ideas on how
this could be broken up into more parsable chunks?

-- 

    .-'~~~-.        Craig Schenk
  .'o  oOOOo`.      <murple@erols.com>
 :~~~-.oOo   o`.    
  `. \ ~-.  oOOo.
    `.; / ~.  OO:
    .'  ;-- `.o.'
   ,'  ; ~~--'~     "The opposite of a correct statement is a false
   ;  ;             statement. But the opposite of a profound truth
_\\;_\\//_          may well be another profound truth." -Niels Bohr


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

Date: 17 Mar 1998 20:06:34 -0500
From: hiren@clam.rutgers.edu (Hiren Shah)
Subject: How to use "@" literally in perl scripts
Message-Id: <6en6mq$oc9$1@clam.rutgers.edu>

Hello,

I've been trying to write a program that would autorespond on completion
of a web-based form. I would like to put my email address in the
auto-response message. How do I include "@" sign in the message ? 

Thanks. 

Hiren


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

Date: 18 Mar 1998 01:33:49 GMT
From: Zenin <zenin@archive.rhps.org>
Subject: Re: How to use "@" literally in perl scripts
Message-Id: <890185217.610378@thrush.omix.com>

Hiren Shah <hiren@clam.rutgers.edu> wrote:
: I've been trying to write a program that would autorespond on completion
: of a web-based form. I would like to put my email address in the
: auto-response message. How do I include "@" sign in the message ? 

	$foo = 'my@email.address.com';
	## or..
	$foo = "my\@email.address.com";

-- 
-Zenin
 zenin@archive.rhps.org


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

Date: Wed, 18 Mar 1998 00:22:06 GMT
From: jgloudon@manitoba.bbn.com (Jason Gloudon)
Subject: Re: Illegal octal digit error?
Message-Id: <slrn6gu4qt.b07.jgloudon@manitoba.bbn.com>

Stan Horwitz wrote:
>
>Thanks for helping this Perl newbie! I am used to REXX for scripting so
>Perl throws me for a loop sometime. Now, I am trying to figure out why the
>commands
>
>   $x = "03";
>   printf OUTFILE ("%2s", $x);
>
>outputs "0003" instead of "03" into the file, but when I print the same value
>to the screen, it prints correctly. 

Based on what you've quoted, that _cannot_ be generating the output you are
claiming at least on perl5.004_04. 

Printf works the same way regardless of output. Something else you haven't
quoted is causing this. 

Try reducing the code that generates the odd output to a few lines and 
posting that.

Jason Gloudon 


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

Date: Wed, 18 Mar 1998 00:59:27 GMT
From: a-bnc@microsoft.com (Nicholas Carey)
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <350f0924.18524312@newsvr>

On Fri, 13 Mar 1998 22:37:48 -0600, rasta@spacestar.net wrote:

>I have a great idea, if you see a question that tires you, why not ignore it
>instead of flaming the questioner? Is that so hard? This is not a helpdesk....
>it people discussing things...either contribute if you want or ignore the
>question.

Because one has to wade through [at the very least] the headers. At
this very moment, I'm staring at 567 new, unread messages in clpm.

Most of which are rehashes of the same old same old.

>> Err...USENET would be a bad place to look for quick answers.
>
>I disagree, when I'm stumped and have exhaused what I have in front of me
>I do a search on Deja News.....if someone else had the same question and some
>kind soul...( non rude person) has answered, I'm good to go and I learned
>something too!

But then you're not *participating* in USENET, are you?

You're just extracting information from a database built from past
USENET posts -- Not unlike reading the FAQs, n'est-ce pas?

>People with some compassion would monitor a newbie group to help
>out people who are having a hard time understanding...

What's in it for people to do so? It has nothing to do with
compassion. USENET is, after all, a social exchange. People
participate in it because they derive something from participating in
that exchange. Repeatedly rehashing canned answers to simple
questions, when the answers to those questions are readily available
in multiple other forums, isn't long going to provide much positive
feedback for anyone.

>Unless of course I have a deadline and I just can't get the answer....I figure
>the experts will help me and they turn out to be a bunch of pompus jerks...
>(sorry, but that's the way some people come off on this NG)

The 'experts' aren't pompous jerks; they're people just like you, with
deadlines and husbands and wives and kids and other things in their
lives that require their time and attention.

>> When you've exhausted all the apparent explanations, *then* (and
>> only then) pose a reasoned, specific question with a reasoned,
>> appropriate SUBJECT: line to the group (eg, "I'm trying to
>> accomplish X. I've tried Y: it doesn't do what I expected. I
>> expected M and got N. I've studied the FAQs and the documentation
>> and still don't understand what I'm doing wrong. Can somebody
>> explain this to me?"
>
>Why does one need the disclaimer...I read the faq blah blah blah....
>to prove to you they read it? Give me a break....

It's important that the question is qualified because it demonstrates
that the requestor has done the homework. If someone posits you a
blatantly obvious question, don't you wonder why they didn't just look
it up first?

The underlying assumption is that the requestor's time is far too
precious and valuable a commodity to be used in doing research, while
the time of other people is cheap and readily available for the same.

Tain't so, my friend -- You've got to earn your help. As I pointed out
before, USENET is a social exchange from which participants derive
something of value. As the saying goes...TANSTAAFL [There Ain't No
Such Thing As A Free Lunch].

>The docs are great but they don't always yield the answers I'm trying to get

But you'll never know unless you look in them first. ;-)

That's all that's being asked of people -- do a little research before
asking questions.

Cheers,

N.
-- 



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

Date: Wed, 18 Mar 1998 00:35:37 GMT
From: drummj@mail.mmc.org (Jeffrey Drumm)
Subject: Re: libnet/Net::FTP-- accessing FTP within an intranet...
Message-Id: <350f1229.7122825@news.mmc.org>

On Tue, 17 Mar 1998 16:13:26 -0500, Frank Cortez <cortez@tfn.com> wrote:

>I'm running Perl (v5.004_02) with libnet (v1.0605) on a Windows NT
>4.0 platform.  My question (and it may or may not be Windows-specific):
>
>I'm setting up an intranet and I'd like to be able to FTP files
>between client machines and a server (Server's running Apache 1.3b3,
>BTW).  Each of these machines has a local name (Pong, Jax, etc.)
>that's usually used to refer to them for standard FTP packages.
>However, I'd like to be able to FTP using Net::FTP and haven't
>the foggiest idea of how to refer to the individual machines without
>causing an error.

(snip)

Net::FTP doesn't care doodly-squat about the fact that the target runs a
web server . . . different protocol.

As far as I can tell, Net::FTP uses the same resolver that your other
NT-based IP facilities use. So if you can:

C:\users\default>ftp pong

yadda yadda yadda

You can certainly:

#!perl -w

use Net::FTP;

my $ftp = Net::FTP->new('pong');

yadda yadda yadda

In any event, you would have found the answer quicker if you had simply
tried it . . . :-P

-- 
                           Jeffrey R. Drumm, Systems Integration Specialist
                                  Maine Medical Center Information Services
                                     420 Cumberland Ave, Portland, ME 04101
                                                        drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented." -me


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

Date: 17 Mar 1998 22:55:46 GMT
From: snipp@spd.dsccc.com (Scott Nipp)
Subject: Module for copying directories
Message-Id: <6emv1i$k7t@sun001.spd.dsccc.com>

	I am a Solaris sys admin where I work, and I perform a lot of upgrades
to user's systems.  I am writing a Perl script to automate as much of this as 
possible.  What I currently do is look at the user's writable directories on his
old system to find what I need to bring over to the new system.  Then I either
tar up and ftp across, or cpio the information over to his new system.
	I am looking for two things.  First, any helpful suggestions as to how 
to go about doing this in the most reliable, and robust manner possible.
Second, and more immediately, I would like to find a Perl module, combination
of modules, or chunk of code that does basically the same as the following line.

	find . -print | cpio -pudvm /wherever

	Thanks in advance for the help with this.


--
  Scott Nipp   DSC Workstation Service   Sprint Paranet Technical Analyst
    Phone: 477-9645   Work: snipp@spd.dsccc.com   Home: nipp@swbell.net



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

Date: Tue, 17 Mar 1998 23:19:15 GMT
From: jtalking'nospam'@redshift.com (Jerry Talkington)
Subject: Re: Net::FTP & firewalls?
Message-Id: <350f0447.15271769@news.redshift.com>

Not sure I know what you mean by "socksified", but I have used it to
access files through a netware Ukaih firewall (IP masq. type), with no
problems...

On Mon, 16 Mar 1998 12:27:20 -0700, "Jeffrey W. Kehoe"
<kehoe@fc.hp.com> wrote:

>Does anyone know if the Net::FTP code works transparently with a
>"socksified" ftp installed.  We're trying to utilize ftp to transfer
>files, but we don't want to have to deal with firewalls, etc.   We're
>telling our users that they need to provide a  "socksified" ftp if they
>want to transfer through a firewall.  Is anyone using the Net::FTP in
>this manner?
>
>Thanks in advance,
>Jeff



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

Date: Wed, 18 Mar 1998 01:44:42 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
Subject: Re: parsing perl
Message-Id: <350F25B3.9FB7D26C@usa.net>

I believe you should also look into the 'eval' statement, et al...

Perl code can Eval itself and code embedded into other files :-)
But no, not legal in of itself, not till Perl looks at it :-)

HTH,
Sneex :-)

Rob Collins wrote:

> That's really confusing because it suggests that any text block is
> independently legal as perl code.  It would seem that somehow syntax is really
> only relevant to whatever the text-block translates into, and that those
> op-code syntax-rules cannot for whatever reason be translated upstream, to perl
> code/text.





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

Date: Tue, 17 Mar 1998 07:59:48 -0600
From: sporty@webcreate.net (Sporty)
Subject: Perl Script Challange
Message-Id: <MPG.f783dcf45edb06698968f@newsrv.capital.ge.com>


I would like to know if someone would be willing to 
test a perl script. I have done my best to put it 
together and use it on my web page. It is a guestbook 
that will send me e-mail when someone leave a message.

My ISP has given me a cgi-bin directory on their 
server and "swears" it has the proper permissions.

What I am looking for is someone to take the two files 
I am trying to test (guestbook.html and guestbook.cgi) 
and see if they do work. If they do, then I am sure it 
is nothing wrong with my files.

I would e-mail you the two files... All I can offer in 
return is a cold beer the next time you are in 
Minneapolis.

Thank you for your time

Sporty
sporty@webcreate.net


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

Date: Wed, 18 Mar 1998 01:09:15 +0100
From: Ralph Moch <ralphmoch@swol.de>
Subject: Running CGI-Scripts on a webserver
Message-Id: <350F10AB.8911927@swol.de>

I4ve got a problem concerning cgi-scripts. I use Windows95, with an
webserver simulation tool and perl for win95. The script runs on my home
computer. I4ve placed it now on a webserver with an unix system. Ther
the script doesen4t run.
I hope somebody can give me some advise, post it her or better send me
an email to ralphmoch@swol.de

Thx   Ralph



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

Date: 18 Mar 1998 01:44:04 GMT
From: "Ron Hawkins" <rhawkins@navix.net>
Subject: Re: Running CGI-Scripts on a webserver
Message-Id: <01bd51dd$1e1bc2c0$1bea9ece@hawk233>

You probably need to add the "#!" (pound/bang) line to the top of your
script.  It needs to point to the perl binary.  Here is the line I need at
work:
#!/usr/local/bin/perl

You will have to ask the webmaster for the exact path to perl.

Ron Hawkins
rhawkins@navix.net
http://salesleadsusa.com/

Ralph Moch <ralphmoch@swol.de> wrote in article
<350F10AB.8911927@swol.de>...
> I4ve got a problem concerning cgi-scripts. I use Windows95, with an
> webserver simulation tool and perl for win95. The script runs on my home
> computer. I4ve placed it now on a webserver with an unix system. Ther
> the script doesen4t run.
> I hope somebody can give me some advise, post it her or better send me
> an email to ralphmoch@swol.de
> 
> Thx   Ralph
> 
> 


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

Date: 17 Mar 1998 23:30:50 GMT
From: Tom.Grydeland@phys.uit.no (Tom Grydeland)
Subject: Re: Setting locale failed.
Message-Id: <slrn6gu1ta.i3b.Tom.Grydeland@mitra.phys.uit.no>

On Tue, 17 Mar 1998 16:06:00 -0500,
Brian J.S. Miller <brian@rickjames.sapien.net> wrote:
> can anyone tell me why I get the following errors whenever I run any
> perl scripts? I used to use perl v5.003, and got the same errors
> (although the wording was slightly different)...
> today I upgraded to 5.004, and I'm still getting the following errors:
> 
> perl: warning: Setting locale failed.
> perl: warning: Please check that your locale settings:
>         LC_ALL = (unset),
>         LANG = "us"
>     are supported and installed on your system.
> perl: warning: Falling back to the standard locale ("C").

This means that your LANG environment variable is set to the value "us",
which doesn't correspond to any locale available on your system.

locale -a             tells you which locales are available

man locale
man perllocale

> Brian J.S. Miller

-- 
//Tom Grydeland <Tom.Grydeland@phys.uit.no>


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

Date: Tue, 17 Mar 1998 16:00:11 -0800
From: Barry Brown <bbrown@sna.com>
Subject: Re: splitting by one or more spaces
Message-Id: <350F0E8B.11A83643@sna.com>

The perlfunc man page and Programming Perl is very explicit about this.
Using split with the pattern ' ' (eg, @datele = split(' ',
localtime(time)))
will split on more than one whitespace and will not produce null values
for leading whitespace.

Barry


Adam Carden wrote:
> 
> Why not just use @datele = split (/ /, localtime);
> Then remove and leading or trailing spaces from each element in the array?
> 
> Adam Carden
> ---------------------------------------
> Pacific Artists
> adam@pacific-artists.demon.co.uk
> 
> Oosterom wrote in message <01bd4d3f$bf439e40$0781f1c3@thijs>...
> >Hi,
> >
> >I am trying to extract the date from the localtime value. I have to split
> >this value, but if the daynumber is smaller than 10, there are two spaces
> >before this number in the localtime value. This means I have to split by
> >one or more spaces. The codes below don't work:
> >
> >($day, $month, $daynr, $time, $year) = split (/*\s/, localtime);
> >
> >Any suggestions anyone? Thanks.
> >
> >Thijs.


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

Date: Wed, 18 Mar 1998 01:35:47 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
Subject: Re: trying to rename files in perl
Message-Id: <350F239C.3DA7D818@usa.net>

again, I am afraid to ask - You do have a WEB server running on your
local server?

Right? :-)  And you do have an absolute path to the files?  LIke -
c:/somedir/somotherdir/filename1.blah  ?

Not   /htdocs/filename.blah???

/^Just curious$/;
Sneex :-)

soul@explorer.com wrote:

> >You are not your web server.
>
> OK, sounds realistic, can't find anywhere in IIS2 that lets me
> require a login, but that's a question for another newsgroup...
>
> >Does your web server really have its document space in your
> >filesystem's root?
>
> it's my local development webserver, and has no web ip address.
>
> thanking you.....





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

Date: Tue, 17 Mar 1998 18:21:57 -0500
From: "Shawn M. Kelly" <kellysm@ix.netcom.com>
Subject: Variable question
Message-Id: <350F0595.F41D9E72@ix.netcom.com>

I have a data file that looks like this:

door1    5.0
door2    2.0
door3    7.0
 ....

I'd like to read the data file in and then dynamically assign a variable
with the first field having the value of the second.  So after reading
in this particular file I would have three variable like so:

door1 equals  5.0
door2 equals 2.0
door3 equals 7.0

Can this be done in Perl? If so, can someone either give me an example
or refer me to a book, a web site or a person?

Thank you in advance,

Shawn M. Kelly
Network Administrator
Hydrocarbon Technologies Inc.





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

Date: 18 Mar 1998 00:07:51 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Variable question
Message-Id: <6en38n$3tv$2@marina.cinenet.net>

Shawn M. Kelly (kellysm@ix.netcom.com) wrote:
: I have a data file that looks like this:
: 
: door1    5.0
[snip]
: I'd like to read the data file in and then dynamically assign a variable
: with the first field having the value of the second.  So after reading
: in this particular file I would have three variable like so:
: 
: door1 equals 5.0
[snip]
: 
: Can this be done in Perl? If so, can someone either give me an example
: or refer me to a book, a web site or a person?

It can be done in Perl; the question is whether that's really what you
want.  If all the variables are going to be of the form 'doorN' where N is
a number, I'd suggest storing the mapping in an array or hash.  Even if
not, I'd still suggest storing the whole thing as a hash ($data{door1} =
5.0).  If, however, you really want to turn the file entries into real
variables, the code looks like this: 

  while (<DATAFILE>) {
    my ($name, $val) = split;
    $$name = $val;
  }

The '$$name' part is called a "soft reference" -- see the Camel or other 
Perl doc for more info.  HTH!

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Wed, 18 Mar 1998 01:14:22 -0000
From: "PORTUGAL SYSTEMS" <webmaster@portugalsystems.pt>
Subject: VERY URGENT !!!
Message-Id: <6en743$n3s$1@duke.telepac.pt>

Hello all:
I need to calculate two field on real time, inside a Perl Script. This two
fields are inserted through a Form.
How can I do that ? Adding variable 1 to variable 2 and give a result x ?

Thanks for everyone who can help me

Antonio




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

Date: Tue, 17 Mar 1998 19:24:12 +0000
From: Jeff Potter <jp@glpbooks.BADMAIL.com>
Subject: Wanted: email address gleaner
Message-Id: <350ECDDC.6E6A@glpbooks.BADMAIL.com>

I've heard there are programs that search webpages on the internet
as well as newsgroup posts for email addresses. That's how spam 
is done, right? Well, there are obviously good uses for such progs, too.

I have a textfile archive of email that I need to contact all
the posters about. I need something that will search thru this
file for email addresses. I've been told I need perl or need to
hire someone. But it seems like existing progs should be out
there that *could* do this. Anyone know of any?

The last 'glitch' is that I need this gleaner to also cut the 
text below each email address to include in an autoreply
post to these folks. (Basically, I need to ask permission
to reprint posts.)

-- 

Jeff Potter   jp@glpbooks.BADMAIL.com   delete '.BADMAIL' to reply
***"Out Your Backdoor": Friendly Magazine of DIY Adventure and Culture
       http://www.glpbooks.com/oyb ... with new bookstore & bulletin board


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

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

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