[16400] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3812 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 26 18:10:38 2000

Date: Wed, 26 Jul 2000 15:10:24 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <964649424-v9-i3812@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 26 Jul 2000     Volume: 9 Number: 3812

Today's topics:
        Nobody loves me? <fuzzyping@freewwweb.net>
    Re: Nobody loves me? (Neil Kandalgaonkar)
    Re: Nobody loves me? (John Hascall)
    Re: Nobody loves me? <jason@mybowie.com>
    Re: Nobody loves me? (Clinton A. Pierce)
    Re: Nobody loves me? <jason@mybowie.com>
    Re: Nobody loves me? (Logan Shaw)
    Re: Nobody loves me? <jason@mybowie.com>
    Re: Nobody loves me? (Greg Bacon)
    Re: output of "system" (Abigail)
    Re: output of "system" (Craig Berry)
    Re: parsing a string that is a directory path. (Neil Kandalgaonkar)
        Password Input <tonys111@erols.com>
    Re: Password Input <lauren_smith13@hotmail.com>
    Re: pattern match <lauren_smith13@hotmail.com>
    Re: pattern match <lr@hpl.hp.com>
    Re: perl as part of unix distribution <gellyfish@gellyfish.com>
    Re: Perl sequivallent for tidy (HTML fixup program)? <lr@hpl.hp.com>
    Re: perl-5.6.0: Bug with "not" operator? ()
    Re: popup.pm <lauren_smith13@hotmail.com>
    Re: pos() bug? <lr@hpl.hp.com>
    Re: reg exp is driving me crazy <pjakobs@wt.net>
    Re: return value of `eval "use lib"' <sumus@aut.dk>
    Re: Saving space in a hash <george.kuetemeyer@mail.tju.edu>
        Script for copy all the site <plambert@reuna.cl>
    Re: Sending data to a web server. <eli02@imap4.asu.edu>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 26 Jul 2000 14:54:25 -0400
From: Jason Dixon <fuzzyping@freewwweb.net>
Subject: Nobody loves me?
Message-Id: <397F33E1.D7F915C6@freewwweb.net>

Ok, I don't get it.  I've posted this question now for the 3rd time, but
no one will reply.  Am I sending this to the wrong group?  I've been
posting this to both comp.lang.perl.misc and comp.lang.perl.modules, but
haven't been able to get any assistance or direction.  PLEASE, SOMEONE
LOVE ME AND REPLY.  :-)

I've written a script to email a list of people with updates on my
site.  The script works great, except I'm having difficulty customizing
the "From" section of the header (no problems at all with the
"Subject").  Instead of changing the From header to my variable, it uses
the "real" header (from a machine that is NOT in my domain), then
inserts the new header into the body of the email (???).

As always, TIA!
-Jason

<snippet>
foreach $name (<INPUT>) {
        chomp;
        $from = "Jason <jason\@domain.com>";
        $subject = "shtuff goes here";
        $mailer = Mail::Mailer->new("sendmail");
        $mailer->open({ From    => $from,
                        To      => $name,
                        Subject => $subject,
                        }) || die "can't open: $!";
        print $mailer $body;
        $mailer->close();
        }
</snippet>



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

Date: Wed, 26 Jul 2000 19:31:50 GMT
From: neil@brevity.org (Neil Kandalgaonkar)
Subject: Re: Nobody loves me?
Message-Id: <8lndub$fg3$1@localhost.localdomain>

In article <397F33E1.D7F915C6@freewwweb.net>,
Jason Dixon  <fuzzyping@freewwweb.net> wrote:

>I've written a script to email a list of people with updates on my
>site.  The script works great, except I'm having difficulty customizing
>the "From" section of the header (no problems at all with the
>"Subject").

I had this problem with earlier versions of MailTools, but this doesn't
seem to happen with current versions. 

I note that Mail::Mailer::mail does limit what your headers can be,
but the sendmail mode, which uses Mail::Mailer::rfc822, has no
such limitations.

Maybe you don't have sendmail (?!), or it's in an unusual place, 
and it is defaulting to mail?

-- 
Neil Kandalgaonkar <neil@brevity.org>


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

Date: 26 Jul 2000 19:54:10 GMT
From: john@iastate.edu (John Hascall)
Subject: Re: Nobody loves me?
Message-Id: <8lnfl2$4qf$1@news.iastate.edu>

Jason Dixon  <fuzzyping@freewwweb.net> wrote:
>Ok, I don't get it.  I've posted this question now for the 3rd time, but
>no one will reply.  Am I sending this to the wrong group?  I've been
>posting this to both comp.lang.perl.misc and comp.lang.perl.modules, but
>haven't been able to get any assistance or direction.  PLEASE, SOMEONE
>LOVE ME AND REPLY.  :-)
>
>I've written a script to email a list of people with updates on my
>site.  The script works great, except I'm having difficulty customizing
>the "From" section of the header (no problems at all with the
>"Subject").  Instead of changing the From header to my variable, it uses
>the "real" header (from a machine that is NOT in my domain), then
>inserts the new header into the body of the email (???).

   If you are not running as a 'trusted user' (see the sendmail conf
   file docs) then sendmail will not let you lie about 'From'.

John
>
>As always, TIA!
>-Jason
>
><snippet>
>foreach $name (<INPUT>) {
>        chomp;
>        $from = "Jason <jason\@domain.com>";
>        $subject = "shtuff goes here";
>        $mailer = Mail::Mailer->new("sendmail");
>        $mailer->open({ From    => $from,
>                        To      => $name,
>                        Subject => $subject,
>                        }) || die "can't open: $!";
>        print $mailer $body;
>        $mailer->close();
>        }
></snippet>
>


-- 
John Hascall                         (__)   Shut up, be happy.
Software Engineer,            ,------(oo)    The conveniences you demanded
Acropolis Project Manager,   / |Moo U|\/      are now mandatory.
ISU Academic IT             *  ||----||        -- Jello Biafra


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

Date: Wed, 26 Jul 2000 19:09:38 GMT
From: Jason Dixon <jason@mybowie.com>
Subject: Re: Nobody loves me?
Message-Id: <397F4810.4AF44AA9@mybowie.com>

Neil Kandalgaonkar wrote:

> In article <397F33E1.D7F915C6@freewwweb.net>,
> Jason Dixon  <fuzzyping@freewwweb.net> wrote:
>
> >I've written a script to email a list of people with updates on my
> >site.  The script works great, except I'm having difficulty customizing
> >the "From" section of the header (no problems at all with the
> >"Subject").
>
> I had this problem with earlier versions of MailTools, but this doesn't
> seem to happen with current versions.
>
> I note that Mail::Mailer::mail does limit what your headers can be,
> but the sendmail mode, which uses Mail::Mailer::rfc822, has no
> such limitations.
>
> Maybe you don't have sendmail (?!), or it's in an unusual place,
> and it is defaulting to mail?
>
> --
> Neil Kandalgaonkar <neil@brevity.org>

As far as I can tell, I'm using the most recent version
(MailTools-1.1401).  It appears that I am calling the sendmail mode of
Mail::Mailer, and sendmail is in a standard location (/usr/sbin/sendmail).
And I've confirmed that is actually using sendmail, not mail.  Argh.

-Jason



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

Date: Wed, 26 Jul 2000 20:16:40 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: Nobody loves me?
Message-Id: <IGHf5.51794$fR2.474395@news1.rdc1.mi.home.com>

[Posted and mailed]

In article <397F33E1.D7F915C6@freewwweb.net>,
	Jason Dixon <fuzzyping@freewwweb.net> writes:
> Ok, I don't get it.  I've posted this question now for the 3rd time, but
> no one will reply.  Am I sending this to the wrong group?

No, but you have serious misconceptions about how Usenet works.

This posting was at:
	Wed, 26 Jul 2000 18:54:25 GMT [adjusted]

Your last posting was at:
	Wed, 26 Jul 2000 13:00:06 GMT

The posting prior to that was:
	Tue, 25 Jul 2000 23:29:57 GMT

You're barely giving news enough time to propogate around the Net.  Much
less for the fact you chose a poor subject line.

The "Nobody loves me" one was terrible, I read it only because I wanted to 
see what kind of dweeb would post with that Subject. The "Custom mail 
headers with perl" subject wasn't much better.  We know it's Perl, you 
don't have to tell us that.  And so what about custom mail headers?

Next time pick a better subject line (I'd suggest "Mail::Mailer doesn't
set From: header correctly") and wait a couple of days between postings.
Usenet isn't a help desk.  If you want service in an hour, pay for it.

-- 
    Clinton A. Pierce              Teach Yourself Perl in 24 Hours! 
  clintp@geeksalad.org         for details see http://www.geeksalad.org
"If you rush a Miracle Man, 
	you get rotten Miracles." --Miracle Max, The Princess Bride


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

Date: Wed, 26 Jul 2000 19:13:40 GMT
From: Jason Dixon <jason@mybowie.com>
Subject: Re: Nobody loves me?
Message-Id: <397F4902.AD365854@mybowie.com>

John Hascall wrote:

> Jason Dixon  <fuzzyping@freewwweb.net> wrote:
> >Ok, I don't get it.  I've posted this question now for the 3rd time, but
> >no one will reply.  Am I sending this to the wrong group?  I've been
> >posting this to both comp.lang.perl.misc and comp.lang.perl.modules, but
> >haven't been able to get any assistance or direction.  PLEASE, SOMEONE
> >LOVE ME AND REPLY.  :-)
> >
> >I've written a script to email a list of people with updates on my
> >site.  The script works great, except I'm having difficulty customizing
> >the "From" section of the header (no problems at all with the
> >"Subject").  Instead of changing the From header to my variable, it uses
> >the "real" header (from a machine that is NOT in my domain), then
> >inserts the new header into the body of the email (???).
>
>    If you are not running as a 'trusted user' (see the sendmail conf
>    file docs) then sendmail will not let you lie about 'From'.
>

That's a thought... however, I ran it as root and it still did the same
thing....

<email>
Date: Wed, 26 Jul 2000 16:15:17 -0400 (EDT)
From: User Jason <jason@mybox.otherdomain.net>
To: jason@anotherdomain.com
Subject: shtuff goes here!

From: Jason Dixon <jason@mybowie.com>
</email>

See, the custom From keeps getting tossed into the body of the message,
instead of the header.  argh.

-Jason



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

Date: 26 Jul 2000 15:24:38 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Nobody loves me?
Message-Id: <8lnhe6$lt3$1@provolone.cs.utexas.edu>

In article <397F4902.AD365854@mybowie.com>,
Jason Dixon  <jason@mybowie.com> wrote:
>John Hascall wrote:
>
>> Jason Dixon  <fuzzyping@freewwweb.net> wrote:
>> >Ok, I don't get it.  I've posted this question now for the 3rd time, but
>> >no one will reply.  Am I sending this to the wrong group?  I've been
>> >posting this to both comp.lang.perl.misc and comp.lang.perl.modules, but
>> >haven't been able to get any assistance or direction.  PLEASE, SOMEONE
>> >LOVE ME AND REPLY.  :-)
>> >
>> >I've written a script to email a list of people with updates on my
>> >site.  The script works great, except I'm having difficulty customizing
>> >the "From" section of the header (no problems at all with the
>> >"Subject").  Instead of changing the From header to my variable, it uses
>> >the "real" header (from a machine that is NOT in my domain), then
>> >inserts the new header into the body of the email (???).
>>
>>    If you are not running as a 'trusted user' (see the sendmail conf
>>    file docs) then sendmail will not let you lie about 'From'.
>>
>
>That's a thought... however, I ran it as root and it still did the same
>thing....

Try using SMTP to connect.  That way, there will be no trusted vs.
non-trusted user issue.

If that doesn't work, try running it through the debugger and watch
what actually happens.

  - Logan


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

Date: Wed, 26 Jul 2000 19:23:19 GMT
From: Jason Dixon <jason@mybowie.com>
Subject: Re: Nobody loves me?
Message-Id: <397F4B45.C18070AA@mybowie.com>

Ok, so you'd rather waste both your time and mine by lecturing me on the
etiquette of Usenet than just offer a hand?  Thanks for wasting my
bytes.  I would, however, like to thank John and Neil for being productive
and conducive to the true nature of this newsgroup.

Unfortunately, yes, I resolved to putting up that lame-ass Subject line
just so I could get a response.  Sorry to have wasted your time, I can see
that it's obviously too important to spend assisting me.

BTW, do you even HAVE a solution, or did you just feel the need to ride my
ass?

-Jason



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

Date: Wed, 26 Jul 2000 20:34:54 GMT
From: gbacon@HiWAAY.net (Greg Bacon)
Subject: Re: Nobody loves me?
Message-Id: <snuiregk3j147@corp.supernews.com>

In article <397F4B45.C18070AA@mybowie.com>,
    Jason Dixon  <jason@mybowie.com> wrote:

: Unfortunately, yes, I resolved to putting up that lame-ass Subject line
: just so I could get a response.

Doing that is even more likely to land you in peoples' killfiles.  If
you irritate the providers of quality answers, you're left digging
through manure and guano.

Greg


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

Date: 26 Jul 2000 16:08:28 EDT
From: abigail@foad.org (Abigail)
Subject: Re: output of "system"
Message-Id: <slrn8nuh9l.vcg.abigail@alexandra.foad.org>

Stefan (stefanp@mediaaktiv.de) wrote on MMDXXI September MCMXCIII in
<URL:news:397F17D0.98972F12@mediaaktiv.de>:
][ How can I access the output of a "system" statement in a perl programm:
][ for example


By reading the entry for system in the manpage!



Abigail
-- 
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'


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

Date: Wed, 26 Jul 2000 20:24:45 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: output of "system"
Message-Id: <snui8dot3j1115@corp.supernews.com>

Steve Leibel (stevel@bluetuna.com) wrote:
: You can't do that with system(), but you can use backticks, like this:
: 
: $response = `echo hi';

Not quite like that.  The close-quote has to be a backtick, too:

  $response = `echo hi`;

-- 
   |   Craig Berry - http://www.cinenet.net/users/cberry/home.html
 --*--  "Turning and turning in the widening gyre
   |   The falcon cannot hear the falconer." - Yeats, "The Second Coming"


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

Date: Wed, 26 Jul 2000 19:47:06 GMT
From: neil@brevity.org (Neil Kandalgaonkar)
Subject: Re: parsing a string that is a directory path.
Message-Id: <8lneqv$fhc$1@localhost.localdomain>

In article <fk6unsgt9fe1mb7soe62ro0k5opnqgef28@4ax.com>,
Joe Schmoe  <joeschmoe@aol.com> wrote:
>I have a CGI scripts that is suppose to list the content of a
>directory on the local computer. That's easy, it's something even I
>can do. 
>
>But I also have to create a "up" button to get the web page to display
>the contents of the directory one step above. For example, if the CGI
>is displaying the contents of
>"/home/john/notes/class1"
>It also needs to display a link capable of go showing
>"/home/john/notes"

The short answer:  $url =~ s{/[^/]+$}{}; # but watch out, you may not want
                                         # people to be able to read above
					 # /home/john/notes, and certainly
					 # not /home/john !

Also, you might find that the apache module mod_autoindex does everything you 
need already. See the documentation at apache.org. 


>I'm looking for a way to take the string
>
>"/home/john/notes/class1"
>
>and be able to change it to
>
>"/home/johm/notes/class1"
           ^

s/john/johm/;  # ??????



-- 
Neil Kandalgaonkar <neil@brevity.org>


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

Date: Wed, 26 Jul 2000 17:35:52 -0400
From: "Tony Sideris" <tonys111@erols.com>
Subject: Password Input
Message-Id: <8lnle1$l04$1@bob.news.rcn.net>

Hello,
Are there any modules that provide hidden (or masked) input on linux/win32
console? In other words, i want to do something similiar to:

$password = <STDIN>;

But I do not want the user's input echoed to the screen, or each character
be replaced with a mask character (like *). I would imagine this is possible
in Win32 with Win32::Console, but that seems a bit low-level, are there any
higher level, portable modules that could do this?

Thanks,
-Tony





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

Date: Wed, 26 Jul 2000 14:41:41 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: Password Input
Message-Id: <8lnlsk$and$1@brokaw.wa.com>


Tony Sideris <tonys111@erols.com> wrote in message
news:8lnle1$l04$1@bob.news.rcn.net...
> Hello,
> Are there any modules that provide hidden (or masked) input on linux/win32
> console? In other words, i want to do something similiar to:
>
> $password = <STDIN>;
>
> But I do not want the user's input echoed to the screen, or each character
> be replaced with a mask character (like *). I would imagine this is
possible
> in Win32 with Win32::Console, but that seems a bit low-level, are there
any
> higher level, portable modules that could do this?

perldoc -q password

perlfaq8: How do I ask the user for a password?

Lauren





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

Date: Wed, 26 Jul 2000 11:46:00 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: pattern match
Message-Id: <8lnbja$5i7$1@brokaw.wa.com>

Jimmy Lantz <jimmy.lantz@ostas.lu.se> wrote in message
news:397F25BE.11481918@ostas.lu.se...
> "Mark W. Schumann" wrote:
> >
> > In article <397f111e$0$8317$7f8943f3@newsreader.visi.com>,
> > Jim <webmaster@ej-sunglasses.com> wrote:
> > >
> > > someinof | moreinfo | evenmore | more |
> > >
> > >I want to assign each variable a name ( $a= someinfo, $b= moreinfo
ect..)
> > >So I need to read the file until the pipe ( | ) is found, name it,
continue
> > >reading until the next pipe is found- name that something else ect...
> > >I know there has to be an easy way to do this using pattern matching,
but I
> > >am new to Perl and cant figure out how to do it.   Thanks for any help
> >
> > $ perldoc -f split

> Even better, pattern memory.
> you should look up on Regular expressions and pattern memory, by
> using ().

How is that better?

Please code the equivalent regex to

@info = split / \| /, $string;

Lauren





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

Date: Wed, 26 Jul 2000 14:18:37 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: pattern match
Message-Id: <MPG.13e8f58bce63188798abf1@nntp.hpl.hp.com>

In article <8lnbja$5i7$1@brokaw.wa.com> on Wed, 26 Jul 2000 11:46:00 -
0700, Lauren Smith <lauren_smith13@hotmail.com> says...
> Jimmy Lantz <jimmy.lantz@ostas.lu.se> wrote in message
> news:397F25BE.11481918@ostas.lu.se...

 ...

> > Even better, pattern memory.
> > you should look up on Regular expressions and pattern memory, by
> > using ().
> 
> How is that better?
> 
> Please code the equivalent regex to
> 
> @info = split / \| /, $string;

  @info = $string =~ /(.*?)(?: \| |$)/g;

Not better than the split(), but not very hard to do, either.

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


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

Date: 26 Jul 2000 10:17:48 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: perl as part of unix distribution
Message-Id: <8lmabs$161$1@orpheus.gellyfish.com>

On 25 Jul 2000 07:48:27 -0700 Tom Christiansen wrote:
> In article <8li2a5$2tk$1@nnrp1.deja.com>,  <dgallardo@my-deja.com> wrote:
>>Is perl part of any standard unix distribution?  Are there any moves in
>>this direction.
> 
> A fairly definitive list of vendors can be found in the index page
> of the CPAN ports directory, such as you find at 
> 
>     http://www.perl.com/CPAN-local/ports/
>     http://www.cpan.org/CPAN/ports/
> 
> When last I looked at this very question a few months ago, all of
> AIX, BeOS, BSDI, Debian, DG/UX, DYNIX/ptx, FreeBSD, IRIX, LynxOS,
> Mac OS X, OpenBSD, OS390, RedHat, SINIX, Slackware, Solaris, SuSE,
> and Tru64 shipped with Perl as part of their standard distributions.
> I'm sure more have been added since then.  (And that doesn't even
> count the millions of other Linux operating systems.)
> 

Since SCO started shipping their 'Skunkware' CD (which contains a Perl
bindist ) with  their OS distribution I suppose we could include them.

Oh and last time I checked so did Novell Netware.

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


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

Date: Wed, 26 Jul 2000 12:06:08 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Perl sequivallent for tidy (HTML fixup program)?
Message-Id: <MPG.13e8d67b9c68d30a98abed@nntp.hpl.hp.com>

In article <8F7DCFFD8flcmetierdk@212.242.40.196> on 26 Jul 2000 17:53:05 
GMT, Frans la Cour <flc@metier.dk> says...
> posting.account@lynxview.com (William Herrera) wrote in
> <397da662.460115870@news.rmi.net>: 
> 
> >Hi, I am currently looking at running some program HTML output (from a
> >text or MS word to HTML translator) through tidy via system() in a perl
> >program. Is there a native perl equivalent to the tidy program for
> >cleaning up HTML? 
> 
> http://www.fourmilab.ch/webtools/demoroniser/
> 
> was made with that purpose
> 
> by 
> John Walker 
> http://www.fourmilab.ch/ 
> 
> It might be just what you are looking for.

A somewhat updated version of that program can be found at 

<URL:http://www.perl.com/language/misc/demoroniser.html>

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


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

Date: Wed, 26 Jul 2000 18:21:05 GMT
From: mike@excite.com ()
Subject: Re: perl-5.6.0: Bug with "not" operator?
Message-Id: <slrn8nubvn.hp1.mike@zorak.happyfish.org>

Earlier, Bart Lateur <bart.lateur@skynet.be> wrote:
>There is NO REASON why a unary operator should be different from a
>function. A unary operator IS a function. So, it should act like one.

Obviously I disagree with that.  And there are several examples
showing that not shouldn't be treated like a functino given earlier,
so I won't rehash those.

>Any other behaviour, like the one you propone, is only confusing.

I'm not proposing anything.  The behavior I favor is the one that perl
has used all the way up to perl 5.6 (since "not" was introduced,
whenever that was.)  5.6 *broke* code with this change.

Mike



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

Date: Wed, 26 Jul 2000 14:21:16 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: popup.pm
Message-Id: <8lnkmb$aa1$1@brokaw.wa.com>


<fatdaz64@my-deja.com> wrote in message news:8lmb9s$7v6$1@nnrp1.deja.com...
> I have inherited a piece of
> tk code at one of my customers. The code was written by a contractor
> who has subsequently disappeared off the face of the earth. I am
> reliably informed that it did run OK some 12 months ago on 1 PC which
> has since been completely rebuilt. When I run it it keeps crapping out
> (understandably) on this "require popup.pm" statement.

Sounds like you are missing that file in your @INC path.  If you have it
somewhere on your system, you should be able to put it into your path, but
if not... You may be SOL.

Lauren





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

Date: Wed, 26 Jul 2000 13:35:53 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: pos() bug?
Message-Id: <MPG.13e8eb86a971ff9e98abef@nntp.hpl.hp.com>

In article <8llqrb$b6k$1@slb0.atl.mindspring.net> on Wed, 26 Jul 2000 
00:52:06 -0400, The Binskter <jarjar@starwars.com> says...
> I have written a small piece of code to extract some info from a .html page.
> The information comes from a comment
> <!-- and --> within the page.  If I write out the code in the main procedure
> I get the correct information, if I use it in a sub, then I get nothing.
> pos returns nothing.  The code is supposed to return each position that the
> comment starts...
> 
> Here is the code:
> 
>   $strSearch =~ m/<!--/g;
>   while (pos($strSearch))
>   {
>    push (@strStart,pos($strSearch));
>    $strSearch =~ m//;
>   }
> 
> again, when I put the exact same code within a sub, it finds the match, but
> for some reason pos() does not return any values.

I don't know about the bug you report.  But the above code can be 
written a lot cleaner this way:

    push @strStart, pos $strSearch while $strSearch =~ /<!--/g;

Of course, I wouldn't use studly caps for variable names, and would keep 
the $strSearch value in $_.  So:

    push @str_start, pos while /<!--/g;

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


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

Date: Wed, 26 Jul 2000 14:11:36 -0500
From: Paula Jakobs <pjakobs@wt.net>
Subject: Re: reg exp is driving me crazy
Message-Id: <397F37E8.F052DCC3@wt.net>

That worked. Thanks.

Paula

Ala Qumsieh wrote:

> Paula Jakobs <pjakobs@wt.net> writes:
>
> > I have a file with a line like this:
> > EXCLUDE: 215001, 1194001, 1194002
> >
> > I'm trying to put all of the numbers into a list. I don't know in
> > advance how many numbers there will be. I am trying to solve that by
> > doing this:
> >
> >  open(ITEMS, "$itemlist");
> >  while(<ITEMS>){
> >         if(/^EXCLUDE|INCLUDE: (.*)/){
>
> You are having precedence problems here. Change that to:
>
>         if (/^(?:EXCLUDE|INCLUDE): (.*)/) {
>
> >                print "test: $1";
> >               @items=split(',', $1);
>
> Perhaps you also want to push everything on @items:
>
>         push @items => split /,/, $1;
>
> >        }
> >  }
> >  close ITEMS;
>
> --Ala



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

Date: 26 Jul 2000 22:38:22 +0200
From: Jakob Schmidt <sumus@aut.dk>
Subject: Re: return value of `eval "use lib"'
Message-Id: <puo07hkx.fsf@macforce.sumus.dk>

sweth+perl@gwu.edu (Sweth Chandramouli) writes:

> In article <8lm51k$bpo$1@agate.berkeley.edu>,
> Eric Kuritzky <kuritzky@math.berkeley.edu> wrote:
> >
> >use doesn't return a value, so eval doesn't, either.
> 	Odd, since the Perl Cookbook has this example of how to
> trap exceptions in use statements:
> 
> unless (eval "use $mod") {
>    warn "couldn't load $mod: $@";
> }

That's either outdated or plain wrong as far as I can see. As it is use() runs
during compiletime which to me makes it pretty obvious that it shouldn't return
anything.

The eval() is a way to defer compilation (and running) of a string of code
'til sometime during the runtime of the surrounding code. And even if use()
did retur some value - it still wouldn't be what eval() would return:

When you program says eval "use Moof", the code "use Moof" will be compiled
(at which time the use statement is evaluated) and after that executed. Now
since it contains no executable (runtime) code, nothing happens and therefore
the eval returns nothing. OK?

If you haven't got Moof.pm then the code "use Moof" won't compile and so
$@ is set.

>[$@]
> 	Hmm... I've seen situations before where it isn't set
> in an `eval "require foo"' that fails;

It is here. (This is perl, version 5.005_03 built for ppc-linux)

BTW, remember that require is executed during runtime - so there's no reason
for eval() unless you want your program to tolerate a failure.

-- 
Jakob


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

Date: Wed, 26 Jul 2000 17:51:41 -0400
From: "George M. Kuetemeyer" <george.kuetemeyer@mail.tju.edu>
Subject: Re: Saving space in a hash
Message-Id: <397F5D6C.2E5330C4@mail.tju.edu>



Russ Jones wrote:

> I'm building a hash that contains the same line of data, referenced
> three different ways, like this:
>
>         $snmp{$ip}    = $snmp_info;
>         $snmp{$dns}   = $snmp_info;
>         $snmp{$alias} = $snmp_info;
>
>         (repeat for about five thousand different ip's)
> I use the storable module to save and later read the hash to/from disk
> and having the data in there three times seems like a mighty waste of
> space in my program, and a might waste of I/O time when I have to load
> the hash to look up the data. Is there some more efficient way of
> doing this?

You could play around with a compound key approach:

    $snmp{$ip . $dns . $alias} = $snmp_info

Access could be via grep:

    @matches = grep /$pattern/, keys %snmp;
    foreach (@matches) {
        print "$snmp{$_}\n";
    }

You would reduce your entries to 1/3 of the original. On the other hand,
access would not be as direct and maybe not as fast.

Not sure if there are considerations regarding the size of hash keys...




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

Date: Wed, 26 Jul 2000 14:36:32 -0500
From: Pablo Lambert <plambert@reuna.cl>
Subject: Script for copy all the site
Message-Id: <397F3DC0.72007999@reuna.cl>

Hello:
        I am searching for a tool that allows me copy some remote site
via http, to my local filesystem. I have already downloaded
CPAN/sitemapper, but this tool only make a map of the site.

I have also try MasterSnooper.pl but does not work recursively. It works
only with one page and does not follow the links.

I think that the perl community is so smart that this litte tools must
be done!

Thanks in advance,



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

Date: Wed, 26 Jul 2000 15:02:48 -0700
From: <eli02@imap4.asu.edu>
Subject: Re: Sending data to a web server.
Message-Id: <Pine.GSO.3.96.1000726145851.13114A-100000@general5.asu.edu>

You could probably use LWP to access said page with the correct HTTP POST form
variables.  Read up more on LWP's documentation after you install it (perl
-MCPAN -e 'install LWP' (i think).  Try to figure out what variables the
login script on the server uses for login information then just replicate it
with LWP.

HTH,
Eden Li
Eden.Li@asu.edu

On Sun, 16 Jul 2000, Guy wrote:
> Does anybody know how I can send data to a web server using a perl script.
> (like submitting a form but without using HTML forms on the client side)
> For example: instead of logging in manually to my web-mail account (using
> their HTML forms: name, password) I would like to run a perl script that
> knows my login name and password, and submits this information to the
> original form action URL. That way instead of going to let's say
> www.hotmail.com and logging in there, I just run my perl script and it
> automatically logs-in for me. (without using a browser during the procedure)
> If this sounds complicated, tell me and I'll try to explain it better.



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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

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


------------------------------
End of Perl-Users Digest V9 Issue 3812
**************************************


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