[8616] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2233 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 2 12:08:39 1998

Date: Thu, 2 Apr 98 09:00:27 -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           Thu, 2 Apr 1998     Volume: 8 Number: 2233

Today's topics:
    Re: Can I prevent MSIE 4 from erasing all fields when B <rootbeer@teleport.com>
        dbi/dbd/oracle on NTs4 <robmoral@cisco.com>
    Re: Diddling with search engines via CGI (John Klassa)
        File Comparison on NT? <gprasad@ti.com>
    Re: File locking (Rob Greenbank)
    Re: foreach loop & current element index <jefpin@bergen.org>
    Re: HELP !!! - Templates within Perl <jhoglund@mirage.skypoint.net>
    Re: how to count a list of comma sep. items (Andrew M. Langmead)
    Re: How to pass user_name and password to each perl CGI <rootbeer@teleport.com>
    Re: Is there a "Newsgroup" for Newbies to Perl? <keithmur@mindspring.com>
        Modelling Perl Applications <newspost@dyna-cs.demon.co.uk>
        Multidimensional Arrays <kkalaitz@cisco.com>
    Re: Munging addresses (was: Re: Perl Cgi Questions) (Greg Bacon)
    Re: Munging addresses (was: Re: Perl Cgi Questions) (John Stanley)
    Re: password input (Mike Wescott)
    Re: Purify Run on Perl5.004_04 Solaris 2.5.1(sparc) (Abigail)
        searching for a pattern <umm@dei.unipd.it>
    Re: searching for a pattern <jdporter@min.net>
    Re: sending mail using perl <rootbeer@teleport.com>
    Re: sending mail using perl <jdporter@min.net>
    Re: Someone put my munged e-mail address on a spam list (Ken Fox)
    Re: Tying a blessed hash (was: Re: Tie/bless vs. bless/ <jdporter@min.net>
    Re: undefine variables <jdporter@min.net>
    Re: undefine variables <rootbeer@teleport.com>
        upload a file to ftp site (victor wasloki)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Thu, 2 Apr 1998 08:25:10 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: larrymcp@hotmail.com
Subject: Re: Can I prevent MSIE 4 from erasing all fields when Back is pressed?
Message-Id: <Pine.GSO.3.96.980402082157.6466E-100000@user2.teleport.com>

On Wed, 1 Apr 1998 larrymcp@hotmail.com wrote:

> Subject: Can I prevent MSIE 4 from erasing all fields when Back is pressed?

If you can, there's nothing Perl-specific about it. MSIE has no idea
whether the remote client is programmed in Perl, COBOL, or Telnet. But the
folks in a newsgroup about browsers may have some suggestions. Good luck!

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



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

Date: Thu, 02 Apr 1998 11:07:32 -0500
From: Roberto Morales <robmoral@cisco.com>
Subject: dbi/dbd/oracle on NTs4
Message-Id: <3523B7C3.E6130EE4@cisco.com>

I am trying to implement dbi/dbd/oracle on an NTs4 box connecting to an
Oracle 7 database on a SUN box.

I installed and tested the sarathy port 5.004_02.
Then I installed dbi.pm 0.93, dbd.pm 1.9, oracle.pm 1.47, and oraperl.pm
1.35.
Nothing works. I run the test.pl's that come with dbd and dbi and get
the dreaded "can't find loadable object" error:

############
install_driver(Oracle) failed: Can't find loadable object for module
DBD:Oracle in @INC(e:\perl e:\perl\lib e:\perl\liba\site .) at (eval 3)
line 2

Perhaps DBD::Oracle was statically linked into a new perl binary.
In which case you need to use that new perl binary.
    DBI::install_driver('DBI', 'Oracle') called at
e:\perl\lib/Oraperl.pm line 58
    require Oraperl.pm called at (eval 2) line 1
    main::BEGIN() called at e:\perl\lib/Oraperl.pm line 0
    eval(...) called at e:\perl\lib/Oraperl.pm line 0
    eval 'use Oraperl; 1 ;' called at E:\perl\scripts\dbi\test.pl line
38
    BEGIN failed--compilation aborted at (eval 2) line 1.
############

I guess I have two questions:
1. Has ANYONE with my similar setup managed to install the above
mentioned modules and perl version, and successfully connected to an
Oracle 7 database?
2. Has anyone (and I know you're out there) built/recompiled perl to
achive dynamic linking using VisualC++4.0 from the Sarathy version?

I have used perl for a couple of years and consider myself quite
proficient, but I have NEVER had to build perl because all the modules
have worked great by simply plunking them in the appropriate directory.
I read Sarathy's readme files for building but he refers to a makefile
file in the Win32 subdirectory and it simply is not there! All I see are
config.mk and startup.mk in the Startup directory, macros.mk and
recipes.mk in the Win32 subdirectory, and macros.mk in the Microsoft
sub-subdirectory.
I am at the end of my rope and have to get to this Oracle database from
my NT server. Any help STRONGLY appreciated.

TIA

berto



     ||        ||
    ||||      ||||
 ..:||||||:..:||||||:..
Roberto Morales
IS-RTP/Webmaster - Cisco Systems, Inc.
robmoral@cisco.com
919-472-3930(Phone)  919-472-3700(Fax)
7025 Kit Creek Road
PO Box 14987
Research Triangle Park, NC 27709




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

Date: 2 Apr 1998 16:10:45 GMT
From: klassa@aursgh.aur.alcatel.com (John Klassa)
Subject: Re: Diddling with search engines via CGI
Message-Id: <6g0da5$a41$1@aurwww.aur.alcatel.com>

On Wed, 01 Apr 1998 21:46:48 GMT, synic@omen.net.au wrote:
->Tom Phoenix <rootbeer@teleport.com> petulantly snorted to
->comp.lang.perl.misc..
-> ...
->Rather than sounding like a spoilt child, you could have helpfully suggested:
->"This has nothing to do with Perl, but, try asking the various companies who
->write these search engines. It's all pretty engine-specific."
-> ...
->And here: "This has nothing to do with Perl, but, you may have better success
->on one of the groups in comp.infosystems.www.authoring.*."
-> ...
->And the URL might have helped for that. Yes, you might know exactly what and
->where CPAN is, but, most newbies probably think a CPAN is what you cook potato
->chips on.
->
->http://www.perl.com/CPAN/
->
->If you're going to answer them at all, don't intentionally confuse 'em (as
->much as it may puff your shirt to do so). Pointlessly pratty answers are worse
->than no answers at all, IMHO.

So Tom (Phoenix, in this case :-)) should spend extra time answering the
same questions over and over again.  How many times does somebody have to
say "go to comp.infosystems.www.authoring.*", for example?  To say that
the question has nothing to do with perl is correct and to the point, and
doesn't waste a lot of time.

I'm with Tom.

-- 
John Klassa / Alcatel Telecom / Raleigh, NC, USA <><


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

Date: Thu, 02 Apr 1998 10:54:59 -0600
From: Gowri Prasad Gandluri <gprasad@ti.com>
Subject: File Comparison on NT?
Message-Id: <3523C2E3.55594642@ti.com>

Is there a way to efficiently compare two sorted files
and get a list of lines that are unique to one of those two
files ? I am talking about doing this on NT.

Thanks for any ideas.
Prasad



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

Date: Thu, 02 Apr 1998 16:49:29 GMT
From: rob@frii.com (Rob Greenbank)
Subject: Re: File locking
Message-Id: <3523bf06.152573125@news.frii.com>

On 01 Apr 1998 17:05:47 -0500, Jonathan Feinberg <jdf@pobox.com>
wrote:

>prn@bsu.edu (Paul Neubauer) writes:
>
>> It appears that the "normal" idiom for locking would go something like:
>> 
>> 	open FH, ">$filename" or die("can't open $filename : $!");
>> 	flock (FH, LOCK_EX);
>> 	...print stuff to file ...
>> 	flock (FH, LOCK_UN);
>> 	close FH;
>
>No; do not explicitly unlock your file.  Simply close it, which will
>safely remove the lock.

AMEN!  My first use of locking was to update a sequence number to
uniquely identify emails generated from a form.  Using the unclock
(flock(..., LOCK_UN) before the close gave me a sequence (in my test
program) that looked something like "1 1 2 2 3 3".  Removing the
unlock fixed the problem. 

I suspect what happened was the unlock hadn't flushed the output
buffer, so the waiting process grabbed the old one.  Does anyone know
if using unbuffered I/O would have fixed the problem?  I've written
programs in other languages where a shared file was kept open and
periodically locked/updated/unlocked.  

The Perl man page un "flock" should be updated.  That's where I
usually look first, and it lead me down the wrong path.  It implies
you should use an unlock step.  The FAQ (perlfaq5) clearly tells you
NOT to use unlock.

	Rob Greenbank



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

Date: Thu, 2 Apr 1998 10:26:07 -0500
From: Jeff Pinyan <jefpin@bergen.org>
To: alexx@psu.edu
Subject: Re: foreach loop & current element index
Message-Id: <Pine.SGI.3.95.980402102433.27534A-100000@vangogh.bergen.org>

>Just a quick question - I guess a for loop might be a better way to go
>about this, but a student asked the question and I want to be sure when
>I say "There is no way to do this".
>
>The question was:  "When in a foreach loop, is there a special variable
>or perl function that can be used to determine the index of the current
>array element?"
>
>I mentioned the ability to assign the array to a scalar to determine the
>number of elements in the array and then use a for loop in conjunction
>with its index to keep track of the current position in the array, but
>he "just wanted to know".  I don't think there is a way to do what he
>asked, but I figured that if there were, at least one person on this
>newsgroup would know!

This question simultaneously came up in the #perl channel on EFnet.
Currently, there are _no more_ puncuation variables left... they've all
been used up (from $` to $?).  So currently, it can't be done.  However,
certain variables are deprecated in perl5 -- $* for example -- and so, it
may be possible in perl5.005 to do what you ask.

--
She turned me into a newt... I got better.
	                             - John Cleese (Monty Python)
Jeff Pinyan | users.bergen.org/%7Ejefpin | techmaster@bergen.org
ICQ# 10222129 | 10222129@pager.mirabilis.com | qw[jeff] on EFnet
&jp('"($``','','$)EDF8```','$*52J4```','$+E1G4```','#J``@','#2__`');sub
  jp{for$w(@_){$_=unpack('B48',unpack('u',$w));$c=~tr/10/# /;print;}}



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

Date: 2 Apr 1998 16:05:13 GMT
From: Jamie Hoglund <jhoglund@mirage.skypoint.net>
Subject: Re: HELP !!! - Templates within Perl
Message-Id: <6g0cvp$s10$3@shadow.skypoint.net>

In comp.lang.perl.misc T. de Konink <tkonink@horizon.nl> wrote:
: Hi,

: I'm looking for a way of using HTML templates within Perl CGI-scripts,
: so I can isolate HTML-code (for script-output) from the script-source.
: The problem is that the (html-)output contains some variables, which are
: used inside the script.

: Do you know how to do this (if there is any way of using templates
: within Perl) ?


For one more, have a look at http://www.lecart.com 
http://www.lecart.com/cgi-bin/template.pl/I200  for a demo.

It &INC{}'s templates within each other recursively, has variabls etc..
kind of grotty syntax though. (and the "functions" can't be nested)

Since it's not a module you'll need to strip out the &Fetchmsg & friends
functions though. :-(

Feel free to rip it apart, modify & season to taste if you want. (heck,
thats what I did. :-) )

Jamie


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

Date: Thu, 2 Apr 1998 16:46:51 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: how to count a list of comma sep. items
Message-Id: <EqspA3.Js0@world.std.com>

"Tony Reeves" <areeves1@csc.com> writes:

>I have a list of items that looks like this:

>item, item1, item2, item3, item4

>The list can be from one to 10.

>I know I can use split to put them into separate variables, but how do I
>know how may I got?  is there a easy way to count the number of items then
>store them in a assoc array?

You can use keys in a scalar context to determine the number of keys
in a hash.

When you split() the string, you can also assign the result to an
array and when you use an array name in a scalar context, it will
return the number of elements in the array. 

If you want the index to be the item in the list, you are better off
using a numerically index array, rather than a hash.

@items = split /\s*,\s*/, $scalar_containg_list;
$count = @items;

-- 
Andrew Langmead


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

Date: Thu, 2 Apr 1998 08:45:33 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Rich Tsui <tsui@cbmi.upmc.edu>
Subject: Re: How to pass user_name and password to each perl CGI script?
Message-Id: <Pine.GSO.3.96.980402084439.6466G-100000@user2.teleport.com>

On Wed, 1 Apr 1998, Rich Tsui wrote:

> how I can pass the user name and password into different perl CGI
> scripts? 

The same ways that are available if the scripts aren't written in Perl.
The folks in a newsgroup about CGI scripting should be able to help you.
Good luck!


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



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

Date: Thu, 02 Apr 1998 12:04:01 -0600
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <3523D310.DBCB4F6A@mindspring.com>

I R A Aggie wrote:
> 
> In article <35227297.BF419C8C@mindspring.com>, keithmur@mindspring.com wrote:
> 
> + Not taking sides on what happened, didn't happen (how could I, not being
> + there?), but I'd just like to share one of my few insights gained in
> + life:
> 
> Oh, yes you did. Take sides, that is.
>
NO I DID NOT.
 
> [list of behaviours]
> 
> + Not saying any of this applies to Randal Schwarz, for whom I have the
> + greatest respect.
> 
> With all due respect, you have. Maybe not directly, but you sure have
> left it hanging in the breeze for anyone with two brain cells to
> rub together to figure it out. Even clueless newbies who can't
> 'perldoc perlfaq' can figure it out...



> 
OK, figured someone would think I was being disingenuous here, which is
why I hesitated posting, or thought about adding some more explanation.

I'm only going to say this once:

When I saw Randal Schwarz' reply, I was reminded of persons that I have
known who *are* intimidating and somehow expect people to clue them in
on that fact.  It struck me so forcefully that I wanted to post a
comment about it.

I did not imply and do not wish to imply that Randal Schwarz actually
was or is intimidating.  That is in the "if the shoe fits" category,
very strictly interpreted.

The next question would be, "If that is the case, what was even the
relevance of your post?"  Right?  OK:

(1) It applies to Randal Schwarz' response to the post.  He seemed to
expect to be confronted by evidence of his low tolerance for "stupid"
questions.  I was pointing out that that's a bit of an unrealistic
expectation, and that if he wasn't confronted, it wasn't very good
evidence that it wasn't true.  

(2) It can be applied to life in general. (OK, off-topic, and we can't
have that here, right?  :-))

OK?  Or if someone "rubs two brain cells together" and decides Randal's
intolerant, am I responsible for that?  Oh, well...  must mean they've
only got two to rub...

>Followups set appropriately...

Hmmm, must be running scared.


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

Date: Thu, 2 Apr 1998 17:34:32 +0100
From: "Garry Goodwin" <newspost@dyna-cs.demon.co.uk>
Subject: Modelling Perl Applications
Message-Id: <891535569.1602.0.nnrp-01.9e98773b@news.demon.co.uk>

I have developed a small app using perl-win32 for my University Major
Project.

I want to draw a diagram of how data is passed between the 6 perl scripts.
What is the preffered method?  People have suggested, Idef0, DFD's or simple
flow chart.  Is there a modelling technique that is most suitable to the
nature of perl applications.

I have noticed that no perl book covers this - it seems nobody ever designed
a perl script before, they were all just hacked together!


Garry Goodwin




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

Date: Thu, 02 Apr 1998 08:35:04 -0800
From: Konstantin Kalaitzidis <kkalaitz@cisco.com>
Subject: Multidimensional Arrays
Message-Id: <3523BE38.600B@cisco.com>

Hello,
How can I create a multidimensional array?
I wrote the very short script shown below, but I get errors:

"multidim.pl" [Read only] 5 lines, 148 characters
     1  #!/usr/bin/perl
     2  $multidim = [['1.1', '1.2', '1.3] , ['2.1', '2.2','2.3']];
     3  print  "$multidim->[0][2]\n";
     4  print  "$multidim->[1][1]\n";
~

When I run the above script, I get:
parse error in file ./multidim.pl at line 2, next 2 tokens "= ["
EOF in string at ./multidim.pl line 2.

Can anyone help this amateur?

Thanx
Konstantin :-)


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

Date: 2 Apr 1998 16:37:12 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: Munging addresses (was: Re: Perl Cgi Questions)
Message-Id: <6g0ero$l7u$3@info.uah.edu>

In article <3522a9b9.1226655@news.omen.net.au>,
	UCE-trap_synic@omen.net.au (Peter Caffin) writes:
: Greg, whether or not someone CC's someone else or whatnot doesn't mean
: a stuff to the NNTP email spider. 

My point was that if someone placed an address in a Cc: header, chances
are fairly good that they will have unmunged it.  All the messages
before and since from the munging poster might as well have had the
authenticated address of the originator as the RFCs call for because
the address harvesters will have captured a decoded version.

: :Lazy?  Are you lazy because you would probably object to dialing a
: :telephone number along with its length and the sum of the digits
: :modulo ten?
: 
: Not even vaguely similar.

That's it?  Do you really think being dismissive weakens another's
position?  Would you like another analogue for the highly annoying
practice of munging?  Consider if people began munging their phone
numbers in the phone book.  Some mungers may or may not provide the
method for decoding.

The simple fact is that when you place an address in a From: header,
you are implicitly saying that the address is an authenticated
address.  You munge, you lie.

: This is a boring topic, IMHO.

Well, everyone, let's make room for the weary sophisticate.

Greg
-- 
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF


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

Date: 2 Apr 1998 16:58:45 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Munging addresses (was: Re: Perl Cgi Questions)
Message-Id: <6g0g45$afl$1@news.orst.edu>

In article <6g0ero$l7u$3@info.uah.edu>, Greg Bacon <gbacon@cs.uah.edu> wrote:
>In article <3522a9b9.1226655@news.omen.net.au>,
>	UCE-trap_synic@omen.net.au (Peter Caffin) writes:
>: :Lazy?  Are you lazy because you would probably object to dialing a
>: :telephone number along with its length and the sum of the digits
>: :modulo ten?
>: 
>: Not even vaguely similar.
>
>That's it?  Do you really think being dismissive weakens another's
>position?  

When one dismisses a failed analogy, yes, that weakens the position of
the person who used the failed analogy.

>Would you like another analogue for the highly annoying
>practice of munging?  Consider if people began munging their phone
>numbers in the phone book.  Some mungers may or may not provide the
>method for decoding.

A much better analogy. Now consider three things. First, nobody is
forcing you to phone anyone. If you decide you want to phone someone,
it is your decision and they are not required to give you their number
so you can do it. In fact, it would be painfully obvious if someone put
a munged phone number in the phone book that they did NOT want you to
call them unless they gave you their real number. Second, many people
already bypass the charges for unlisted numbers by using fake names, so
golly, munging is already going on in the phone book. Do you complain to
the phone company when you can't locate someone's number in the book?

And third, address munging in USENET became common precisely because
people started using it like a phone book, something that USENET was
not intended to be.

>The simple fact is that when you place an address in a From: header,
>you are implicitly saying that the address is an authenticated
>address.  You munge, you lie.

You are inferring it. In fact, the news system does absolutely nothing
to validate or authenticate this address; something that it certainly
would be doing IF the claim that munging an address broke something was
true.  Apparently it does not break anything or there would be tests
for them just as there are tests for invalid dates.




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

Date: 02 Apr 1998 10:51:43 -0500
From: wescott@cygnus.ColumbiaSC.NCR.COM (Mike Wescott)
Subject: Re: password input
Message-Id: <x44t0cql0w.fsf@cygnus.ColumbiaSC.NCR.COM>

In article <slrn6i5tkm.22.jgloudon@manitoba.bbn.com> jgloudon@manitoba.bbn.com (Jason Gloudon) writes:

> RayG <rgoldber@eb.com> wrote:
>> I have a script that prompts for a username and password. It would
>> obviously be a good idea if the password were not echoed to the screen. Is
>> there a function or module out there that will echo your choice of
>> character whenever a character is input? I know there are at least two
>> different modules that let you turn echoing off, but I want to echo *'s
>> instead.

> Use Term::Readkey to enter cbreak mode and read each character yourself using
> getc() or ReadKey() and echo the *'s yourself. This mode is somewhat
> messy as you have to then deal or not deal with backspace/delete.

> Normal UNIX login just uses noecho mode because then it doesn't have to deal
> with backspace/delete - the terminal driver does.

Moreover, echoing * is not really a good idea (from a security point
of view). A third party can easily see the number of characters in the
password. This is information that can be used to reduce the search for
the password. While there are other important considerations about password
security, there is no point in an application gratuitously giving away
the password's length.

-- 
	-Mike Wescott
	 mike.wescott@ColumbiaSC.NCR.COM


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

Date: 2 Apr 1998 15:57:50 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Purify Run on Perl5.004_04 Solaris 2.5.1(sparc)
Message-Id: <6g0chu$k0v$1@client2.news.psi.net>

Andrew E Page (aep@world.std.com) wrote on MDCLXXIV September MCMXCIII in
<URL: news:EqrCF4.89n@world.std.com>:
++ 
++     I ran Purify on perl5.004_04 while doing a 'make test'.
++ The results were pretty clean, but it still turned up
++ a few things that someone might want to look at.  
++ Is there anywhere I can send the exported purify logs?


This is scary.... I read your message, I am about to suggest the p5p
mailinglist, and right at that moment I've a mail arriving from p5p titled
'Purify Run on Perl5.004_04 Solaris 2.5.1(sparc)'



Abigail
-- 
perl  -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
          for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
          print chr 0x$& and q
          qq}*excess********}'


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

Date: Thu, 2 Apr 1998 13:47:38 +0200
From: Nardin Gianluca <umm@dei.unipd.it>
Subject: searching for a pattern
Message-Id: <Pine.SOL.3.96.980402134015.3487A-300000@horus>

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

---559023410-851401618-891517658=:3487
Content-Type: TEXT/PLAIN; charset=US-ASCII

i've got a problem, parsing a string.
I call the subroutine "href" you can see in the file "src" foreach line of
an html file.
but, when i launch the program, it found only the last pattern, in the
string. How to remedie?
Please, answer me via email.
THK!

                                                   Gianluca Nardin
                                                        aka
                                                  umm@seductive.com
                                            http://www.dei.unipd.it/~umm

---559023410-851401618-891517658=:3487
Content-Type: TEXT/PLAIN; charset=US-ASCII; name=src
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.SOL.3.96.980402134738.3487B@horus>
Content-Description: source code

IyEvdXNyL2xvY2FsL2Jpbi9wZXJsIC13DQokaW1tcGF0aD0iL2ltYWdlcy8i
Ow0Kc3ViIGV2YWxyZWZ7DQokXz0kX1swXTsNCnByaW50ICJcbmUkX1xuIjsN
CmlmICgvaHRtL2kpew0KJF89fnMvKC4qKS5odG0uKi8kMS9pOw0KJF89Ikph
dmFzY3JpcHQ6dG9wLmZyLmxvYWQoJyIuJF8uIicpOyI7DQp9DQokXzsNCn0N
CnN1YiBocmVmew0KJF89JF9bMF07DQpwcmludCJcbiskXyI7DQokXz0kMS4m
ZXZhbHJlZigkMikuJmhyZWYoJDMpaWYgKC8oLio9IikoW14iXSspKC4qKS9p
KTsgLy9oZXJlIGl0J3MgdGhlIHByb2JsZW0hDQpwcmludCJcbi0kXyI7DQok
XzsNCn0NCg==
---559023410-851401618-891517658=:3487
Content-Type: TEXT/PLAIN; charset=US-ASCII; name=log
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.SOL.3.96.980402134738.3487C@horus>
Content-Description: result

ciAgIDxNRVRBIEhUVFAtRVFVSVY9IkNvbnRlbnQtVHlwZSIgQ09OVEVOVD0i
dGV4dC9odG1sOyBjaGFyc2V0PWlzby04ODU5LTEiPg0KKyAgIDxNRVRBIEhU
VFAtRVFVSVY9IkNvbnRlbnQtVHlwZSIgQ09OVEVOVD0idGV4dC9odG1sOyBj
aGFyc2V0PWlzby04ODU5LTEiPg0KZXRleHQvaHRtbDsgY2hhcnNldD1pc28t
ODg1OS0xDQorIj4NCi0iPg0KLSAgIDxNRVRBIEhUVFAtRVFVSVY9IkNvbnRl
bnQtVHlwZSIgQ09OVEVOVD0iSmF2YXNjcmlwdDp0b3AuZnIubG9hZCgndGV4
dCcpOyI+DQp3ICAgPE1FVEEgSFRUUC1FUVVJVj0iQ29udGVudC1UeXBlIiBD
T05URU5UPSJKYXZhc2NyaXB0OnRvcC5mci5sb2FkKCd0ZXh0Jyk7Ij4NCg==
---559023410-851401618-891517658=:3487--


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

Date: Thu, 02 Apr 1998 11:52:30 -0500
From: John Porter <jdporter@min.net>
Subject: Re: searching for a pattern
Message-Id: <3523C24E.43D9@min.net>

Nardin Gianluca wrote:
> 
> #!/usr/local/bin/perl -w
> $immpath="/images/";
> sub evalref{
> $_=$_[0];
> print "\ne$_\n";
> if (/htm/i){
> $_=~s/(.*).htm.*/$1/i;
> $_="Javascript:top.fr.load('".$_."');";
> }
> $_;
> }
> sub href{
> $_=$_[0];
> print"\n+$_";
> $_=$1.&evalref($2).&href($3)if (/(.*=")([^"]+)(.*)/i); //here it's the problem!
> print"\n-$_";
> $_;
> }

So, what's it doing wrong?  You've said where the problem is,
but not *what* the problem is.

By the way, your source code formatting sucks.

And comments in perl start with #, not with //.

Did you write this code?

John Porter


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

Date: Thu, 2 Apr 1998 07:57:39 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Aaron Propst <abp@holly.colostate.edu>
Subject: Re: sending mail using perl
Message-Id: <Pine.GSO.3.96.980402075412.6466C-100000@user2.teleport.com>

On Wed, 1 Apr 1998, Aaron Propst wrote:

> I need to send an e-mail from perl, 

There are modules which can do that.

> using the following code, I can successfully send an e-mail, but it isn't
> turning out the way I want it.

You're using an external mail program to do the sending. Are you sending
the right commands? If you are, then it's a bug in your mail program. Hope
this helps!

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



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

Date: Thu, 02 Apr 1998 11:14:59 -0500
From: John Porter <jdporter@min.net>
Subject: Re: sending mail using perl
Message-Id: <3523B983.4861@min.net>

John Stanley wrote:
> 
> In article <6fsvoq$334s@yuma.ACNS.ColoState.EDU>,
> Aaron Propst <abp@holly.colostate.edu> wrote:
> >
> >open (MAIL, "|$mailprog $advisormail") || die "Can't open $mailprog! \n";
> 
> I am surprised that you don't get the "die" error message. You define
> $mailprog to be the directory "/usr/mail/". How exactly does one open a
> directory for piping into?

Remember that any open with a pipe causes a fork.  The child
process (in this case) dies with a "no such command"-type error,
but the parent process forked OK, so the open succeeded, from
the point of view of your program.

Happens even on NT, lest one think this is a Unix-specific problem.

hth,
John Porter


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

Date: 2 Apr 1998 15:11:00 GMT
From: kfox@pt0204.pto.ford.com (Ken Fox)
Subject: Re: Someone put my munged e-mail address on a spam list
Message-Id: <6g09q4$js02@eccws1.dearborn.ford.com>

stanley@skyking.OCE.ORST.EDU (John Stanley) writes:
> Bart Lateur <bart.mediamind@tornado.be> wrote:
> > It wastes a lot of OUR bandwidth though.
> 
> I have yet to have a munged address waste any of my bandwidth. The only
> time YOU waste bandwidth is 1) when you decide to send mail, which is
> your own decision, not mine, and 2) when you try to defend the
> ridiculous concept that munged addresses are evil.

I think Bart was thinking of bandwidth in terms of how much a person
can say per unit time.  I always forget to check whether a poster is
using some munged address -- a day or an hour later I get a bounce and
then I have to try to figure out what the hell happened.  Most of the
time the original message with the de-munging instructions are gone
and I'm left with guessing at the real address.  If it's annoying for
me, just imagine what a pain it is for the Tom [CP]s of the world.

Basically, a person who uses a munged address cares more about her
time than about the time of the person trying to answer the post.
Munged addresses aren't evil, but the people using them are a bit
selfish.

- Ken

P.S. I always de-munge an address in a follow up.  Otherwise the
     attributions get messed up and I think it's more important to
     have an accurate record of who said what than it is to protect
     people from spammers.

-- 
Ken Fox (kfox@ford.com)                  | My opinions or statements do
                                         | not represent those of, nor are
Ford Motor Company, Powertrain           | endorsed by, Ford Motor Company.
Analytical Powertrain Methods Department |
Software Development Section             | "Is this some sort of trick
                                         |  question or what?" -- Calvin


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

Date: Thu, 02 Apr 1998 11:35:09 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Tying a blessed hash (was: Re: Tie/bless vs. bless/tie and segmentation fault)
Message-Id: <3523BE3D.25C1@min.net>

Todd Lehman wrote:
> 
> package Foo;
> 
> sub new
> {
>    my $class = shift;
>    my $self = {};
>    tie %$self, $class, @_;
>    return bless $self, $class;
> }

Mind if I chip in and clarify a bit for you?

When you tie a hash to a class, the tie blesses an
object of that class.  Your blessing, above, is
redundant.  Try just returning $self from new() and
see what happens.  Should be the same.

It should be remembered that tie returns the newly
blessed object, so, without using new(), you could
simply do this:

my %DB;
my $DB_obj = tie %DB, 'Foo';

# use %DB for hash ops:
$DB{Person}{1}{FirstName} = 'John';

# use $DB_obj to access other methods you may have defined,
# besides the hash ones (FETCH, etc.):
print $DB_obj->full_name;

Since you didn't define any extra methods in Foo, I don't
see the advantage of caring about or keeping the blessed
object.  Why not just use the normal hash access method?

hth,
John Porter


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

Date: Thu, 02 Apr 1998 11:24:54 -0500
From: John Porter <jdporter@min.net>
Subject: Re: undefine variables
Message-Id: <3523BBD6.4D7F@min.net>

Kelby Valenti wrote:
> 
> Does anyone know if there is a way to undefine all variables that are used
> within the program.  I have looked in the man pages, but couldn't find any
> references.

It is essentially impossible.  Remember, there are two kinds of
variable:
global (or "package") variables, which live in symbol tables, and
lexical (or "my") variables, which have lexical scope.  While you could
conceivable write a routine which walks the symbol table tree, purging
every symbol it finds, there is no such easy access to lexical
variables.
Lexical variables with file scope live as long as the file in which they
have scope is loaded, which is (in the current implementation, at least)
as long as your program is running.

The easy way, then, is to exit.  But that introduces other problems. :-)

The real question is, Why do you think you want to do this?

John Porter


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

Date: Thu, 2 Apr 1998 08:35:30 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Kelby Valenti <kelby@mplx.com>
Subject: Re: undefine variables
Message-Id: <Pine.GSO.3.96.980402083022.6466F-100000@user2.teleport.com>

On Wed, 1 Apr 1998, Kelby Valenti wrote:

> Subject: undefine variables

You may not have realized that you posted this repeatedly. If you're not
sure whether posting is working, don't post again! Instead, post to a
 .test newsgroup, or consult your news admin.

> Does anyone know if there is a way to undefine all variables that are
> used within the program. 

Wanting that is usually a sign that you need to re-evaluate your task. :-) 
You probably really want to use lexical (my) variables. But you could
consider re-exec()ing your current process, or using reset.  Neither is
perfect. Hope this helps! 

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



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

Date: Thu, 2 Apr 1998 06:57:21 -0800
From: vwong5@juno.com (victor wasloki)
Subject: upload a file to ftp site
Message-Id: <19980402.065722.5447.0.vwong5@juno.com>

Hi all,


I've been working with some simple scripts in perl but I think I've come
across something a little bit more than I can understand. What I
ultimately want to do is to upload a file to an FTP site. I have seen
this done before using some JAVA script, but I wanted to see it done
using a perl script. Is there a way to write a perl script that will
upload a file from your computer's C drive to the FTP server?



_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]




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

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

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