[16716] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4128 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 25 06:10:30 2000

Date: Fri, 25 Aug 2000 03:10:17 -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: <967198217-v9-i4128@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 25 Aug 2000     Volume: 9 Number: 4128

Today's topics:
    Re: Just another silly post. (Keith Calvert Ivey)
    Re: Just another silly post. (Abigail)
    Re: Just another silly post. (Abigail)
    Re: Just another silly post. (Abigail)
    Re: Just another silly post. <gellyfish@gellyfish.com>
        legal date eastking@my-deja.com
        Local install of perl modules <mark@orctel.co.uk>
        Perl and mod zideon@my-deja.com
    Re: Perl and mod <dwb1@home.com>
    Re: Please wait... [was: Perl - Blinking Text] <iltzu@sci.invalid>
    Re: Please wait... [was: Perl - Blinking Text] <dave@dmriley.demon.co.uk>
    Re: RegEx zejames@my-deja.com
    Re: RegEx zejames@my-deja.com
    Re: Regular expression, $1 in a $variable. <madings@baladi.bmrb.wisc.edu>
    Re: Remove a backslash from a string. (Keith Calvert Ivey)
    Re: Remove a backslash from a string. <katz@underlevel.net>
    Re: Remove a backslash from a string. (Martien Verbruggen)
    Re: Remove a backslash from a string. (Abigail)
    Re: Replace "XYZ" but not "ABCXYZ"??? - HELP!! (Keith Calvert Ivey)
        robot zchanggun@my-deja.com
    Re: robot <timewarp@shentel.net>
    Re: self writing program (Abigail)
        SendMail and IIS <info@ezboo.com.xx>
    Re: SMTP in formmail <simon@nospam.edincc.co.uk>
    Re: trying to pull each string from file to evaluate... <lr@hpl.hp.com>
    Re: unpack format question (Keith Calvert Ivey)
        URLs ending in / cbdeja@my-deja.com
    Re: URLs ending in / (Jukka Korpela)
    Re: use CGI to remove files <amonotod@netscape.net>
    Re: use CGI to remove files (doco)
        what's happening ivolla@my-deja.com
    Re: what's happening <wyzelli@yahoo.com>
    Re: what's happening <timewarp@shentel.net>
    Re: what's happening <louise.davis@breathemail.net>
    Re: Where is the Perl Newbie or Begginers group? <mark@artwarren.com>
        Wrong @INC in Apache <grichards@flashcom.net>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 25 Aug 2000 03:26:44 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Just another silly post.
Message-Id: <39a6e5f0.2485726@news.newsguy.com>

Policy Man <reljr_2@yahoo.com> wrote:

>If there were a requirement that usenet keep its nose to the grindstone,
>and perhaps you think there should be one, this challenge would be
>out of place. I don't remember any such restrictions on this newsgroup.

No one has claimed there are any such restrictions.  People post
"fun" messages and puzzles all the time, and that's part of the
spirit of the group.  Unfortunately, you don't seem to
understand that puzzles are actually supposed to be fun.  Taking
a trivial problem, piling a bunch of arbitrary restrictions on
it, and badgering people until they either solve it or killfile
you isn't particularly fun for most of us -- but perhaps you're
enjoying it.

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


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

Date: 25 Aug 2000 07:25:16 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Just another silly post.
Message-Id: <slrn8qc7pf.tj3.abigail@alexandra.foad.org>

Martien Verbruggen (mgjv@verbruggen.comdyn.com.au) wrote on MMDLI
September MCMXCIII in <URL:news:slrn8qbn6n.ma.mgjv@verbruggen.comdyn.com.au>:
-: On Fri, 25 Aug 2000 00:39:07 GMT,
-: 	Craig Berry <cberry@cinenet.net> wrote:
-: > 
-: > sub dirx { map { -l $_ ? () : -d $_ ? (dirx(glob("$_/*")), $_) : $_ } @_ }
-: 
-: 
-: You'll be missing out on the directories and files that start with a
-: '.'. Inlcuding those, and then excluding . and .. is going to be a bit
-: more work..
-: 
-: Something like
-: 
-: dirx(grep !m!/\.\.?$!, glob("$_/* $_/.*"))


Eh, no, that will filter out some perfectly legal filenames.



Abigail
-- 
$_ = "\nrekcaH lreP rehtona tsuJ"; my $chop; $chop = sub {print chop; $chop};
$chop -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> ()
-> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> ()


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

Date: 25 Aug 2000 07:31:11 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Just another silly post.
Message-Id: <slrn8qc84j.tj3.abigail@alexandra.foad.org>

Policy Man (reljr_2@yahoo.com) wrote on MMDLI September MCMXCIII in
<URL:news:39A5D61E.F2517076@yahoo.com>:
 .. Martien Verbruggen wrote:
 .. 
 .. > On Thu, 24 Aug 2000 20:05:04 -0500,
 .. >         Policy Man <reljr_2@yahoo.com> wrote:
 .. > >
 .. > > Your code actually worked the first time I fired it up which is
 .. > > more than I can say for anything else I've seen so far.
 .. >
 .. > Are you saying that mine didn't work without editing? What was the
 .. > problem?
 ..
 .. Sorry, I sent this one off before I read you earlier post.
 .. Danmit, time got in my way again. Argggggg.


Oh, really? I guess the clocks on both your machine, and your NNTP
server run backwards.

According to the headers, you posted to above quote on
Thu, 24 Aug 2000 20:05:04 -0500. You responded to Martiens code
more than 2.5 hours before, on Thu, 24 Aug 2000 17:28:54 -0500.

Troll, please go away.


Abigail
-- 
$" = "/"; split $, => eval join "+" => 1 .. 7;
*{"@_"} = sub  {foreach (sort keys %_) {print "$_ $_{$_} "}};
%{"@_"} = %_ = (Just => another => Perl => Hacker); &{%{%_}};


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

Date: 25 Aug 2000 07:36:48 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Just another silly post.
Message-Id: <slrn8qc8f4.tj3.abigail@alexandra.foad.org>

Policy Man (reljr_2@yahoo.com) wrote on MMDL September MCMXCIII in
<URL:news:39A5A394.C4571B4A@yahoo.com>:
// Abigail wrote:
// 
// > What "real" problem? You make up a problem that can trivially be
// > sold by using File::Find, you come with a list of arbitrary, silly,
// > restrictions, and now you are pissed people don't come with "serious"
// > solutions? Get real.
// 
// And yet no solution is forthcoming.

Odd. Less than 10 minutes before you posted this, you replied to Martiens
solution - the existance of that solution you will deny later on as well.

// Are you saying that restrictions of the type mentioned make the problem
// too difficult for you to resolve?

No, too boring. If I wanted to program in a feature poor language, I'd
use Python or Java. There's no creativety left with such a set of silly
restrictions.

But, since you don't post any code yourself, I guess it's fair to ask
"is it too difficult for you to solve"?



Abigail
-- 
               split // => '"';
${"@_"} = "/"; split // => eval join "+" => 1 .. 7;
*{"@_"} = sub {foreach (sort keys %_)  {print "$_ $_{$_} "}};
%{"@_"} = %_ = (Just => another => Perl => Hacker); &{%{%_}};


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

Date: 25 Aug 2000 09:13:17 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Just another silly post.
Message-Id: <8o59qt$ni$1@orpheus.gellyfish.com>

On Thu, 24 Aug 2000 06:19:06 -0500 Policy Man wrote:
> Abigail wrote:
> 
>> Larry Rosler (lr@hpl.hp.com) wrote on MMDL September MCMXCIII in
>> <URL:news:MPG.140e112c7fb2144798acd2@nntp.hpl.hp.com>:
>> || In article <39A46159.ECE3174@yahoo.com> on Wed, 23 Aug 2000 18:42:17 -
>> || 0500, Policy Man <reljr_2@yahoo.com> says...
>> || >
>> || > I have a challenge for you. Create perl code according to these
>> || > requirements:
>> ||
>> || Your challenge might be more suitable for the Fun With Perl list,
>> || fwp@technofile.org
>>
>> Nah. Halfway the list of arbitrary restrictions, I hit 'n' key with
>> the thought 'this is no fun'.
>>
>> Oh, btw, there's a trivial way around most of the restrictions. Code
>> the thing in whatever way you want. Turn the code into a string. Replace
>> all characters with octal escapes. Eval it. (And if down the list it's
>> mentioned you can't use "eval", there's always s///e and s///ee).
>>
> 
> You of course would fail the single requirement of 'Don't try to be cute'.
> So far all I've seen is a juvenile attempt to avoid solving the actual problem.
> I expected as much when I first wrote the challenge. I knew that
> cheap answers would be the first to come pouring out. As I stated in the
> original post: I could just 'use File::Find' and be done with it.
> 
> Is the real problem too difficult?
> 

*PLONK*

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


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

Date: Fri, 25 Aug 2000 08:53:33 GMT
From: eastking@my-deja.com
Subject: legal date
Message-Id: <8o5c67$vsp$1@nnrp1.deja.com>

Hello, every one here.

I have three variable as following:

my $year = '1999'
my $month = '09'
my $day = '31';

I want to get a legal day most close(forward) to the day encrypted by
the three variable '19990931'. In this case it should be '19990930'.

How can I do it?

Thanks in advance.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 25 Aug 2000 09:20:54 GMT
From: Mark Williams <mark@orctel.co.uk>
Subject: Local install of perl modules
Message-Id: <39A63A7A.87C6C27B@orctel.co.uk>

Is it possible to install perl modules in a local directory?
My problem is my cgi host will not install modules that I need. Can I
install modules on my local machine in a local directory and copy them
up to my host into a local directory?
Am I talking rubbish?
MArk


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

Date: Fri, 25 Aug 2000 08:58:46 GMT
From: zideon@my-deja.com
Subject: Perl and mod
Message-Id: <8o5cg0$vvn$1@nnrp1.deja.com>

Hello,

Can somebody tell my how I can calculate with 'mod'?

P.E. $xy = 207 mod 3;

Regards
Zid


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 25 Aug 2000 09:31:25 GMT
From:  <dwb1@home.com>
Subject: Re: Perl and mod
Message-Id: <Pine.LNX.4.20.0008250445120.21777-100000@ethyl.addictmud.org>

On Fri, 25 Aug 2000 zideon@my-deja.com wrote:

> Hello,
> 
> Can somebody tell my how I can calculate with 'mod'?
> 
> P.E. $xy = 207 mod 3;
> 

$xy = 207 % 3;




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

Date: 25 Aug 2000 07:59:43 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Please wait... [was: Perl - Blinking Text]
Message-Id: <967190203.7571@itz.pp.sci.fi>

In article <8F9AC091Ddarkononenet@206.112.192.118>, David Wall wrote:
>How about approximating e using random numbers?  :-)

 ..or the Towers of Hanoi:

#!/usr/bin/perl -w
use strict;

sub show {
    local $| = 1;
    local $" = "";
    print "\r", join " " => map "(@$_)" => @_;
    sleep 1;
}

sub hanoi {
    my ($from, $to, $cnt, @piles) = @_;
    return unless $cnt > 0;
    my $spare = ($from+1) % @piles;
    $spare = ($to+1) % @piles if $spare == $to;

    hanoi($from, $spare, $cnt-1, @piles);
    push @{$piles[$to]}, pop @{$piles[$from]};
    show(@piles);
    hanoi($spare, $to, $cnt-1, @piles);
}

my @piles = (['A'..'Z'], [], []);
hanoi(0, 2, 26, @piles);
print "\n";

__END__    

-- 
Ilmari Karonen - http://www.sci.fi/~iltzu/
"True, but the user receiving the e-mailed password might think
 'Strange, I don't remember choosing "&\xe7?\x9b\x3f\t\xef\xb7"
 as my password, and how do I type it?'"  -- Keith C. Ivey


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

Date: 25 Aug 2000 09:38:20 +0100
From: David Riley <dave@dmriley.demon.co.uk>
Subject: Re: Please wait... [was: Perl - Blinking Text]
Message-Id: <m3r97d7n2b.fsf@dmriley.demon.co.uk>

Ilmari Karonen <iltzu@sci.invalid> writes:

> Another somewhat simpler looking animation I came up with is:
> 
>   perl -e '$i=$|=1; print "\rPlease wait", grep tr/01/ ./ =>
>            unpack "b*" => pack "V" => $i^=$i<<1 while sleep 1'

I like this one best so far. It also looks good using Abigail's
prime number regexp:

perl -e '$i=$|=1; while ($i++) {print "\rPlease wait", grep tr/01/ ./ =>
unpack "b*" => pack "V" => $i if (1 x $i) !~ /^(11+)\1+$/ and sleep 1;'}

-- 
David Riley 		dave@dmriley.demon.co.uk


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

Date: Fri, 25 Aug 2000 08:36:29 GMT
From: zejames@my-deja.com
Subject: Re: RegEx
Message-Id: <8o5b6c$uob$1@nnrp1.deja.com>



Hello,

> If what you expected was 'perl' you could have done either
>
> m#.*/(.*)#
>
> which works because the first .* gets the first shot at being greedy
or

Yes, that's what I did to have what I wanted (the substring 'perl').
But I think I don't really understand what it does. I thought that
being greedy means, with    m#/(.*)#

  /(usr/local/bin/perl)   matches
  /usr/(local/bin/perl)   matches too
  /usr/local/(bin/perl)   matches :-))
  /usr/local/bin/(perl)   matches

  How does it choose between all this possibilities. Can anyone tell
what it really does internally?

> Now I know this wasn't very funny compared to the developments in
other
> parts of this thread but perhaps I actually answered the question?

I did not explained well my problem, but you understood my question
;-). Thank you :-))

James


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 25 Aug 2000 09:36:12 GMT
From: zejames@my-deja.com
Subject: Re: RegEx
Message-Id: <8o5emb$2ck$1@nnrp1.deja.com>


>
> Wha?
>
> mo·tif (m-tf)
>   n.
>
>     1.
>       a.A recurrent thematic element in an artistic or literary work.
>       b.A dominant theme or central idea.
>     2.Music. A short significant phrase in a composition.
>     3.A repeated figure or design in architecture or decoration.
>
> We must try to use appropriate words, ok?
>
Excuse me, it was a translation of the french appropriate word. I'll
try to use the english word next time :-))

James



Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 25 Aug 2000 05:46:10 GMT
From: Steve Mading <madings@baladi.bmrb.wisc.edu>
Subject: Re: Regular expression, $1 in a $variable.
Message-Id: <8o5172$ars$3@news.doit.wisc.edu>

Rafael Garcia-Suarez <rgarciasuarez@free.fr> wrote:

: In fact $1 is never evaluated, it appears in a single-quoted string.

Well, not really.  I simplified my example for the post.  In reality,
it's reading the value of $replacewith out of a text config file, so
it's *like* it's being single-quoted (It's read in literally, which
is what I want at that point.  I don't want the $1 evaled until the
search happens and $1 is set to the backreference value.)

: Try the following:
:     $str =~ s/$searchfor/eval qq("$replacewith")/eg;

Ah, I'll try that.

: Note also that eval'uating untrusted data may lead to security issues.
: Make sure that your config file is not writable by any untrusted users.

I'm the author of the config file.  It's only writeable by me.

Thanks for the advice.


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

Date: Fri, 25 Aug 2000 03:44:01 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Remove a backslash from a string.
Message-Id: <39a7eac3.3720802@news.newsguy.com>

Ulrich Ackermann <uackermann@orga.com> wrote:

>Did you mask your backslash? Maybe
>    $itemvalue =~ s/\\//;
>does what you where looking for.

That removes only the first backslash.  Add /g to remove them
all.  And to do it faster, use

    $itemvalue =~ tr/\\//d;

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


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

Date: 25 Aug 2000 00:51:28 -0400
From: Jordan Katz <katz@underlevel.net>
Subject: Re: Remove a backslash from a string.
Message-Id: <m3em3evt7z.fsf@underlevel.underlevel.net>

kcivey@cpcug.org (Keith Calvert Ivey) writes:

> Ulrich Ackermann <uackermann@orga.com> wrote:
> 
> >Did you mask your backslash? Maybe
> >    $itemvalue =~ s/\\//;
> >does what you where looking for.
> 
> That removes only the first backslash.  Add /g to remove them
> all.  And to do it faster, use
> 
>     $itemvalue =~ tr/\\//d;

Please excuse my ignorance, but why is tr faster than s// in this
particular case?  Also, I don't see a mention of a `d' option to tr in
perlop, so I take it you meant `g'. 
-- 
Jordan Katz <katz@underlevel.net>


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

Date: Fri, 25 Aug 2000 05:11:26 GMT
From: mgjv@verbruggen.comdyn.com.au (Martien Verbruggen)
Subject: Re: Remove a backslash from a string.
Message-Id: <slrn8qbvv7.ma.mgjv@verbruggen.comdyn.com.au>

On 25 Aug 2000 00:51:28 -0400,
	Jordan Katz <katz@underlevel.net> wrote:
> kcivey@cpcug.org (Keith Calvert Ivey) writes:
> 
> > Ulrich Ackermann <uackermann@orga.com> wrote:
> > 
> > >Did you mask your backslash? Maybe
> > >    $itemvalue =~ s/\\//;
> > >does what you where looking for.
> > 
> > That removes only the first backslash.  Add /g to remove them
> > all.  And to do it faster, use
> > 
> >     $itemvalue =~ tr/\\//d;
> 
> Please excuse my ignorance, but why is tr faster than s// in this
> particular case?  Also, I don't see a mention of a `d' option to tr in
> perlop, so I take it you meant `g'. 

tr is generally faster than substitution, but without a benchmark
that's hard to prove. it has to do a lot less work than a regexp ngine
and a replacement of strings which are potentially not equal in
length. tr always replaces characters, or removes them. That sort of
stuff is just much easier to deal with, would require less code at the
low level, and fewer machine instructions. However, we're at such a
high level that it's hard to tell. But, in general, if a task can be
done both by tr/// and s///, the tr will beat it hands down.

# man perlop
[snip]
       tr/SEARCHLIST/REPLACEMENTLIST/cdsUC
[snip]
               Options:

                   c   Complement the SEARCHLIST.
                   d   Delete found but unreplaced characters.
                   s   Squash duplicate replaced characters.
                   U   Translate to/from UTF-8.
                   C   Translate to/from 8-bit char (octet).
[snip]

I don't know which bit of perlop you read, but I clearly see a d
option, and not a g...

Martien

PS. The 5.005 documentation won't have the U and C options.
-- 
Martien Verbruggen              | 
Interactive Media Division      | I took an IQ test and the results
Commercial Dynamics Pty. Ltd.   | were negative.
NSW, Australia                  | 


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

Date: 25 Aug 2000 08:24:22 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Remove a backslash from a string.
Message-Id: <slrn8qcb8a.tj3.abigail@alexandra.foad.org>

Martien Verbruggen (mgjv@verbruggen.comdyn.com.au) wrote on MMDLI
September MCMXCIII in <URL:news:slrn8qbvv7.ma.mgjv@verbruggen.comdyn.com.au>:
"" 
"" # man perlop
"" [snip]
""        tr/SEARCHLIST/REPLACEMENTLIST/cdsUC
"" [snip]
""                Options:
"" 
""                    c   Complement the SEARCHLIST.
""                    d   Delete found but unreplaced characters.
""                    s   Squash duplicate replaced characters.
""                    U   Translate to/from UTF-8.
""                    C   Translate to/from 8-bit char (octet).
"" [snip]
"" 
"" I don't know which bit of perlop you read, but I clearly see a d
"" option, and not a g...
"" 
"" Martien
"" 
"" PS. The 5.005 documentation won't have the U and C options.


And neither will 5.6.1.  tr///UC was a mistake and it will be dropped
in the next version of Perl.


Abigail
-- 
perl -wle 'eval {die [[qq [Just another Perl Hacker]]]};; print 
           ${${${@}}[$#{@{${@}}}]}[$#{${@{${@}}}[$#{@{${@}}}]}]'      


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

Date: Fri, 25 Aug 2000 04:19:23 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Replace "XYZ" but not "ABCXYZ"??? - HELP!!
Message-Id: <39aaf14b.5393058@news.newsguy.com>

Stephen Kloder <stephenk@cc.gatech.edu> wrote:
>Marcus wrote:
>
>> I am having some trouble using regular expressions to search and
>> replace.  The problem is that I want to replace the occurrence
>> of "\w+@\w+\.\S+" (i.e. any email address like jack@whatever.com) with
>> some other text, but if "\w+@\w+\.\S+" is preceded by "XYZ"
>> (i.e. "XYZjack@whatever.com") then I DO NOT want the replacement to
>> take place.
[snip]
>s/(?<!XYZ)\w+@\w+\.\S+/WHATEVERTEXT/ should do the trick.

Did you try it?  An e-mail address that starts with 'XYZ' is
preceded by something that doesn't match 'XYZ'.

    #!/usr/bin/perl -w
    use strict;
    $_ = 'XYZjack@whatever.com';
    s/(?<!XYZ)\w+@\w+\.\S+/WHATEVERTEXT/;
    print;

The output is 'XYZjack@whatever.com'.

One possibility is

    s{(\w+@\w+\.\S+)}
     { substr($1, 0, 3) eq 'XYZ' ?
           $1 :
           'WHATEVERTEXT' }e;

Of course, the regex doesn't match e-mail addresses very well.
For example, someone posted a message in this group today with
the perfectly ordinary address dietmar.staab@t-online.de, which
doesn't match because of problems in the regex both before and
after the @.  And the \S+ at the end is likely to include
punctuation at the end of the address.

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


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

Date: Fri, 25 Aug 2000 06:10:04 GMT
From: zchanggun@my-deja.com
Subject: robot
Message-Id: <8o52jh$kv1$1@nnrp1.deja.com>

hello
i'm new in this group
first, i wanna know how the web robot is made and moreover  the examples
thanks


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 25 Aug 2000 02:30:56 -0400
From: Albert Dewey <timewarp@shentel.net>
Subject: Re: robot
Message-Id: <39A612A0.1C72F310@shentel.net>

Hmmmmm, another newcomer who wants all our most top secret codes and he
hasn't even taken off his coat yet!

zchanggun@my-deja.com wrote:

> hello
> i'm new in this group
> first, i wanna know how the web robot is made and moreover  the examples
> thanks
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.



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

Date: 25 Aug 2000 08:26:18 GMT
From: abigail@foad.org (Abigail)
Subject: Re: self writing program
Message-Id: <slrn8qcbbu.tj3.abigail@alexandra.foad.org>

Stephen Montgomery-Smith (stephen@math.missouri.edu) wrote on MMDL
September MCMXCIII in <URL:news:39A4BF72.32E0C66E@math.missouri.edu>:
{} 
{} This looks really nice, but I couldn't figure out why it worked
{} from reading perlfunc.  Anyone wish to offer me clues?


man perlopentut


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


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

Date: Fri, 25 Aug 2000 10:06:38 +0200
From: "Thierry" <info@ezboo.com.xx>
Subject: SendMail and IIS
Message-Id: <8o5a0b$j42$1@reader1.fr.uu.net>

 Hi,

I am writting a simple script in Perl to make a Formail (form sent by
e-mail) on my web site.
It does not work !
How can I know if SendMail is installed on the server (Win NT, running IIS)
?
Any other idea are welcome.

Other perl scripts work fine.

Thanks
Regards

Thierry




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

Date: Fri, 25 Aug 2000 09:38:46 GMT
From: "Simon" <simon@nospam.edincc.co.uk>
Subject: Re: SMTP in formmail
Message-Id: <G8rp5.1346$NR3.202854@news1.cableinet.net>

James,

I have a form mail script that uses the following variable:

# recipient of all processed mail.
$recipient = 'simon.ruzgar@btinternet.com';

and then this sendmail routine

#Send mail
#open(MAIL, "|$mailprog -t $form{'to'}") || die "Can't open $mailprog!\n";
open (MAIL, "|$mailprog $recipient") || die "Can't open $mailprog!\n";
print MAIL "From: $form{'name'},\n";
print MAIL "Subject: Form mail.\n";
print MAIL "X-Mailer: mailcgi 1.0\n";
#Terminate mail headers.
print MAIL "\n";
print MAIL "hello,\n";
print MAIL "\n";
close(MAIL);

Good luck

Simon



<james_69yay@my-deja.com> wrote in message
news:8o47uk$n8l$1@nnrp1.deja.com...
> My server host tells me my perl script lacks a "send to address", which
> it says is an SMTP address.
>
> Could anyone tell me where (in my sendmail routine?) I need to place
> such a reference?
>
> I can post some excerpts from the script if that helps...
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.




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

Date: Thu, 24 Aug 2000 23:59:43 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: trying to pull each string from file to evaluate...
Message-Id: <MPG.140fb93a4f088c4998acdf@nntp.hpl.hp.com>

In article <8o4omm$abq$1@nnrp1.deja.com>, amonotod@netscape.net says...
> 
> >    select(undef, undef, undef, 0.25);
> >    # Sleep for a quarter second so we don't use too many CPU's
> 
> Wouldn't sleep() work just as well?

Not for naps that short.  Its resolution is 1 second.

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


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

Date: Fri, 25 Aug 2000 03:52:15 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: unpack format question
Message-Id: <39a8ec87.4172893@news.newsguy.com>

frbuck@bell-labs.com (Fred R. Buck) wrote:

>	($id, $idx, $count, $length, @binblock, $progn, $pcount) =
>unpack('IISIC128II', $header);
>
>given the script fragment above my problem is the number of bytes
>extracted into @binblock.  When I run the script $#binblock yields 129
>and empty values for $progn and $pcount. $id, $idx, $count and $length
>all contain appropriate values after the unpack.

Larry Rosler has already explained the problem.  One possible
solution would be to use an array slice instead of an array.
Replace @binblock with @binblock[0 .. 127].  But are you sure
you want the data to be an array rather than just a string?  
It doesn't seem very Perlish.

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


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

Date: Fri, 25 Aug 2000 08:48:16 GMT
From: cbdeja@my-deja.com
Subject: URLs ending in /
Message-Id: <8o5bsc$vca$1@nnrp1.deja.com>

What is the difference between the URLs (for example):

  http://www.acme.com/support
  http://www.acme.com/support/

The only difference I could guess at is that the first could concievably
be referencing a file, whereas the second implies that it MUST be a
directory.

However, as you wouldn't be able to have a file and a directory with the
same name, it seems to me that the trailing / is redundant. Is there
really a need for it?

Perhaps the server would send an error page if 'support' was actually a
file on the server but the submitted URL ended in a /.

But normally if you were embedding a URL in one of your pages which
points to directory, can you safely omit the trailing / in the URL ?

Colin


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 25 Aug 2000 09:14:04 GMT
From: Jukka.Korpela@hut.fi (Jukka Korpela)
Subject: Re: URLs ending in /
Message-Id: <39a63852.1306871381@news.cs.hut.fi>

cbdeja@my-deja.com wrote:

>What is the difference between the URLs (for example):
>
>  http://www.acme.com/support
>  http://www.acme.com/support/

This is not a Perl question at all. Please consult the Web Authoring FAQ
entry http://www.htmlhelp.com/faq/html/basics.html#url-slash
And if problems remain, select a suitable group for further questions on
this.
-- 
Jukka "Yucca" Korpela, http://www.hut.fi/u/jkorpela/
Signatures should be 4 lines max., see
http://www.math.fu-berlin.de/%7Eguckes/sig/improved.html


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

Date: Fri, 25 Aug 2000 04:36:09 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: use CGI to remove files
Message-Id: <8o4t3o$eun$1@nnrp1.deja.com>

In article <8o4qst$krl$1@news.cis.nctu.edu.tw>,
  is83024@cis.nctu.edu.tw (doco) wrote:
> amonotod (amonotod@netscape.net) ´£¨ì:
> : In article <8o2qno$55g$1@news.cis.nctu.edu.tw>,
> :   is83024@cis.nctu.edu.tw (doco) wrote:
> : Do you have a webserver on your local machine?  If not, see
> I have configured the NES webserver correctly before this problem
> orrured.
>

Okay, in your OP you listed this as your source:

rm_list_file(@ARGV);
 sub rm_list_file
 {
 $a = $_[0];
 if ($a eq "")
 { print 6;}
 else
 { print m $a;}
 print $a;
 }

Two points:
1) Taking it literally, how is your webserver/cgi passing an @ARGV to
your script?
2) Line 8: { print ?m $a;}  What is the question mark?  Deja screwed it,
so you'll have to clue me in.

amonotod


--
    `\|||/                     amonotod@
      (@@)                     netscape.net
  ooO_(_)_Ooo________________________________
  _____|_____|_____|_____|_____|_____|_____|_____|


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 25 Aug 2000 09:22:57 GMT
From: is83024@cis.nctu.edu.tw (doco)
Subject: Re: use CGI to remove files
Message-Id: <8o5dth$5st$1@news.cis.nctu.edu.tw>

: Two points:
: 1) Taking it literally, how is your webserver/cgi passing an @ARGV to
: your script?
http://localhost/cgi-bin/kill.cgi?delete_filename
: 2) Line 8: { print ?m $a;}  What is the question mark?  Deja screwed it,
sorry
copy paster error
it is
{print `rm $a`;}
: so you'll have to clue me in.
: amonotod


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

Date: Fri, 25 Aug 2000 05:46:35 GMT
From: ivolla@my-deja.com
Subject: what's happening
Message-Id: <8o517m$jec$1@nnrp1.deja.com>

My version of perl is being weird. The postincrement operator doesnt
seem to work.

$hole = 5;
$bighole = $hole++;
print ("$bighole \n");

prints 5!!!

I am running version 5.005_03 for sparc-linux

I am new to this and I can't figure it out. Maybe it's an
administration thing?

Any help would be great.



Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 25 Aug 2000 15:53:42 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: what's happening
Message-Id: <Mhop5.154$Pe3.3282@vic.nntp.telstra.net>

<ivolla@my-deja.com> wrote in message
news:8o517m$jec$1@nnrp1.deja.com...
> My version of perl is being weird. The postincrement operator doesnt
> seem to work.
>
> $hole = 5;
> $bighole = $hole++;
> print ("$bighole \n");
>
> prints 5!!!
>

The key here is the word 'postincrement'.

What is happening is that $hole is being assigned to $bighole (5) and
then being incremented to 6!

print $hole to see what happens.

You probably want the preincrement which is

$bighole = ++$hole;

Where $hole is incremented to 6 THEN assigned to $bighole.

Wyzelli




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

Date: Fri, 25 Aug 2000 02:27:19 -0400
From: Albert Dewey <timewarp@shentel.net>
Subject: Re: what's happening
Message-Id: <39A611C7.2A34718E@shentel.net>

That is what should print. You are using a post autoincrement. Try

$bighole = ++$hole;

instead if you want to increment prior to passing the value of $hole.

Actually if you use your code and add to it as follows -

$hole = 5;
$bighole = $hole++;
$bighole = $hole;
print ("$bighole \n");

It should now print 6. But a cleaner way would be to use -

$hole = 5;
$hole++;
$bighole = $hole;
print ("$bighole \n");

Albert Dewey

ivolla@my-deja.com wrote:

> My version of perl is being weird. The postincrement operator doesnt
> seem to work.
>
> $hole = 5;
> $bighole = $hole++;
> print ("$bighole \n");
>
> prints 5!!!
>
> I am running version 5.005_03 for sparc-linux
>
> I am new to this and I can't figure it out. Maybe it's an
> administration thing?
>
> Any help would be great.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.



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

Date: Fri, 25 Aug 2000 09:57:55 +0100
From: "Louise Davis" <louise.davis@breathemail.net>
Subject: Re: what's happening
Message-Id: <39a633c0$1_2@news2.vip.uk.com>

Yes, it would, the postincrement operator increments $hole AFTER the
assignment.

try:
$bighole = ++$hole;

Lou


<ivolla@my-deja.com> wrote in message news:8o517m$jec$1@nnrp1.deja.com...
> My version of perl is being weird. The postincrement operator doesnt
> seem to work.
>
> $hole = 5;
> $bighole = $hole++;
> print ("$bighole \n");
>
> prints 5!!!
>
> I am running version 5.005_03 for sparc-linux
>
> I am new to this and I can't figure it out. Maybe it's an
> administration thing?
>
> Any help would be great.
>
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.




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

Date: Fri, 25 Aug 2000 10:17:31 +0100
From: "Mark Dressel" <mark@artwarren.com>
Subject: Re: Where is the Perl Newbie or Begginers group?
Message-Id: <39a639b8@news.server.worldonline.co.uk>

Newbies need newsgroups as much as anyone else!

As students we are encouraged to solve problems for ourselves, using
whatever resources are available to us. This is good practice as it teaches
you to develop broad problem solving skills, but there is also a point of
diminishing returns. When you have a limited grasp of the 'big picture' it
can be very difficult to know where to look for a solution. A newbie can
literally spend days searching for a solution, time that could be better
spent in more direct learning.

A simple posting of mine into the Ada newsgroup created a heated debate as
to whether students should be allowed to post into the newsgroup. The
participants were split 50%/50% as to whether this should be allowed. If the
student/newbie puts newbie or student in the heading, then those that do not
want to be troubled with 'silly' questions can ignore these posts. Those
that are willing to give a hand, of which there are many, can deal with the
problem.

Those who may have read "Zen and the Art of Motorcycle Maintenance" may
remember the section where the author concludes that the entire value of his
bike (Harley Davison?) can rest on one rusty screw that will not come out.
So it is with students when assignment deadlines and exams are looming and
are programs are stuck on one incomprehensible problem.

Unfortunatley there is a view that students doss around and if they picked
up a book they would find the answer. Most of us work hard and with ever
decreasing college resources - particularly tutor time - need things like
newsgroups to help us on our way.

Mark

Mark




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

Date: Fri, 25 Aug 2000 01:07:01 -0700
From: Gabe <grichards@flashcom.net>
Subject: Wrong @INC in Apache
Message-Id: <39A62925.4CC8E4EA@flashcom.net>

I realize this might not be a Perl issue, but I'm not sure so I'm
posting to both groups.

After  installing 5.6.0 I deleted all the 5.00503 directories and
programs. Upon boot, Apache tells me it  can't find Cwd.pm in @INC and
it displays the contents of @INC. The @INC Apache is working with is for
the 5.00503 distribution (i.e. /usr/lib/perl5/5.00503). Well, that
directory doesn't exist anymore and @INC should contain things like
/usr/lib/perl5/5.6.0/. Funny thing is, when I have Perl print out @INC
it prints out what I expect. So apparently, somehow Apache is operating
with the prior distribution's @INC, how do I get it to see the @INC for
5.6.0?

Thanks,

Gabe



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

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


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