[9342] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2937 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 22 18:07:48 1998

Date: Mon, 22 Jun 98 15:00:32 -0700
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, 22 Jun 1998     Volume: 8 Number: 2937

Today's topics:
    Re: "Code-checker" for Perl. (Tad McClellan)
        -f option in perldoc <aqumsieh@matrox.com>
    Re: -f option in perldoc (Larry Rosler)
    Re: add a record into file DBF with perl (Honza Pazdziora)
        Binmode ("Mark Morgan Lloyd ")
    Re: Errormessage ??? (Bob Trieger)
    Re: Errormessage ??? <psdspss@execpc.com>
    Re: Errormessage ??? <zenin@bawdycaste.org>
    Re: Errormessage ??? (Tad McClellan)
    Re: Find::File/Functional programing <xah@shell13.ba.best.com>
    Re: first language (Aaron Crane)
    Re: Flames.... <ebohlman@netcom.com>
    Re: Flames.... <ebohlman@netcom.com>
    Re: Flames.... (Tad McClellan)
    Re: how can I find out the version of Perl? (Craig Berry)
    Re: how can I find out the version of Perl? (Charles DeRykus)
    Re: How do I know the name of the caller subroutine? (Mike Stok)
    Re: How to do assignment to OLE property with multiple  (Jan Dubois)
    Re: htpasswd in perl? (Bart Lateur)
        Is there any ready for use perl script for this? dubing@lisco.com
        Issuing an HTTP POST from within perl? <mattj@spaatz.org>
    Re: Issuing an HTTP POST from within perl? <ebohlman@netcom.com>
    Re: Issuing an HTTP POST from within perl? <bowlin@sirius.com>
    Re: learning Perl? <wpwang@acsu.buffalo.edu>
        number search <tom@nassaulibrary.org>
    Re: number search (Tad McClellan)
    Re: number search (Craig Berry)
        overriding open -- lets get this settled once and for a <cpandmh@concentric.net>
    Re: pattern and variable question (Tad McClellan)
        Q: Can I run Perl program regularly? <dmgl@dmgl.kirov.ru>
    Re: Q: Can I run Perl program regularly? <psdspss@execpc.com>
    Re: Q: Can I run Perl program regularly? <psdspss@execpc.com>
    Re: Q: Can I run Perl program regularly? <upsetter@ziplink.net>
    Re: Q: Can I run Perl program regularly? (Larry Rosler)
    Re: Sending files via mail in perl <bowlin@sirius.com>
    Re: Sending files via mail in perl <JKRY3025@comenius.ms.mff.cuni.cz>
    Re: sendmail problems (Neil Briscoe)
    Re: Storing and passing object references - html crap <hck@formalsys.ca>
        utime of dbm files mbehr@worldpath.net
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 22 Jun 1998 15:05:59 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: "Code-checker" for Perl.
Message-Id: <7fdmm6.jk8.ln@localhost>

Jan Bessels (j.bessels@telegraafnet.nl) wrote:

: The department I work is looking for a tool to standardize the look and
: Feel of the Perls scripts. They want to standardize indentation of
: constructs, naming conventions etc etc. 

: Anyone with a hint please respond
              ^^^^^^
              ^^^^^^
Well, OK.

One hint is to have a look for *your* Frequently Asked Question in the
list of Perl Frequently Asked Questions. Preferrably *before* posting...



Fellow programmer,

You have asked a question that can be answered by examination of the
documents that come with the Perl distribution:

To wit, Perl FAQ, part 3 should answer your question: 

   "Is there a pretty-printer (formatter) for Perl?"

In order to make this group as useful and full of information as
possible, we strive to keep the easy questions (defined as those
answerable elsewhere) to a minimum, leaving time, bandwith and brain
power to answer the hard ones.

In the future, please take the time to peruse the documents fully before
posting a question. The bandwith you save may be yours. And it has
happened that while reading the docs for one answer, multiple facts have
been learned.

Thanks.
   

   ;-)


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Mon, 22 Jun 1998 14:34:25 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: -f option in perldoc
Message-Id: <358EA3B1.1DA4F4C9@matrox.com>

Hi all,

In many of the replies, I noticed that people use 

% perldoc -f <func>

to search for help on a specific function <func>. So, I tried it .. and
this is what I got:

% perldoc -f stat
Unknown option: f
perldoc [-h] [-v] [-u] PageName|ModuleName|ProgramName...
    -h   Display this help message.
    -t   Display pod using pod2text instead of pod2man and nroff.
    -u   Display unformatted pod text
    -m   Display modules file in its entirety
    -v   Verbosely describe what's going on.
PageName|ModuleName...
         is the name of a piece of documentation that you want to look
at. You 
         may either give a descriptive name of the page (as in the case
of
         `perlfunc') the name of a module, either like `Term::Info', 
         `Term/Info', the partial name of a module, like `info', or 
         `makemaker', or the name of a program, like `perldoc'.
         
Any switches in the PERLDOC environment variable will be used before the 
command line arguments.

Why don't I have the -f option? Do I have an obsolete version of
perldoc?

-- 
Ala Qumsieh		|  No .. not just another
ASIC Design Engineer	|  Perl Hacker!!!!!
Matrox Graphics Inc.	|
Montreal, Quebec	|  (Not yet!)


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

Date: Mon, 22 Jun 1998 14:05:48 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: -f option in perldoc
Message-Id: <MPG.ff86703241fb97c9896b2@nntp.hpl.hp.com>

In article <358EA3B1.1DA4F4C9@matrox.com>, Ala Qumsieh 
<aqumsieh@matrox.com> says...
 ...
> Why don't I have the -f option? Do I have an obsolete version of
> perldoc?

Yes.  Jonathan Stowe sent me a working copy, which I will email to you.

-- 
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Sun, 21 Jun 1998 13:04:00 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: add a record into file DBF with perl
Message-Id: <adelton.898434240@aisa.fi.muni.cz>

[...]

> #!/usr/bin/perl

Hmmm, can't see -w and use strict here. Also no use CGI.

> read(STDIN,$buffer, $ENV{'CONTENT_LENGTH'});
> @pairs = split(/&/, $buffer);
> 
> foreach $pair (@pairs) {
>         ($name,$value) = split(/=/,$pair);
>         $value =~ tr/+/ /;
>         $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
>         $value =~ s/~!/ ~!/g;
>         $FORM{$name} = $value;
> }

Which would save your from all this.

> open(OUTF,">>database.txt");
> print OUTF
> "$FORM{'fieldname1'},$FORM{'fieldname2'},$FORM{'fieldname3'}\n";
> close(OUTF);

But this is not DBF file.

> Thats it. If this helps at all, or even if it doesn't, e-mail me or post a
> response & we'll figure something out. Just include all the neccessary
> info this time! ;-)

I'd say the info was there. He is using Xbase.pm, which is read-only,
and he seeks some write only solution. Which IMHO comes as XBase.pm.

Hope this helps,

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
   Please note that I will be without email access from 22 to 26 June.


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

Date: 22 Jun 1998 22:06:25 +0100
From: mark_tbu@cix.co.uk ("Mark Morgan Lloyd ")
Subject: Binmode
Message-Id: <6mmh0h$fur$1@plutonium.compulink.co.uk>

If I'm doing this:

  while (<STDIN>) {

 ...or this:

  while (<>) {

How do I use binmode on a DOS file? Do I say

  binmode;
  
assuming an implicit default to STDIN or

  binmode STDIN;
  
and if so does that apply to all subsequent input (piped and derived from 
files) or do I have to handle it explicitly for each member of @ARGV?  

The problem is that I've got a simple script to get rid of embedded nulls 
in a text file which is getting messed up by DOS Perl's default handling 
of \r\n.

Mark Morgan Lloyd
mark_tbu@cix.co.uk

[Opinions above are the author's, not those of his employers or 
colleagues]


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

Date: Mon, 22 Jun 1998 20:21:13 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Errormessage ???
Message-Id: <6mmefb$aen$1@ligarius.ultra.net>

[ posted and mailed ]

Thomas Albech <thomas@provideo.dk> wrote:
-> This is a multi-part message in MIME format.
-> --------------6312DE112C3E636811B6042E
-> Content-Type: text/plain; charset=us-ascii
-> Content-Transfer-Encoding: 7bit

Please do not do this! UseNet is text base. We don't need no mime telling us 
that.

-> Hi There,
-> Can anyone help me with this errormessage...
-> 
-> I just bought the Learning Perl from O'Reilly, and typed in the first
-> bit of code and im really lost with this errormessage...
-> 
-> Can't modify scalar safe chop in scalar assignment at ./Get_Name line 4,
-> near ");"
-> Execution of ./Get_Name aborted due to compilation errors.
-> 
-> Here is my code:
-> 
-> #!/usr/freeware/bin/perl
-> print "What is your name? ";
-> $myname = <STDIN>;
-> chomp = ($myname);
-> print "Hello, $myname!\n";

OK, perl is telling you there is an error on line 4. Compare line 4 in the 
book to your line 4, do you see a difference? 

Please double check your work before asking in c.l.p.m

Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-286-0591
  and let the jerk that answers know that his
  toll free number was sent as spam. "


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

Date: Mon, 22 Jun 1998 15:36:42 -0500
From: Deva Seetharam <psdspss@execpc.com>
Subject: Re: Errormessage ???
Message-Id: <358EC05A.F2428AD8@execpc.com>



Thomas Albech wrote:

> Hi There,
> Can anyone help me with this errormessage...
>
> I just bought the Learning Perl from O'Reilly, and typed in the first
> bit of code and im really lost with this errormessage...
>
> Can't modify scalar safe chop in scalar assignment at ./Get_Name line 4,
> near ");"
> Execution of ./Get_Name aborted due to compilation errors.
>
> Here is my code:
>
> #!/usr/freeware/bin/perl
> print "What is your name? ";
> $myname = <STDIN>;
> chomp = ($myname);
> print "Hello, $myname!\n";
>
> Thanks,
> Thomas
>
>   ------------------------------------------------------------------------
>
>   Thomas Albech <thomas@provideo.dk>
>   Crystal Graphics
>
>   Thomas Albech
>   Crystal Graphics    <thomas@provideo.dk>
>   Guldborgvej 3       Work: +54 54 70 71 10
>   DK-4990 Sakskxbing  Fax: +45 54 70 03 10
>                       Netscape Conference Address
>                       Netscape Conference DLS Server
>   Additional Information:
>   Last Name     Albech
>   First Name    Thomas
>   Version       2.1

  chomp is chomping you.
that line should be :
chomp($myname);

You are invoking the chomp function to remove any newline char.
Perl gets confused my "=" between function name and paranthesis.

Hope that helpls.

Deva



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

Date: 22 Jun 1998 20:39:27 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Errormessage ???
Message-Id: <898548480.146392@thrush.omix.com>

[posted & mailed]

Thomas Albech <thomas@provideo.dk> wrote:
: This is a multi-part message in MIME format.
: --------------6312DE112C3E636811B6042E
: Content-Type: text/plain; charset=us-ascii
: Content-Transfer-Encoding: 7bit

	Do not post with "V-Cards", ever.

: #!/usr/freeware/bin/perl
: print "What is your name? ";
: $myname = <STDIN>;
: chomp = ($myname);
: print "Hello, $myname!\n";

  chomp ($myname); # Note no '='

-- 
-Zenin
 zenin@archive.rhps.org


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

Date: Mon, 22 Jun 1998 15:41:13 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Errormessage ???
Message-Id: <9hfmm6.7u8.ln@localhost>

Thomas Albech (thomas@provideo.dk) wrote:
: This is a multi-part message in MIME format.
                               ^^^^^^^^^^^^^^

Whatever for?

Please post plain text like everyone else does...




: #!/usr/freeware/bin/perl

You should always, yes, ALWAYS, enable warnings:

    #!/usr/freeware/bin/perl -w
                             ^^
                             ^^
   

: chomp = ($myname);

   chomp $myname;


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 22 Jun 1998 14:44:44 -0700
From: Xah Lee <xah@shell13.ba.best.com>
Subject: Re: Find::File/Functional programing
Message-Id: <yo3n2b5t8kz.fsf@shell13.ba.best.com>


> Xah Lee wrote:
> > 
> > Is there a way to use File::Find with purely functional style programing?

Someone sends me the answer.

   find(sub{ myFunction($File::Find::name) }, 'path');

Xah Lee wrote:
> > I desire all my codes to be strickly "functional"...

I think John Porter is right, that it's probably not a good idea to force
oneself to functional programing in Perl... unless only for fun...

 Xah, xah@best.com
 http://www.best.com/~xah/PageTwo_dir/more.html
 "Geek boy: "TAMTOWTDI.
 Geek girl: [all smiles]"




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

Date: 22 Jun 1998 15:16:30 -0600
From: aaron.crane@pobox.com (Aaron Crane)
Subject: Re: first language
Message-Id: <dj67ht2l3l.fsf@corsair.rmsq.com>

In article <linberg-2206981242260001@projdirc.literacy.upenn.edu>,
linberg@literacy.upenn.edu (Steve Linberg) writes:
> In fact, I dimly recall Sinclair 1000 BASIC, where you couldn't type
> keywords, each was bound to a key.

A brilliant design idea for a machine with 1024 bytes of RAM: each keyword
is just a keypress, internally and externally, and so takes only one byte of
storage.  The ZX81 manual has detailed explanations of memory usage for your
BASIC source code.

-- 
Aaron Crane   <aaron.crane@pobox.com>   <URL:http://pobox.com/~aaronc/>


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

Date: Mon, 22 Jun 1998 20:07:11 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Flames....
Message-Id: <ebohlmanEuyyK0.AJp@netcom.com>

Chip Salzenberg <chip@mail.atlantic.net> wrote:
: No, that's just plain wrong.  Knowing how to search text files on a given
: platform is such a basic skill that anyone who doesn't know how to do it,
: doesn't think they have to know it, yet demands help from volunteers, is
: just not ready (emotionally and socially, or perhaps educationally) for
: the rigors of programming in Perl or any other language.

Thank you.  The point is that they're *not ready*, not *incapable* or 
*dumb*.  Someone who's trying to learn Perl, but hasn't yet learned his 
way around his operating system (knowing what text files are, knowing how 
directories are organized, knowing how to use a command prompt, knowing 
how to search) is someone who's trying to learn how to run before he's 
learned how to walk.  He's trying to skip necessary steps in a sequence, 
and needs to be told, politely, to pick up the necessary background in 
walking before asking for advice on how to run.



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

Date: Mon, 22 Jun 1998 20:34:02 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Flames....
Message-Id: <ebohlmanEuyzsr.C7C@netcom.com>

Chris Miller <apminc@cvn.net> wrote:
: B) answer something which is so simple it's not worth taking the time to
: browse the faq

I'm sorry, I can't let this one go.  Not worth taking *whose* time?  
Perhaps I misunderstood you, but that sounds to me like "it's not worth 
*me* taking *my* time to browse the FAQ when I can get someone else to 
spend *their* time giving me the answer."  In economics, this is called 
"externalization of costs."  It's precisely the same rationale that 
e-mail spammers use; spamming is a very attractive marketing technique to 
them because they can shift the costs to someone else.  But that doesn't 
mean the costs aren't there.

The problem is that c.l.p.m was set up for a reason, namely for people 
who have at least a basic knowledge of Perl programming to discuss the 
finer points of Perl programming.  They also created a comprehensive set 
of resources (FAQs, documentation, www.perl.com, etc.) to enable people 
who don't yet have that basic knowledge to gain it.  They did *not* set 
up c.l.p.m to serve as a help desk for people who didn't want to take the 
time to use those other resources.  c.l.p.m is a very high-traffic group, 
and while it takes very little time to skip over a *single* help-desk 
request, it takes much more time to skip over a lot of them.

There's another problem which hasn't been discussed much in this thread 
but that, IMHO, creates more trouble than posts asking Perl FAQs: posts 
asking for help on things that have nothing to do with Perl.  By far the 
majority of them are requests for help on configuring Web servers to run 
CGI scripts properly.  There's a reason why newsgroups are organized by 
topic; it's so people who are interested in discussing certain things can 
choose places where they're likely to find similarly-minded people.



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

Date: Mon, 22 Jun 1998 15:46:42 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Flames....
Message-Id: <irfmm6.7u8.ln@localhost>

I R A Aggie (fl_aggie@thepentagon.com) wrote:
: In article <6mlpfl$bf2$1@rand.dimensional.com>, dgris@rand.dimensional.com
: wrote:

: + What is `unrealistic' is the expectation among some that they can
: + enter a professional gathering and expect expert training for free.

: Frame this.
  ^^^^^^^^^^
  ^^^^^^^^^^


   But what if my Perl browser doesn't support <frame>s?

   ;-)


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 22 Jun 1998 20:43:02 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: how can I find out the version of Perl?
Message-Id: <6mmfkm$2hp$1@marina.cinenet.net>

Harri Hatunen (hhh@mail.student.oulu.fi) wrote:
: Is there a way to find oout what version of Perl you have in your machine? 

>From the shell:  perl -v
>From a script:   Special variable $]

---------------------------------------------------------------------
   |   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: Mon, 22 Jun 1998 20:22:55 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: how can I find out the version of Perl?
Message-Id: <EuyzA7.9FM@news.boeing.com>

In article <6mm0hv$rvd$3@ligarius.ultra.net>,
Bob Trieger <sowmaster@juicepigs.com> wrote:
 >[ posted and mailed ]
 >
 >Harri Hatunen <hhh@mail.student.oulu.fi> wrote:
   >-> Is there a way to find oout what version of Perl you have in your machine? 
 >
 >perl -v   oder  perl -V 
 >
 >viel Glueck


oder, viel Glueck... 

Gosh, where did you learn Finnish  :)


--
Charles DeRykus


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

Date: 22 Jun 1998 20:19:12 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: How do I know the name of the caller subroutine?
Message-Id: <6mme80$hh9@news-central.tiac.net>

There's the builtin caller which is described in detail in the perlfunc
man page.

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

sub callee {
  my ($subroutine) = (caller (1))[3];

  $subroutine = "(nowhere ;-)" unless defined $subroutine;
  print "callee called from $subroutine\n";
}

sub bar {
  callee;
}

sub foo {
  callee;
  bar;
}

callee;
foo;

Hope this helps,

Mike

In article <358EA703.1372@iil.intel.com>,
Bekman Stanislav  <sbekman@iil.intel.com> wrote:
>Hi,
>
>I have searched the FAQ and dejanews, but still I don't find the way, to
>know what was the name of the caller subroutine inside the callee
>subroutine.
>
>I know that I can do aaaa(@some_params,'aaaa'), but this is ugly.
>
>There must be a way, since when some error happens perl knows to trace
>the whole list of the subroutines as they have been called starting from
>the first parent down to the errorneous sub.
>
>So is there are any way to do that? Probably some module I don't know
>about...
-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: Mon, 22 Jun 1998 21:55:21 +0200
From: jan.dubois@ibm.net (Jan Dubois)
Subject: Re: How to do assignment to OLE property with multiple params??
Message-Id: <3595b015.8206099@news2.ibm.net>

[mailed & posted]

"Scott T. Prugh" <sprugh@telution.com> wrote:

>I'm using the OLE module to automate some tasks, and I'm having problems
>assigning to properties that have multiple input parameters:
>
>The midl looks like this:
>
>        [id(0x00000001), propput, helpstring("Sets a property value")]
>        void Value([in] BSTR bstrPropName, [in] VARIANT rhs);
>
>I can't seem to get the syntax right to set this property.  The normal
>$obj->{'foo'} does not work.
>
>Essentially, the call I want to make is:
>
>$obj->Value("Name") = "ThisIsSomeText";
>
>This of course cannot be done because you must use the {''} for rvalue
>assignments as per the examples included with the Win32 versions of Perl.
>
>I also tried:
>
>$obj->Value{'Name'} = "ThisIsSomeText";
>$obj->Value("Name","ThisIsSomeText");
>
>But no luck....
>
>Does anyone have any ideas?  I appreciate the help...

You don't say which version of Perl you are using (and consequently if
you are using AS OLE.pm or Win32::OLE)? There might be an
(intentionally) undocumented feature to do this with the ActiveState
module:

Try:

  Win32::OLESetProperty($obj, 'Value', 'ThisIsSomeText', 'Name');

or generically:

  Win32::OLESetProperty($Object, $PropertyName, $NewValue, @Arguments);

You cannot do this with Win32::OLE currently.

I'm curios about the OLE server that needs this. Did you write it
yourself? If you did, why don't you use the more natural

  $obj->{Name} = 'ThisIsSomeText';

and give every property its own dispatch identifier?

-Jan

PS: I'm not arguing that this feature should not be added back to
Win32::OLE. I've just not found an elegant way to do it. Maybe I should
just add the workaround from the AS version.



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

Date: Mon, 22 Jun 1998 20:38:35 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: htpasswd in perl?
Message-Id: <3591c00c.3235247@news.tornado.be>

Randal Schwartz wrote:

>Douglas> Need help with a script I am working on that will create
>Douglas> passwords the same as htpasswd executable.
>
>use HTTPD::UserAdmin; # found in the CPAN

Damn strange name for a module to generate and store encrypted
passwords. 

Why wasn't this called (for example):

	use htpassword;

(for example) ?

	Bart.


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

Date: Mon, 22 Jun 1998 19:45:02 GMT
From: dubing@lisco.com
Subject: Is there any ready for use perl script for this?
Message-Id: <6mmc7u$1vf$1@nnrp1.dejanews.com>

Hello Perl experts,

We would like a perl alias filter, which only alows certain users to Email to
an alias list.	Is there any ready for use perl script for doing this? Or any
perl script for doing the similar thing would be helpful too.

Thanks in advance for your help.

Du,Bing
System Administrator
Computer Science Dept.
Maharishi Univ. of Management
Fairfield, Iowa



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


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

Date: Mon, 22 Jun 1998 13:17:16 -0700
From: Matt Johnson <mattj@spaatz.org>
Subject: Issuing an HTTP POST from within perl?
Message-Id: <358EBBCC.A93CC2AD@spaatz.org>

Is it possible to issue HTTP commands from within perl? I'm trying to
validate some form input off a remote database and need to do this via
HTTP--I can't connect to the database directly. Is there a module that
does this sort of thing?

Matt Johnson
mxjohnso@us.oracle.com



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

Date: Mon, 22 Jun 1998 20:55:13 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Issuing an HTTP POST from within perl?
Message-Id: <ebohlmanEuz0s1.EFB@netcom.com>

Matt Johnson <mattj@spaatz.org> wrote:
: Is it possible to issue HTTP commands from within perl? I'm trying to
: validate some form input off a remote database and need to do this via
: HTTP--I can't connect to the database directly. Is there a module that
: does this sort of thing?

Yup, it's called LWP.



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

Date: Mon, 22 Jun 1998 14:19:45 -0700
From: Jim Bowlin <bowlin@sirius.com>
To: Matt Johnson <mattj@spaatz.org>
Subject: Re: Issuing an HTTP POST from within perl?
Message-Id: <358ECA71.B3D7524C@sirius.com>

Matt Johnson wrote:
> 
> Is it possible to issue HTTP commands from within perl? I'm trying to
> validate some form input off a remote database and need to do this via
> HTTP--I can't connect to the database directly. Is there a module that
> does this sort of thing?
> 
> Matt Johnson
> mxjohnso@us.oracle.com

Run the command "perldoc LWP" to get all the info you need to get started.
If you don't have perldoc, it would make good sense to upgrade your Perl.

-- Jim Bowlin


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

Date: Mon, 22 Jun 1998 16:11:55 -0400
From: Willie P Wang <wpwang@acsu.buffalo.edu>
Subject: Re: learning Perl?
Message-Id: <358EBA8B.EF712057@acsu.buffalo.edu>

Best way to learn anything is to get your hands dirty.  Buy the
following books:

Learning Perl
Perl Programmer's Guide
CGI Programming on the WWW

All are from O'Reilly.  Get yourself the Perl interpreter program at
language.perl.com and play.  Good luck.  And who ever said learning Perl
is easy is dead wrong.

Roelf Pringle wrote:

> Hi (pls mail me)
>
> Whats the best way to learn and create Perl and with what?
>
> Thanks
> Seeker
>
> --
> Email: se11@stocknet.co.za
> Webpage: http://www.geocities.com/SiliconValley/Peaks/9209/
> ICQ number: 4887570
> Country: South Africa



--
_________________________________________________
William P. Wang
Web Developer
Office of Student Affairs
http://www.student-affairs.buffalo.edu/
_________________________________________________




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

Date: Mon, 22 Jun 1998 16:06:21 -0400
From: Tom K <tom@nassaulibrary.org>
Subject: number search
Message-Id: <358EB93C.ADF410D4@nassaulibrary.org>

Greetings All;
     I want to put multiple 5 digit numbers into a data file or in the
program itself....
     I inserted a couple of 5 digit combonations into one line, called
suffix, seperated the
    numbers with a comma, didnt work.  I attemped to simple use a data
file, made a
    reference to file, no dice...

    I need help understanding how a perl script seperates items in a
    single line...    Any and all suggestions welcome....

                                                Thanx;
                                                        Tom





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

Date: Mon, 22 Jun 1998 15:52:56 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: number search
Message-Id: <87gmm6.7u8.ln@localhost>

Tom K (tom@nassaulibrary.org) wrote:
: Greetings All;
:      I want to put multiple 5 digit numbers into a data file or in the
: program itself....
:      I inserted a couple of 5 digit combonations into one line, called
: suffix, seperated the
:     numbers with a comma, didnt work.  I attemped to simple use a data
: file, made a
:     reference to file, no dice...

:     I need help understanding how a perl script seperates items in a
:     single line...    Any and all suggestions welcome....



Uhhh...

Did you forget to include the code that's not working? 


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 22 Jun 1998 21:22:39 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: number search
Message-Id: <6mmhuv$4q6$1@marina.cinenet.net>

Tom K (tom@nassaulibrary.org) wrote:
: I want to put multiple 5 digit numbers into a data file or in the
: program itself....

OK, you can do that.

: I inserted a couple of 5 digit combonations into one line, called
: suffix, seperated the numbers with a comma, didnt work.

What, your comma key is broken?  "Didn't work" isn't a lot to go on.  Show
us the code!

: I attemped to simple use a data
: file, made a reference to file, no dice...

Unless you get Perl support from Psychic Friends Network, you'll really
have to tell us more about what you tried and what happened when you tried
it.

: I need help understanding how a perl script seperates items in a
: single line...

Pretty much however you tell it to, and I'm not being facetious saying
that.  Now the issue is how to tell Perl what you want to do, and that
involves your having a clearer idea of what you want to do, first.

: Any and all suggestions welcome....

Hope this helps you better characterize the problem.

---------------------------------------------------------------------
   |   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: 22 Jun 1998 16:45:28 EDT
From: Chris Pollitt <cpandmh@concentric.net>
Subject: overriding open -- lets get this settled once and for all
Message-Id: <6mmfp8$4ji@examiner.concentric.net>

Hello,

What I'd like to write is a module that intercepts calls to open()
and checks to see if the file about to be opened is a gzipped file
and if so, gunzip it 'on the fly' using zcat.

Here is my umteenth attenpt that still doesn't work:

===============================================================================
package gzopen;
#
# automatically expand a file on the fly
#
require 5.000;
use vars qw($VERSION @EXPORT @EXPORT_OK $AUTOLOAD @ISA);
use Carp;
use Symbol;
use SelectSaver;
require Exporter;
require DynaLoader;
@ISA = qw(Exporter DynaLoader);
$VERSION = "1.00";
@EXPORT = ('open');
#
sub open
{
  local(*FH, $path) = @_;
  my ($file);
  my ($type);

  $file = $path;
  $file =~ s!^[+><]+!!;
  $type=(`file "$file" 2> /dev/null`)[0];
  if($type =~ m<:\s+gzip>)
  {
    return(CORE::open(FH,"zcat $file |"));
  }
  else
  {
    return(CORE::open(FH,$path));
  }
}

1;
===============================================================================

I realize that this is not perfect but it's just a rough draft.
Any help would be apreciated.

Thanks
  -Chris



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

Date: Mon, 22 Jun 1998 15:51:46 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: pattern and variable question
Message-Id: <25gmm6.7u8.ln@localhost>

Sylvain Juneau (sjuneau@microtec.net) wrote:

: I have a variable called $last_line = 

: and I would like to test this variable using a matching pattern like
: /GRB/ 

: something like this:

: if ( $last_line has this pattern /GRB/) {print "SUCCES"}
: else{print "FAIL"}


   if ($last_line =~ /GRB/)
      {print "SUCCES"}      ; sic
   else
      {print "FAIL"}


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Tue, 23 Jun 1998 01:24:25 +0400
From: "D" <dmgl@dmgl.kirov.ru>
Subject: Q: Can I run Perl program regularly?
Message-Id: <358ecba4.0@rapeme.kirov.ru>

Dear Sir/Madam

How can I make a program that can run my Perl program regularly (daily)?

Thanks in advance

Best wishes




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

Date: Mon, 22 Jun 1998 16:36:23 -0500
From: Deva Seetharam <psdspss@execpc.com>
Subject: Re: Q: Can I run Perl program regularly?
Message-Id: <358ECE56.91025515@execpc.com>

D wrote:

> Dear Sir/Madam
>
> How can I make a program that can run my Perl program regularly (daily)?
>
> Thanks in advance
>
> Best wishes

  If u are on UNIX, use cron to schedule a job.



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

Date: Mon, 22 Jun 1998 16:36:45 -0500
From: Deva Seetharam <psdspss@execpc.com>
Subject: Re: Q: Can I run Perl program regularly?
Message-Id: <358ECE6D.17AF03B0@execpc.com>

D wrote:

> Dear Sir/Madam
>
> How can I make a program that can run my Perl program regularly (daily)?
>
> Thanks in advance
>
> Best wishes

  If u are on UNIX, use "cron" to schedule a job.

Hope that helps

Deva



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

Date: 22 Jun 1998 21:35:40 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: Q: Can I run Perl program regularly?
Message-Id: <6mminc$3d2@fridge.shore.net>

D <dmgl@dmgl.kirov.ru> wrote:
: Dear Sir/Madam

: How can I make a program that can run my Perl program regularly (daily)?

If you're on Unix, check out the man pages for cron and crontab.

--Art

(nonexistent newsgroup removed from header)

--------------------------------------------------------------------------
                    National Ska & Reggae Calendar
            http://www.ziplink.net/~upsetter/ska/calendar.html
--------------------------------------------------------------------------


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

Date: Mon, 22 Jun 1998 14:53:04 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Q: Can I run Perl program regularly?
Message-Id: <MPG.ff8721bf261c64b9896b3@nntp.hpl.hp.com>

In article <6mminc$3d2@fridge.shore.net>, Scratchie 
<upsetter@ziplink.net> says...
> D <dmgl@dmgl.kirov.ru> wrote:
> : Dear Sir/Madam
> 
> : How can I make a program that can run my Perl program regularly (daily)?
> 
> If you're on Unix, check out the man pages for cron and crontab.

And if you're on Windows/DOS, look at 'at /every:...'.

-- 
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Mon, 22 Jun 1998 14:17:10 -0700
From: Jim Bowlin <bowlin@sirius.com>
To: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Sending files via mail in perl
Message-Id: <358EC9D6.16889B1B@sirius.com>

Tom Christiansen wrote:

> That's what sendmail would do for you -- if one were to use it.  But if
> you get an address joe@blow.com, and then just blindly try to connect
> to that host's SMTP port, you're really making a mistake.
     ^^^^^^^^^^^^^^^^^^^^^

That's right. The way I use SMTP is to connect to the SMTP server
provided by my ISP, which takes care of the queueing of files, remote 
failures, etc.  If you try to connect to my ISP's SMTP server, the
connection will be refused.  I have used both SMTP and sendmail.
The only difference I have found is that sendmail runs on the local
machine and SMTP can run either on the local machine or a remote
machine.  If you have a decent connection to the machine running
the SMTP server, it is as problem free as sendmail regardless of
the final destination of the email message.

-- Jim Bowlin


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

Date: Mon, 22 Jun 1998 23:25:12 -0700
From: Jan Krynicky <JKRY3025@comenius.ms.mff.cuni.cz>
Subject: Re: Sending files via mail in perl
Message-Id: <358F4A48.25F1@comenius.ms.mff.cuni.cz>

> In comp.lang.perl.misc, 
>     Jan Krynicky <JKRY3025@comenius.ms.mff.cuni.cz> writes:
> :> What about queueing?  What about temporary failures?  What
> :> about MX records?  
> :
> :Shouldn't the server take care of this for me?
> 
> That's what sendmail would do for you -- if one were to use it.  But if
> you get an address joe@blow.com, and then just blindly try to connect
> to that host's SMTP port, you're really making a mistake.
> 
> --tom

Yes, I agree. I didn't recomend trying to contact blow.com
nor the server specified by the MX record for the domain.

I always contact my LOCAL SMTP server. 
If the computer where your script runs has an SMTP daemon 
you should use that one, if it doesn't you should use the one nearest 
to you. Eg. if I want to send a mail message from the computer
I'm using just now (comenius-xx.ms.mff.cuni.cz - Win95) I would contact
comenius.ms.mff.cuni.cz, which is the local Novell server.

Jenda


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

Date: 22 Jun 1998 21:49:15 GMT
From: neilb@zetnet.co.uk (Neil Briscoe)
Subject: Re: sendmail problems
Message-Id: <memo.19980622224912.49629A@skep.compulink.co.uk.cix.co.uk>

In article <m3d8c2e4pq.fsf@mail.biol.sc.edu>, dean@mail.biol.sc.edu (Dean
Pentcheff) wrote:

> neilb@zetnet.co.uk (Neil Briscoe) writes:
> > In article
> > <Pine.GSO.3.96.980620230148.4272D-100000@user2.teleport.com>,
> > rootbeer@teleport.com (Tom Phoenix) wrote:
> > > On Sun, 21 Jun 1998, Sifu Hall wrote:
> > > > The form processes fine but the email message is never sent.
> ...
> > Well, its either that, or use the Net::SMTP module, and you could
> > talk in
> > native protocol rather than worrying about program switches.
> >
> > If you can't get that to work having read the documentation, at least
> > you
> > can ask a Perl related question.
>
> I'm continually mystified as to why people suggest using Net::SMTP as
> a reasonable way for a Perl program to send an email message.  On the
> surface of it, it looks like a good idea: "Hey, I could call that
> external sendmail program (about which I'd have to read a nasty manual
> page), or I can cut to the chase and do the job internally with
> Net::SMTP -- much cooler!"
>
> The trouble with that approach, of course, surfaces the first time one
> tries to send a message to a mail host that's inaccessible for an hour
> or two.  Unless one really wants to write a mail spooling routine.  Or
> tries to send to a mail address handled using an MX record.  Right-o.
> At which point, sendmail starts becoming much more attactive...
>

Who needs to write a spooling routine?  You get it to talk to your local
mail server.  If it can't send the mail to the target, for whatever
reason, it will spool the mail for the length of time its administrator
has set it for.

Regards
Neil



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

Date: Mon, 22 Jun 1998 17:39:21 -0300
From: Colin Kilburn <hck@formalsys.ca>
Subject: Re: Storing and passing object references - html crap
Message-Id: <358EC0F9.C845DB23@formalsys.ca>

> :I wasn't careful
> :<BR>enough with the non persistant data (references).
>
> Your newsbrowser is broken.  Please fix it.  We don't need or want
> this kind of pseudo-html crud.  It's really lame.
>
> --tom
> --
>     "Sometimes the sins of the fathers are visited on the nephews and nieces."
>         --Larry Wall

Indeed.
Sorry for the slip.
Why the hell does Netscape let you send HTML
and text at the same time anyway?

# Blackboard
use strict;
my @PerlMasters = qw(Larry_Wall  Tom_Christiansen  Randal_Schwartz);
for(1..100) { print "Sorry $PerlMasters[1], I will not do that again ! \n" }
__END__



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

Date: Mon, 22 Jun 1998 19:59:54 GMT
From: mbehr@worldpath.net
Subject: utime of dbm files
Message-Id: <6mmd3q$2sc$1@nnrp1.dejanews.com>

Hi,

I am trying to a monitor a dbm (Apache password) file to determine when it
changes so that I can copy the changed file to another server. Several
programs (in addition to Apache) frequently open this file for read access
[dbmopen(% HASH,$file,undef)].

The database is only being updated about once every 30 minutes by yet another
program.

My problem is that it I have a program that runs out of cron that compares the
file size and modification dates (against the file that that it last copied)
and it appears that the utime of the original file is always changing.

    ($osize,$omtime) = (lstat("$masterfile"))[7,9];
    ($ssize,$smtime) = (lstat("$controlfile"))[7,9];

Should opening or reading a dbm .(pag|dir)$ file cause the mtime to change?

Thanks!

Marc

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


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

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

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