[15776] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3189 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 28 18:05:56 2000

Date: Sun, 28 May 2000 15:05:23 -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: <959551522-v9-i3189@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 28 May 2000     Volume: 9 Number: 3189

Today's topics:
    Re: "Decoding" variable <gellyfish@gellyfish.com>
        (offtopic) Where can I find cron for Win98? <evilbeaver@NOSPAMlogiclrd.cx>
    Re: array question <iltzu@sci.invalid>
    Re: BEGIN and use (David Combs)
    Re: BEGIN and use (Ilya Zakharevich)
        Bout mailhandling <idamhNOidSPAM@mailcity.com.invalid>
    Re: Can I do this using Perl? (Craig Berry)
    Re: Can I do this using Perl? (Andrew Johnson)
    Re: Can I do this using Perl? (Craig Berry)
    Re: can perl do expire page like asp <s0218327@unix1.cc.ysu.edu>
    Re: can perl do expire page like asp <tfm@sei.cmu.edu>
    Re: can perl do expire page like asp <dchk_78NOdcSPAM@yahoo.com.invalid>
    Re: Can't get my search and replace script to work dutchm@my-deja.com
    Re: Cap.pm <gellyfish@gellyfish.com>
        CHDIR - I can't get it to work <kenny@kenny.co.uk>
    Re: CHDIR - I can't get it to work <bwalton@rochester.rr.com>
    Re: CHDIR - I can't get it to work <3ironNO3iSPAM@bigfoot.com.invalid>
    Re: Chop <godzilla@stomp.stomp.tokyo>
    Re: Chop <debbieY2Kremovethis@mindspring.com>
    Re: Converting an alphanumeric string into an integer n (Craig Berry)
    Re: Converting an alphanumeric string into an integer n <godzilla@stomp.stomp.tokyo>
    Re: Converting an alphanumeric string into an integer n <diab.litoNOdiSPAM@usa.net.invalid>
        date command under win98 and apache <gcaptain@pandora.be>
    Re: date command under win98 and apache <dave@dave.org.uk>
        Dos or Unix function <lubbers@jps.net>
    Re: Dos or Unix function <phill@modulus.com.au>
        How do I become a memory hog? <dchungNOdcSPAM@amazon.com.invalid>
    Re: How do I become a memory hog? <bwalton@rochester.rr.com>
    Re: How Sambar 4.2 run CGI ? <gellyfish@gellyfish.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 28 May 2000 02:57:32 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: "Decoding" variable
Message-Id: <8gpuec$huo$1@orpheus.gellyfish.com>

On Fri, 26 May 2000 13:21:49 -0700 Larry Rosler wrote:
> In article <8glrqt$km3$1@porthos.nl.uu.net> on Fri, 26 May 2000 14:48:16 
> +0200, Robert Voesten <robert@pharmapartners.nl> says...
> 
> ...
> 
>> DTM07137199810121215203
> 
> ...
> 
>> So the question is: How do I convert this code into "Date of creation: 12th
>> Octobre 1998 at 12:15 (PM)"
> 
> The substr() and regex solutions that have been posted are a bloody pain 
> in the arse (sorry, /J\ :-) to write and maintain. 

Hey its not my arse .

/J\
-- 
It's not easy to juggle a pregnant wife and a troubled child, but somehow
I managed to squeeze in 8 hours of TV a day.
-- 
fortune oscar homer


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

Date: Sun, 28 May 2000 18:42:52 GMT
From: "The Evil Beaver" <evilbeaver@NOSPAMlogiclrd.cx>
Subject: (offtopic) Where can I find cron for Win98?
Message-Id: <MMdY4.245122$Kv2.436881@quark.idirect.com>

Does it exist? If so, where can I get it? Thanks in advance,

--
The Evil Beaver <evilbeaver@NOSPAMlogiclrd.cx>
-- Remove NOSPAM to e-mail me.
This message ROT-13 encrypted twice for extra security.





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

Date: 28 May 2000 14:01:10 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: array question
Message-Id: <959521030.21572@itz.pp.sci.fi>

In article <8goj4i$v58$1@nnrp1.deja.com>, Ilja wrote:
>In article <MPG.1398866f5a1832b698aaf0@nntp.hpl.hp.com>,
>>     push @a, $new_value;
>>     shift @a if @a > 5;
>
>Maybe if OP wanted to add many values:
>
>push @a, @new_values;
>shift @a while @a > 5;

Using splice is faster than multiple shifts:

  push @a, @new_values;
  splice @a, 0, @a - 5 if @a > 5;

-- 
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla and its pseudonyms - do not feed the troll.



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

Date: 28 May 2000 04:16:37 GMT
From: dkcombs@netcom.com (David Combs)
Subject: Re: BEGIN and use
Message-Id: <8gq6j5$l89$1@slb3.atl.mindspring.net>

In article <MPG.13862be914ddcad998aa6a@nntp.hpl.hp.com>,
Larry Rosler  <lr@hpl.hp.com> wrote:

snip
>    sub a { return; "Not reached" }
>
>So then perlsub should read:
>
>"The value returned by a subroutine on reaching the end of the defining 
>block is the value of the last expression evaluated, if any; the value 
>returned by a subroutine on executing a 'return' is the value of the 
>following expression, if any.  In either case, if no expression has been 
>evaluated, the value returned is undef or () depending on context."
>
>Is this worth a documentation patch?
>

YES!

David



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

Date: 28 May 2000 05:08:47 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: BEGIN and use
Message-Id: <8gq9kv$osm$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to Larry Rosler  <lr@hpl.hp.com>
w wrote in article <MPG.13862be914ddcad998aa6a@nntp.hpl.hp.com>:

> >"The value returned by a subroutine on reaching the end of the defining 
> >block is the value of the last expression evaluated, if any; the value 
> >returned by a subroutine on executing a 'return' is the value of the 
> >following expression, if any.

Hmm?  Is not the latter case a particular case of the former?

Ilya


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

Date: Sun, 28 May 2000 14:33:09 -0700
From: Fake51 <idamhNOidSPAM@mailcity.com.invalid>
Subject: Bout mailhandling
Message-Id: <15f18010.e31a89fa@usw-ex0103-018.remarq.com>

 I need to write a program that takes the email received by a
site, works on the data contained therein, and inserts it in a
database. I figure this is sort of an easy thing to, but being a
beginner, any/all help would be appreciated (on all aspects of
the project).

Thanx
Fake

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Sun, 28 May 2000 18:16:16 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Can I do this using Perl?
Message-Id: <sj2ojgqj5pj45@corp.supernews.com>

Tony O'Brien (tobrien@isintegration.co.uk) wrote:
: How does perl handle graphics?

That's not really your question; see below.

: I am trying to implement the following on a website, but I am not sure
: if it can be done using perl:

Virtually anything that *can* be done using any programming language can
be done using Perl, and in fact most of the 'webbish' things are easy to
do using prebuilt modules.

: The user clicks a link on the website to view a report.  
: The script then has to connect to a partner website, run the report
: and present the results back on this website.
: i.e. the user clicks a link and a report is presented to them in a
: frame.  They are unaware of where the report was generated.

Pretty trivial using the LWP modules, which have been part of the standard
distribution in the last few releases of Perl.  See for example
LWP::Simple.  Your app would use its 'get' method to grab the remote site,
and simply echo it to the standard output to populate the frame on the
client.

: The report contains graphical elements (graphs) and I do not know if
: perl will choke on this.  Can anyone advise please?

If the <img> tags on the report page use absolute URLs, then the client
will go straight to the report-generating machine to get them, and all
will be well.  If the report page uses relative URLs, these won't work.
You'll need to do something more involved (like dynamically transforming
relative to absolute URLs in your middleman app) to deal with this.

Needless to say, just pointing the frame in question at the
report-generating host directly would seem far more straightforward, but I
assume you have some good reason not to do so.

-- 
   |   Craig Berry - cberry@cinenet.net
 --*--  http://www.cinenet.net/users/cberry/home.html
   |   "The road of Excess leads to the Palace
      of Wisdom" - William Blake


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

Date: Sun, 28 May 2000 19:19:10 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: Can I do this using Perl?
Message-Id: <OieY4.873$55.10731@news1.rdc1.mb.home.com>

In article <sj2ojgqj5pj45@corp.supernews.com>,
 Craig Berry <cberry@cinenet.net> wrote:
[snip]
> Pretty trivial using the LWP modules, which have been part of the standard
> distribution in the last few releases of Perl.  See for example

I don't see the LWP modules in the standard 5.00503 or 5.6.0
distributions -- perhaps you mean they are bundled with the
activestate distribution (which doesn't make them part of the
standard distribution). Just a point of clarification.

andrew

-- 
Andrew L. Johnson   http://members.home.net/andrew-johnson/epwp.html
      Optimist:  The glass is half full.
      Pessimist: The glass is half empty.
      Engineer:  The glass is twice as big as it needs to be.


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

Date: Sun, 28 May 2000 21:08:19 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Can I do this using Perl?
Message-Id: <sj32m3c15pj60@corp.supernews.com>

Andrew Johnson (andrew-johnson@home.com) wrote:
: In article <sj2ojgqj5pj45@corp.supernews.com>,
:  Craig Berry <cberry@cinenet.net> wrote:
: [snip]
: > Pretty trivial using the LWP modules, which have been part of the standard
: > distribution in the last few releases of Perl.  See for example
: 
: I don't see the LWP modules in the standard 5.00503 or 5.6.0
: distributions -- perhaps you mean they are bundled with the
: activestate distribution (which doesn't make them part of the
: standard distribution). Just a point of clarification.

You're quite right; until you pointed it out, I thought the two were
identical other than Windows-specific modules.  Thanks for the catch.

-- 
   |   Craig Berry - cberry@cinenet.net
 --*--  http://www.cinenet.net/users/cberry/home.html
   |   "The road of Excess leads to the Palace
      of Wisdom" - William Blake


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

Date: Sun, 28 May 2000 13:23:11 -0400
From: NagaPutih <s0218327@unix1.cc.ysu.edu>
Subject: Re: can perl do expire page like asp
Message-Id: <Pine.A41.4.20.0005281319230.51920-100000@unix1.cc.ysu.edu>

On Sun, 28 May 2000, Ted Marz wrote:
> Chung Derek wrote:
> > i think everyone have seen asp program. when someone clicks the
> > back button of the browser, a page comes up telling the page
> > have expired.

there's a way to set expiration date on script-generated HTML pages:

print "Content-type: text/html\n";
print "Expires: $expiration_data_on_GMT\n\n";
print <<HTMLPAGE;
 ...
HTMLPAGE

insert line "Expires..." right after "Content-type...".
if you set it at the time it was generated, when you re-visit it
you're forced to refresh.



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

Date: Sun, 28 May 2000 08:34:39 -0400
From: Ted Marz <tfm@sei.cmu.edu>
Subject: Re: can perl do expire page like asp
Message-Id: <3931125F.3479001E@sei.cmu.edu>

I haven't tried this... however,
  I strongly suspect that this has nothing to do with either Perl or
asp's.
I suspect that they have a <meta> tag in the generated document, that
has an expiration
(or perhaps it is in the header, rather than as a meta tag... I don't
remember).

Check a HTML reference.

Ted

Chung Derek wrote:
> 
> i think everyone have seen asp program. when someone clicks the
> back button of the browser, a page comes up telling the page
> have expired.
> 
> i would like to know if there is a way to do that in perl
> 
> * Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
> The fastest and easiest way to search and participate in Usenet - Free!


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

Date: Sun, 28 May 2000 10:48:55 -0700
From: Chung Derek <dchk_78NOdcSPAM@yahoo.com.invalid>
Subject: Re: can perl do expire page like asp
Message-Id: <01fe9a1a.f5c4dc2e@usw-ex0106-046.remarq.com>

thanks, can you however give me a clearer definition on the
variable $expiration_data_on_GMT

eg. print "Expires: $expiration_data_on_GMT\n\n";

what is supposed to be entered, is there a fromat that i need to
follow


* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Sun, 28 May 2000 13:34:18 GMT
From: dutchm@my-deja.com
Subject: Re: Can't get my search and replace script to work
Message-Id: <8gr78q$leg$1@nnrp1.deja.com>

Thanks again,
I did get the script to work by setting the $/ = ""; for multiline mode. 

And also using single quotes and of course escaping the metacharacters.
 Brad, I also got your note but perldoc -q does not work on my unix OS
but I assume it had to do also with the $/. Is there some other
variation of perldoc -q that I should be using on unix?

Thanks again for the advise.
P.S I did remove the unnecessary overhead from the script


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


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

Date: 28 May 2000 01:09:46 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Cap.pm
Message-Id: <8gpo4a$t0i$1@orpheus.gellyfish.com>

On 25 May 2000 22:10:07 GMT Brandon Metcalf wrote:
> 
> If this is better asked in another newsgroup, please let me know.
> 
> Anway, does the Term::Cap module work on aix as a termcap file doesn't
> exist on aix in the places where the module looks for it.  Actually, it
> doesn't seem to exist in text format anywhere.
> 

On some systems that dont support termcap you probably want to use
terminfo via Term::Info (infact you probably want to use that on any
system that supports it ).

> Also, /etc/termcap on hpux doesn't have entries for xterm or dtterm.
> So, with the env var set to either one of these, the module won't work
> on hpux either.
> 

Well you could use vt100 instead.  Alternatively you could write or
obtain the appropriate entry and add it to your termcap file - you
will want to ask in a more suitable newsgroup about that though. You
will probably find that the system has the appropriate terminfo entry
and you can use that module instead.

/J\
-- 
Dandyism is the assertion of the absolute modernity of Beauty.
-- 
fortune oscar homer


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

Date: Sun, 28 May 2000 13:52:53 +0100
From: "Kenny" <kenny@kenny.co.uk>
Subject: CHDIR - I can't get it to work
Message-Id: <8gr58r$5en$1@plutonium.btinternet.com>

I have an odd problem.  I am trying to use the CHDIR command to change to a
directory on my server.  However, when I use the command

chdir('/web/guide/maindirectory/') ? print ("It worked\n") : print ("It did
not work.\n");

I get the response "It worked", therefore indicating that the script has
successfully changed to that directory.  However, the very next line is

@all = <*.*>;

and when I print it, it does not bring the stuff back from the
/web/guide/maindirectory/ directory, it gives me a list of the files from
the root.

Anyone know if I am doing something wrong, or if I am expecting CHDIR to do
something that it can't do?





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

Date: Sun, 28 May 2000 19:44:31 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: CHDIR - I can't get it to work
Message-Id: <39317622.563A420C@rochester.rr.com>

Kenny wrote:
> 
> I have an odd problem.  I am trying to use the CHDIR command to change to a
> directory on my server.  However, when I use the command
> 
> chdir('/web/guide/maindirectory/') ? print ("It worked\n") : print ("It did
> not work.\n");
> 
> I get the response "It worked", therefore indicating that the script has
> successfully changed to that directory.  However, the very next line is
> 
> @all = <*.*>;
> 
> and when I print it, it does not bring the stuff back from the
> /web/guide/maindirectory/ directory, it gives me a list of the files from
> the root.
> 
> Anyone know if I am doing something wrong, or if I am expecting CHDIR to do
> something that it can't do?

I tried it on Activestate Perl build 613 under Windows 98 SE, and it
works fine.  Maybe you could post your actual code?  Here is my actual
code (run from c:\bob\junk, gives a listing of c:\bob):

   chdir('/bob/') ? print "It worked\n" : print "It didn't work\n";
   @all=<*.*>;
   print @all;

-- 
Bob Walton


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

Date: Sun, 28 May 2000 13:01:08 -0700
From: 3iron <3ironNO3iSPAM@bigfoot.com.invalid>
Subject: Re: CHDIR - I can't get it to work
Message-Id: <0e757294.c9348e27@usw-ex0102-015.remarq.com>

The email address you have provided in your post is wrong.

If anyone wishes to reply to this post, please do so through the
NG, not by email.

Regards.


* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Sun, 28 May 2000 11:54:34 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Chop
Message-Id: <39316B6A.73E03C31@stomp.stomp.tokyo>

BassGirl wrote:

> P.S. Godzilla, yes, I play electric bass, guitar, 
> a little keyboards & I sing. I don't fish much, 
> but my Dad loves to... he usually goes for King
> Salmon out of Lake Michigan though. 8-)


I've heard of King Solomon. Gosh, Stewart Granger
is such a handsome man. However I rather fancy
Deborah Kerr.

Last time I decided to try singing, my boyfriend
up and gave me a good mackerel upside the head
just for the halibut. Tell ya, thought I would
need a sturgeon to cure this haddock he gave me.


Godzilla!


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

Date: Sun, 28 May 2000 13:39:23 -0400
From: "BassGirl" <debbieY2Kremovethis@mindspring.com>
Subject: Re: Chop
Message-Id: <8grlmh$oa$1@slb7.atl.mindspring.net>

Godzilla & Peter,

You all are wonderful!

I have it up and working now and have learned something in the process.

I thought I knew how to do this, and probably would have found the answer if
I had taken time to just look it up, but the truth of the matter is that I
am on the very tail end of a LONG development project and was just too
frustrated with the mess to do so. You all have saved me from pulling out a
few more hairs!

Cheers to you & have an exquisit Memorial Day!

Debbie

P.S. Godzilla, yes, I play electric bass, guitar, a little keyboards & I
sing. I don't fish much, but my Dad loves to... he usually goes for King
Salmon out of Lake Michigan though. 8-)




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

Date: Sun, 28 May 2000 18:30:01 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Converting an alphanumeric string into an integer number
Message-Id: <sj2pd9he5pj176@corp.supernews.com>

Diablito (diab.litoNOdiSPAM@usa.net.invalid) wrote:
: I have a variable 'word' (letters and numbers) and I want to
: convert that into an integer in the range of 1-100.
: I need something like a=1,b=2,c=3,...Then I want the script to
: calculate a x variable:(example) if word is 'dog' x=26,if
: it's 'cat' x=23 and so on.

If you don't insist on the particular number mapping above, you can use
ASCII codes and a final modulo to do this:


#!/usr/bin/perl -w
# minihash - hash strings to number 1-100
# Craig Berry (20000528)

use strict;

while (<>) {
  chomp;
  my @chars   = split //;
  my $hashval = 0;

  $hashval += ord foreach @chars;
  $hashval %= 100;
  $hashval++;

  print "'$_' => $hashval\n";
}


Note that this isn't an especially good hash function for 'real'
hash-based algorithms.

-- 
   |   Craig Berry - cberry@cinenet.net
 --*--  http://www.cinenet.net/users/cberry/home.html
   |   "The road of Excess leads to the Palace
      of Wisdom" - William Blake


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

Date: Sun, 28 May 2000 12:22:29 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Converting an alphanumeric string into an integer number
Message-Id: <393171F5.BBEDC069@stomp.stomp.tokyo>

Diablito wrote:
 
> I have a variable 'word' (letters and numbers) and
> I want to convert that into an integer in the range
> of 1-100. I need something like a=1,b=2,c=3,...Then
> I want the script to calculate a x variable:(example)
> if word is 'dog' x=26, if it's 'cat' x=23 and so on.


Mr. Diablito, your goal is somewhat vague.

"...variable 'word' (letters and numbers)...."

An actual word or a string of mixed letters
and numbers?


"...I need something like a=1,b=2,c=3...."

This part is a piece of cake as you may
see from my test script and results print.


"...if word is 'dog' x=26, if it's 'cat' x=23...."

What are your parameters, your rules, your
mathematical equation for doing this? I can't
find a math relationship between those two.


Godzilla!



TEST SCRIPT
___________

#!/usr/local/bin/perl

print "Content-Type: text/plain\n\n";

$input = "
     get your motor running
     head out on the highway
     lookin' for adventure
     in whatever comes our way";

print "Input Is:
       $input \n\n";

@Alpha = (a .. z);

$counter = 1;

foreach $element (@Alpha)
 { 
  $input =~ s/$element/ $counter /gi;
  $counter++;
 }

print "Numercially Encoded:
       $input \n\n";

$counter = 1;

foreach $element (@Alpha)
 { 
  $input =~ s/ $counter /$element/gi;
  $counter++;
 }

print "Alphabetically Decoded:
       $input";


exit;



PRINTED RESULTS
_______________

Careful on word wrap, Numerically
Encoded should be four long lines.
_______________

Input Is:
       
     get your motor running
     head out on the highway
     lookin' for adventure
     in whatever comes our way 

Numercially Encoded:

     7  5  20   25  15  21  18   13  15  20  15  18   18  21  14  14  9 
14  7 
     8  5  1  4   15  21  20   15  14   20  8  5   8  9  7  8  23  1  25 
     12  15  15  11  9  14 '  6  15  18   1  4  22  5  14  20  21  18  5 
     9  14   23  8  1  20  5  22  5  18   3  15  13  5  19   15  21 
18   23  1  25  

Alphabetically Decoded:
       
     get your motor running
     head out on the highway
     lookin' for adventure
     in whatever comes our way


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

Date: Sun, 28 May 2000 13:59:07 -0700
From: Diablito <diab.litoNOdiSPAM@usa.net.invalid>
Subject: Re: Converting an alphanumeric string into an integer number
Message-Id: <010f5aa0.2761984b@usw-ex0106-046.remarq.com>

In article <393171F5.BBEDC069@stomp.stomp.tokyo>, "Godzilla!"
<godzilla@stomp.stomp.tokyo> wrote:
>Diablito wrote:
>
>> I have a variable 'word' (letters and numbers) and
>> I want to convert that into an integer in the range
>> of 1-100. I need something like a=1,b=2,c=3,...Then
>> I want the script to calculate a x variable:(example)
>> if word is 'dog' x=26, if it's 'cat' x=23 and so on.
>



>Mr. Diablito, your goal is somewhat vague.
>
>"...variable 'word' (letters and numbers)...."
>
>An actual word or a string of mixed letters
>and numbers?
>

You are right,I wasn't exact:the 'word' variable is actually not
a word but a string of mixed letters,numbers and blank spaces(a
sentence).

>
>"...I need something like a=1,b=2,c=3...."
>
>This part is a piece of cake as you may
>see from my test script and results print.
>
>
>"...if word is 'dog' x=26, if it's 'cat' x=23...."

>What are your parameters, your rules, your
>mathematical equation for doing this? I can't
>find a math relationship between those two.

Well,this part is clear enough;standing to the a=1,b=2,.. I want
a sentence like "I don't know what to write" to be converted in
a single number in the range 1-100,not a number for each letter
(cat=c(3)+a(1)+t(20)=24)


>TEST SCRIPT
>___________
>
>#!/usr/local/bin/perl
>
>print "Content-Type: text/plain\n\n";
>
>$input = "
>     get your motor running
>     head out on the highway
>     lookin' for adventure
>     in whatever comes our way";
>
>print "Input Is:
>       $input \n\n";
>
>@Alpha = (a .. z);
>
>$counter = 1;
>
>foreach $element (@Alpha)
> {
>  $input =~ s/$element/ $counter /gi;
>  $counter++;
> }
>
>print "Numercially Encoded:
>       $input \n\n";
>
>$counter = 1;
>
>foreach $element (@Alpha)
> {
>  $input =~ s/ $counter /$element/gi;
>  $counter++;
> }
>
>print "Alphabetically Decoded:
>       $input";
>
>
>exit;
>
>
>
>PRINTED RESULTS
>_______________
>
>Careful on word wrap, Numerically
>Encoded should be four long lines.
>_______________
>
>Input Is:
>
>     get your motor running
>     head out on the highway
>     lookin' for adventure
>     in whatever comes our way
>
>Numercially Encoded:
>
>     7  5  20   25  15  21  18   13  15  20  15  18   18  21
14  14  9
>14  7
>     8  5  1  4   15  21  20   15  14   20  8  5   8  9  7  8
23  1  25
>     12  15  15  11  9  14 '  6  15  18   1  4  22  5  14  20
21  18  5
>     9  14   23  8  1  20  5  22  5  18   3  15  13  5  19
15  21
>18   23  1  25
>
>Alphabetically Decoded:
>
>     get your motor running
>     head out on the highway
>     lookin' for adventure
>     in whatever comes our way

That's exactly what I needed ,other than the fact of adding the
singles numbers to have the 1 I need.

All the 3 codes posted (C.Berry,B.Walton,Godzilla!) worked
pretty fine,thanks everyone.
If you want to take a look at the script in action,it is at
www.astrobit.com

Mario


* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Sun, 28 May 2000 17:41:25 GMT
From: "Gcaptain" <gcaptain@pandora.be>
Subject: date command under win98 and apache
Message-Id: <9TcY4.65523$_R6.89575@afrodite.telenet-ops.be>

ok i have the apache webserver running under win98
perl is installed correctly

i have a script

#!c:\perl\bin\perl
print "Content-Type: text/plain\n\n";
$current_date = `date`;
print "Today is : $current_date\n";

but the date command does not work here
it brings out a question where i must enter the new date

how can i solve this? i must get this running under win98




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

Date: Sun, 28 May 2000 19:05:46 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: date command under win98 and apache
Message-Id: <lun2jss7r04f75t4v6881n9r8kcai5vc27@4ax.com>

On Sun, 28 May 2000 17:41:25 GMT, "Gcaptain" <gcaptain@pandora.be>
wrote:

>ok i have the apache webserver running under win98
>perl is installed correctly
>
>i have a script
>
>#!c:\perl\bin\perl
>print "Content-Type: text/plain\n\n";
>$current_date = `date`;
>print "Today is : $current_date\n";
>
>but the date command does not work here
>it brings out a question where i must enter the new date
>
>how can i solve this? i must get this running under win98

Then use Perl's built-in date handling functions.

perldoc -f localtime

hth,

Dave...


-- 
<http://www.dave.org.uk>  SMS: sms@dave.org.uk
yapc::Europe - London, 22 - 24 Sep <http://www.yapc.org/Europe/>

"There ain't half been some clever bastards" - Ian Dury [RIP]


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

Date: Sun, 28 May 2000 01:59:18 -0700
From: "Peter" <lubbers@jps.net>
Subject: Dos or Unix function
Message-Id: <ge5Y4.18864$RO1.767769@nntp3.onemain.com>

Hi,
Is there some package or module that can check wether you are running on a
Dos or Unix platform?
Thanks,
Peter




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

Date: Sun, 28 May 2000 19:14:38 +1000
From: Peter Hill <phill@modulus.com.au>
Subject: Re: Dos or Unix function
Message-Id: <3930E37E.6D7D@modulus.com.au>

Peter wrote:
> 
> Hi,
> Is there some package or module that can check wether you are running on a
> Dos or Unix platform?
> Thanks,
> Peter
Almost. The $^O variable returns the Operating System under which Perl
was *built*, which most of the time will be the same as the OS on which
it is being run. Certainly it is adequate for distinguishing between
Windows (you do mean Windows, not DOS, right?) and UNIX.

perldoc perlvar

-- 
Peter Hill,
Modulus Pty. Ltd.,
http://www.modulus.com.au/


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

Date: Sun, 28 May 2000 10:48:38 -0700
From: drc <dchungNOdcSPAM@amazon.com.invalid>
Subject: How do I become a memory hog?
Message-Id: <0080d087.154ef91d@usw-ex0102-014.remarq.com>

Here's a general question:

I have a script which needs to hold in memory about twice as much
as the default running of perl gives me.  I am pretty sure that
this will be more than enough, but I am not the most careful
programmer in the world ;)

Is there an easy way for me to reserve more memory?  I've heard
that there exists an unlimit function/option/command, but I don't
know much about it.

Thanks in advance!
Dean

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Sun, 28 May 2000 19:29:36 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: How do I become a memory hog?
Message-Id: <393172A3.87E3F5DB@rochester.rr.com>

drc wrote:
> 
> Here's a general question:
> 
> I have a script which needs to hold in memory about twice as much
> as the default running of perl gives me.  I am pretty sure that
> this will be more than enough, but I am not the most careful
> programmer in the world ;)
> 
> Is there an easy way for me to reserve more memory?  I've heard
> that there exists an unlimit function/option/command, but I don't
> know much about it.
 ...
> Dean
 ...
Dean, there are very few limitations built into Perl -- one of its
design goals was as few limitations as possible.  Thus, for memory, the
limitation is occurring not from Perl, but from your operating system. 
Since you don't say what your platform and operating system are, there
is little anyone can do to help.  But you might try making your swap
partition larger, or increase the size of your virtual memory, or buy
some more memory.  Or you might check how your program operates to see
if it is really necessary to hold everything in memory at once.  Maybe
using some tied hashes or a database would be better.
-- 
Bob Walton


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

Date: 28 May 2000 01:20:55 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How Sambar 4.2 run CGI ?
Message-Id: <8gpop7$v4u$1@orpheus.gellyfish.com>

On 26 May 2000 16:29:51 GMT Adolf wrote:
> I put *.cgi & *.pl & *.plx in the /cgi-bin/
> and link them with <a pref=...>...</a>
> why they can not run?
> (I do not change the default of config.ini)

You will probably want to ask in the newsgroup :

   comp.infosystems.www.servers.ms-windows

if this is not answered in the Activeperl FAQ.

/J\
-- 
And if you get the chance, get him right in the family jewels. That
little doozy's been a Simpson trademark for generations.
-- 
fortune oscar homer


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

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


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