[15899] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3312 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 10 14:11:03 2000

Date: Sat, 10 Jun 2000 11:10:15 -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: <960660615-v9-i3312@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 10 Jun 2000     Volume: 9 Number: 3312

Today's topics:
    Re: obfuscated but useful magic() - for your perlish am (Randal L. Schwartz)
    Re: obfuscated but useful magic() - for your perlish am <sweeheng@usa.net>
    Re: obfuscated but useful magic() - for your perlish am <sweeheng@usa.net>
    Re: obfuscated but useful magic() - for your perlish am (Randal L. Schwartz)
    Re: obfuscated but useful magic() - for your perlish am <sweeheng@usa.net>
    Re: obfuscated but useful magic() - for your perlish am (Clinton A. Pierce)
    Re: obfuscated but useful magic() - for your perlish am (Randal L. Schwartz)
    Re: obfuscated but useful magic() - for your perlish am <rick.delaney@home.com>
    Re: obfuscated but useful magic() - for your perlish am <rick.delaney@home.com>
    Re: obfuscated but useful magic() - for your perlish am (Randal L. Schwartz)
    Re: obfuscated but useful magic() - for your perlish am <sweeheng@usa.net>
    Re: obfuscated but useful magic() - for your perlish am <sweeheng@usa.net>
    Re: obfuscated but useful magic() - for your perlish am <sweeheng@usa.net>
    Re: obfuscated but useful magic() - for your perlish am <lr@hpl.hp.com>
    Re: obfuscated but useful magic() - for your perlish am (Neil Kandalgaonkar)
    Re: obfuscating script for security of distributed code (Steven Smolinski)
    Re: Operator Overloading, Use Parent, Multiple Inherita <jaggers295@hotmail.com>
    Re: Operator Overloading, Use Parent, Multiple Inherita <rootbeer@redcat.com>
    Re: Operator Overloading, Use Parent, Multiple Inherita <flavell@mail.cern.ch>
    Re: Perl Crypt function (Martin Vorlaender)
    Re: PLEASE HELP: Perl for WWW (Martin Vorlaender)
        reverse Urlizer <reevesg@cableinet.co.ukx>
    Re: split using varible length white spaces as field se <rootbeer@redcat.com>
    Re: Time-Date Question ?? <gellyfish@gellyfish.com>
    Re: Time-Date Question ?? <lr@hpl.hp.com>
        uses for PERL <djhill@ameritech.net>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 10 Jun 2000 08:22:33 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: obfuscated but useful magic() - for your perlish amusement
Message-Id: <m1itvh36iu.fsf@halfdome.holdit.com>

>>>>> "Swee" == Swee Heng <sweeheng@usa.net> writes:

Swee> sub magic{local$_='Jan1Feb2Mar3Apr4May5Jun6Jul7Aug8Sep9Oct10Nov11Dec12';
Swee> my$d=shift;$d=~/^\D+$/?(/$d(\d+)/)[0]:$d=~/^\d+$/?(/(\D+)$d/)[0]:''or'bad'}

Swee> printf "%s => %s\n", $_=$ARGV[0], magic($_);
Swee> ---------------------------------------------------------------------------

Swee> A friend asked me how to map months to numbers and vice versa, i.e. Apr =>
Swee> 4, 12 => Dec. The magic() sub is the shortest I coded. Any challengers? :o)

Here's the shortest I could come up with in a few minutes.  I'm sure
the regular golfers will find ways of shortening this (my handicap
is still much too high, but I couldn't pass up this interesting
way of getting the month strings :):

  sub magic {substr gmtime 259e4*(-.5+shift),4,3}

print "Just another Perl hacker,"

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Sat, 10 Jun 2000 23:30:55 +0800
From: "Swee Heng" <sweeheng@usa.net>
Subject: Re: obfuscated but useful magic() - for your perlish amusement
Message-Id: <8htmkg$bvv$1@clematis.singnet.com.sg>

> sub magic{local$_='Jan1Feb2Mar3Apr4May5Jun6Jul7Aug8Sep9Oct10Nov11Dec12';
>
my$d=shift;$d=~/^\D+$/?(/$d(\d+)/)[0]:$d=~/^\d+$/?(/(\D+)$d/)[0]:''or'bad'}
>
> A friend asked me how to map months to numbers and vice versa, i.e. Apr =>
> 4, 12 => Dec. The magic() sub is the shortest I coded. Any challengers?
:o)

sub magic{local$_='Jan1Feb2Mar3Apr4May5Jun6Jul7Aug8Sep9Oct10Nov11Dec12';
my$d=shift;$d=~/^\D+$/?(/$d(\d+)/)[0]:$d=~/^\d+$/?(/(\D+)$d/)[0]:0or'bad'}

hah! one char shorter.




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

Date: Sat, 10 Jun 2000 23:36:49 +0800
From: "Swee Heng" <sweeheng@usa.net>
Subject: Re: obfuscated but useful magic() - for your perlish amusement
Message-Id: <8htmvc$bul$1@clematis.singnet.com.sg>

> Here's the shortest I could come up with in a few minutes.  I'm sure
> the regular golfers will find ways of shortening this (my handicap
> is still much too high, but I couldn't pass up this interesting
> way of getting the month strings :):
>
>   sub magic {substr gmtime 259e4*(-.5+shift),4,3}

Wow. I am impressed. But it only does the conversion one way. It does not do
it the other way round. I mean Mar => 3, Dec => 12...  or am I missing
something?

:o)




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

Date: 10 Jun 2000 08:47:04 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: obfuscated but useful magic() - for your perlish amusement
Message-Id: <m1ya4d1qtj.fsf@halfdome.holdit.com>

>>>>> "Swee" == Swee Heng <sweeheng@usa.net> writes:

>> Here's the shortest I could come up with in a few minutes.  I'm sure
>> the regular golfers will find ways of shortening this (my handicap
>> is still much too high, but I couldn't pass up this interesting
>> way of getting the month strings :):
>> 
>> sub magic {substr gmtime 259e4*(-.5+shift),4,3}

Swee> Wow. I am impressed. But it only does the conversion one way. It does not do
Swee> it the other way round. I mean Mar => 3, Dec => 12...  or am I missing
Swee> something?

Arrrgh.  This was stealth-cc'ed.  Don't do that again.

My reply to you in email that I already typed was something like:

   I didn't see that it needed to go the other way in your original
   post.  That would be harder.

And please please please never stealth-cc again.  Irritates the heck
out of the people that answer questions publicly, like me.  If you cc
me, be sure you indicate that you also posted your post, like I did to
you.  That way I know to followup in news, not reply in mail.

<sigh>

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Sun, 11 Jun 2000 00:20:54 +0800
From: "Swee Heng" <sweeheng@usa.net>
Subject: Re: obfuscated but useful magic() - for your perlish amusement
Message-Id: <8htpi4$bms$1@mawar.singnet.com.sg>

> Arrrgh.  This was stealth-cc'ed.  Don't do that again.

Okay. No more cc, stealth or otherwise. I will stick to news. Just ignore
ALL the other mail that went to your mailbox.

> My reply to you in email that I already typed was something like:
>
>    I didn't see that it needed to go the other way in your original
>    post.  That would be harder.

And my reply, which did not end up on news, was:

  My magic() spell does both conversion at one go, depending on
  how you chant it. Eg.

  magic(4) gives 'Apr'
  magic('Feb') gives 2


> And please please please never stealth-cc again.  Irritates the heck
> out of the people that answer questions publicly, like me.  If you cc
> me, be sure you indicate that you also posted your post, like I did to
> you.  That way I know to followup in news, not reply in mail.

Sorry for the mail snafu. No more cc to you. Just reply via news.




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

Date: Sat, 10 Jun 2000 16:25:50 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: obfuscated but useful magic() - for your perlish amusement
Message-Id: <i_t05.104828$h01.834838@news1.rdc1.mi.home.com>

[Posted and mailed]

In article <8htmvc$bul$1@clematis.singnet.com.sg>,
	"Swee Heng" <sweeheng@usa.net> writes:
>> Here's the shortest I could come up with in a few minutes.  I'm sure
>> the regular golfers will find ways of shortening this (my handicap
>> is still much too high, but I couldn't pass up this interesting
>> way of getting the month strings :):
>>
>>   sub magic {substr gmtime 259e4*(-.5+shift),4,3}
> 
> Wow. I am impressed. But it only does the conversion one way. It does not do
> it the other way round. I mean Mar => 3, Dec => 12...  or am I missing
> something?

Combining yours and Randals, I come up with something like (whitespace
left for readability, all of it can be omitted):

sub magic{
local($a,$_,%r,$t)=(32e6,shift);
while(($a-=2e6)>0){
$r{int$a/(26e5)+1}=substr(gmtime$a,4,3);
}
%t=reverse %r;
/\d/?$r{$_}:$t{$_};
}

If the spec is:
	Takes month number, returns month abbreviation
	Takes month abbreviation, returns number
	Everything is localized
	Invalid month abbreviations/numbers return something
		else.  (undef in this case)

That's 136 characters and yours was 148.

-- 
    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: 10 Jun 2000 09:27:28 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: obfuscated but useful magic() - for your perlish amusement
Message-Id: <m1g0ql1oy7.fsf@halfdome.holdit.com>

>>>>> "Swee" == Swee Heng <sweeheng@usa.net> writes:

Swee> Okay. No more cc, stealth or otherwise. I will stick to news. Just ignore
Swee> ALL the other mail that went to your mailbox.

If only I could... :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Sat, 10 Jun 2000 16:35:29 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: obfuscated but useful magic() - for your perlish amusement
Message-Id: <39426FD6.7224AFAD@home.com>


"Randal L. Schwartz" wrote:
> 
>   sub magic {substr gmtime 259e4*(-.5+shift),4,3}

Dang, you beat me to it!  My solution was going to be:

sub magic {
    my%h=map{my$x=(split' ',gmtime$_*34e6)[1];$x,$_,$_,$x}1..12;
    $h{$_[0]}||'bad'
}

to stick with the original spec.  But I like your simplified spec
better:

    sub magic {substr gmtime$_[0]*34e6,4,3}

-- 
Rick Delaney
rick.delaney@home.com


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

Date: Sat, 10 Jun 2000 16:36:53 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: obfuscated but useful magic() - for your perlish amusement
Message-Id: <3942702A.33A6B1F0@home.com>


Swee Heng wrote:
> 
> sub magic{local$_='Jan1Feb2Mar3Apr4May5Jun6Jul7Aug8Sep9Oct10Nov11Dec12';
> my$d=shift;$d=~/^\D+$/?(/$d(\d+)/)[0]:$d=~/^\d+$/?(/(\D+)$d/)[0]:0or'bad'}
> 
> hah! one char shorter.

And it still doesn't work right.  Try 

    magic('...');

-- 
Rick Delaney
rick.delaney@home.com


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

Date: 10 Jun 2000 09:37:52 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: obfuscated but useful magic() - for your perlish amusement
Message-Id: <m1bt191ogv.fsf@halfdome.holdit.com>

>>>>> "Clinton" == Clinton A Pierce <clintp@geeksalad.org> writes:

Clinton> sub magic{
Clinton> local($a,$_,%r,$t)=(32e6,shift);
Clinton> while(($a-=2e6)>0){
Clinton> $r{int$a/(26e5)+1}=substr(gmtime$a,4,3);
Clinton> }
Clinton> %t=reverse %r;
Clinton> /\d/?$r{$_}:$t{$_};
Clinton> }

Clinton> If the spec is:
Clinton> 	Takes month number, returns month abbreviation
Clinton> 	Takes month abbreviation, returns number
Clinton> 	Everything is localized
Clinton> 	Invalid month abbreviations/numbers return something
Clinton> 		else.  (undef in this case)

Clinton> That's 136 characters and yours was 148.

OK, now you got me thinking...

    sub magic {
      my%r=map{my$m=substr gmtime 26e5*($_-.5),4,3;$m,$_,$_,$m}1..12;
      $r{+shift};
    }

74 chars not counting the leading/trailing whitespace. :)

Durn it -- I swore I'd never get into a game of golf.  Now I'm in the
lead. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Sun, 11 Jun 2000 00:50:40 +0800
From: "Swee Heng" <sweeheng@usa.net>
Subject: Re: obfuscated but useful magic() - for your perlish amusement
Message-Id: <8htrld$dp1$1@mawar.singnet.com.sg>


> And it still doesn't work right.  Try
>
>     magic('...');

duh! you are absolutely right! back to the working table. :o)
this is fun in a perverse sort of way...




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

Date: Sun, 11 Jun 2000 00:56:50 +0800
From: "Swee Heng" <sweeheng@usa.net>
Subject: Re: obfuscated but useful magic() - for your perlish amusement
Message-Id: <8htrld$dp1$2@mawar.singnet.com.sg>

> Combining yours and Randals, I come up with something like (whitespace
> left for readability, all of it can be omitted):
>
> sub magic{
> local($a,$_,%r,$t)=(32e6,shift);
> while(($a-=2e6)>0){
> $r{int$a/(26e5)+1}=substr(gmtime$a,4,3);
> }
> %t=reverse %r;
> /\d/?$r{$_}:$t{$_};
> }
>
> If the spec is:
> Takes month number, returns month abbreviation
> Takes month abbreviation, returns number
> Everything is localized
> Invalid month abbreviations/numbers return something
> else.  (undef in this case)
>
> That's 136 characters and yours was 148.
>
point taken. :o) back to working table.




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

Date: Sun, 11 Jun 2000 01:21:36 +0800
From: "Swee Heng" <sweeheng@usa.net>
Subject: Re: obfuscated but useful magic() - for your perlish amusement
Message-Id: <8htt3s$c5s$1@mawar.singnet.com.sg>

>     sub magic {
>       my%r=map{my$m=substr gmtime 26e5*($_-.5),4,3;$m,$_,$_,$m}1..12;
>       $r{+shift};
>     }
>
> 74 chars not counting the leading/trailing whitespace. :)
>
> Durn it -- I swore I'd never get into a game of golf.  Now I'm in the
> lead. :)

wait a minute! this is 5 chars less (took out the (, -.5) and replace 6 with
5)!

      sub magic {
        my%r=map{my$m=substr gmtime 25e5*$_,4,3;$m,$_,$_,$m}1..12;
        $r{+shift};
      }





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

Date: Sat, 10 Jun 2000 10:04:28 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: obfuscated but useful magic() - for your perlish amusement
Message-Id: <MPG.13ac14f8de9693898ab5b@nntp.hpl.hp.com>

In article <8htmkg$bvv$1@clematis.singnet.com.sg>, sweeheng@usa.net 
says...
> > sub magic{local$_='Jan1Feb2Mar3Apr4May5Jun6Jul7Aug8Sep9Oct10Nov11Dec12';
> > my$d=shift;$d=~/^\D+$/?(/$d(\d+)/)[0]:$d=~/^\d+$/?(/(\D+)$d/)[0]:''or'bad'}
> >
> > A friend asked me how to map months to numbers and vice versa, i.e. Apr =>
> > 4, 12 => Dec. The magic() sub is the shortest I coded. Any challengers?
> :o)
> 
> sub magic{local$_='Jan1Feb2Mar3Apr4May5Jun6Jul7Aug8Sep9Oct10Nov11Dec12';
> my$d=shift;$d=~/^\D+$/?(/$d(\d+)/)[0]:$d=~/^\d+$/?(/(\D+)$d/)[0]:0or'bad'}
> 
> hah! one char shorter.

Same idea; lots shorter:

sub magic{local$_='Jan1Feb2Mar3Apr4May5Jun6Jul7Aug8Sep9Oct10Nov11Dec12';
$_[0]=~/\D/?/$_[0](\d+)/:/(\D+)$_[0]/;$1||'bad'}

But these solutions all accept false positives.  For examply, magic('y) 
yields 5.

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


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

Date: 10 Jun 2000 17:55:28 GMT
From: nj_kanda@alcor.concordia.ca (Neil Kandalgaonkar)
Subject: Re: obfuscated but useful magic() - for your perlish amusement
Message-Id: <8htveg$lks$1@newsflash.concordia.ca>

#!/usr/bin/perl -lw
while(!$h{$ARGV[0]}and keys%h<24){($n,$m)=((split' ',localtime)[1],
(localtime)[4]+1);@h{$n,$m}=($m,$n)};print$h{$ARGV[0]}||'bad';

Caution: this may take some time to run.

-- 
Neil Kandalgaonkar
neil@brevity.org


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

Date: Sat, 10 Jun 2000 15:45:46 GMT
From: sjs@yorku.ca (Steven Smolinski)
Subject: Re: obfuscating script for security of distributed code
Message-Id: <slrn8k4okf.6ci.sjs@john.sympatico.ca>

hadleyr@hotmail.com <hadleyr@hotmail.com> wrote:
>  eric@fruitcom.com wrote:

>> I have been unable to locate a code obfuscating script that I know is
>> out there.  For removing white space, changing variable names, whatever.
>> The purpose is to discourage tampering or backward engineering of
>> distributed code. [...]

>I don't know of this script your looking for. However, the Source
>Filters on CPAN achieve the same goal and work well.

If by 'work well' you mean that they don't discourage any *determined*
Perl programmer from reverse engineering, then it's true.  In fact, it
can hardly be called reverse engineering when one has the source,
however obfuscated.

If by 'work well' you mean that even a cat walking across the keyboard
with the source in vi can 'tamper' with it, then that's true as well.

I don't know what purpose you think this is serving, but it's more
probably going to satisfy someone with pointy hair than anyone who
actually works with code.

Steve


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

Date: Sat, 10 Jun 2000 15:07:27 GMT
From: "Neo-X" <jaggers295@hotmail.com>
Subject: Re: Operator Overloading, Use Parent, Multiple Inheritance
Message-Id: <PQs05.4017$O4.150010@news1.rdc1.tn.home.com>

Ah, but that would cost money, which is an item I am currently lacking.

Uri Guttman <uri@sysarch.com> wrote in message
news:x7n1ku9mry.fsf@home.sysarch.com...
>
> buy and read object oriented perl.
>
> uri
>
> --
> Uri Guttman  ---------  uri@sysarch.com  ----------
http://www.sysarch.com
> SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX
Consulting
> The Perl Books Page  -----------
http://www.sysarch.com/cgi-bin/perl_books
> The Best Search Engine on the Net  ----------
http://www.northernlight.com




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

Date: Sat, 10 Jun 2000 08:18:14 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Operator Overloading, Use Parent, Multiple Inheritance
Message-Id: <Pine.GSO.4.10.10006100813480.10286-100000@user2.teleport.com>

On Sat, 10 Jun 2000, Neo-X wrote:

> > buy and read object oriented perl.

> Ah, but that would cost money, which is an item I am currently lacking.

Ask your local librarian to purchase the book, or to help you request it
through inter-library loan. Or ask your employer / mother / father /
friend / lover / Santa Claus to buy you the book. Or find the money or
book some other way - but, whatever you do, don't whine here about your
lack of money.

Cheers!

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



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

Date: Sat, 10 Jun 2000 18:44:27 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Operator Overloading, Use Parent, Multiple Inheritance
Message-Id: <Pine.GHP.4.21.0006101837400.3434-100000@hpplus03.cern.ch>

On Sat, 10 Jun 2000, Neo-X jeopardized:

> Ah, but that would cost money, which is an item I am currently lacking.

Years ago, the total cost of a netiquette-conforming posting to usenet
was roughly estimated at some thousands of $US.

Although network bandwidth and disk space have got cheaper, the
audience has got much larger, and the cost in person-hours - of
reading enough of a posting to know it's time to move on to the next -
surely hasn't gone down.

So maybe you should reconsider whether you can afford to spend other
people's money if you haven't any of your own.  (Ever heard of
libraries?).

Yes, I know, netiquette says that one should avoid getting dragged
into metadiscussions about posting style.  OK, f'ups set to avoid
getting dragged into metadiscussions ;-}

-- 

 "Some popular newsreaders, such as Outlook Express, automatically put the 
 cursor above the quoted material; you can take advantage of this by 
 scrolling down through the prior posting, deleting anything superfluous, 
 until you reach the point where you want to start your reply." -a.u.e FAQ




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

Date: Sat, 10 Jun 2000 17:38:49 +0200
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: Perl Crypt function
Message-Id: <39426109.524144494f47414741@radiogaga.harz.de>

Randal L. Schwartz (merlyn@stonehenge.com) wrote:
: >>>>> "Ala" == Ala Qumsieh <aqumsieh@hyperchip.com> writes:
: Ala> Yes it is. crypt(), which is derived from the unix command of the same
: Ala> name, [...]
:
: No.  crypt(1) had nothing to do with crypt(3).  A common confusion.
: crypt(1) used the "WW-II Enigma rotor machine", while crypt(3) (to
: which Perl's crypt() is connected) is based on a modified DES.  DES
: didn't exist in WW-II. :)

And on VMS - where the C RTL doesn't provide a crypt() - the perl crypt()
is connected to the appropriate VMS system service (which currently uses
some variation of a Purdy polynomial to hash the password, IIRC).

But if one wants the "standard" DES encryption, there's always
Crypt::UnixCrypt on CPAN. </shameless_plug>

cu,
  Martin
--
                       |  Martin Vorlaender  |  VMS & WNT programmer
  OpenVMS: When you    |  work: mv@pdv-systeme.de
  KNOW where you want  |        http://www.pdv-systeme.de/users/martinv/
  to go today.         |  home: martin@radiogaga.harz.de


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

Date: Sat, 10 Jun 2000 17:48:43 +0200
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: PLEASE HELP: Perl for WWW
Message-Id: <3942635b.524144494f47414741@radiogaga.harz.de>

Jon S. (jonceramic@nospammiesno.earthlink.net) wrote:
: Marco Natoni <blah@nospam.com> wrote:
: >Those questions, and many many other ones, will find an accurate
: >answer on CGI Programming on the World Wide Web, by Shishir Gundavaram,
: >published by O'Reilly, just for an example. ;)
:
: Does anyone know when the new edition of this book is coming out?

The 2nd edition is on its way, see http://www.oreilly.com/catalog/cgi2/

cu,
  Martin
--
                       |  Martin Vorlaender  |  VMS & WNT programmer
  OpenVMS: When you    |  work: mv@pdv-systeme.de
  KNOW where you want  |        http://www.pdv-systeme.de/users/martinv/
  to go today.         |  home: martin@radiogaga.harz.de


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

Date: Sat, 10 Jun 2000 17:13:16 GMT
From: "red [2]" <reevesg@cableinet.co.ukx>
Subject: reverse Urlizer
Message-Id: <MGu05.175$1y5.16471@news3.cableinet.net>

thanks a long time ago to you guys i got an url to convert into a link.
now, i need to get it to go the other way around

$post =~ s!(http://[\-~A-Za-z0-9_/\.]+)!<a href=\"$1\">$1</a>!gi;
is what im using to convert http://www.quadmonkey.co.uk/ into
<a href=" etc

but i want to convert
<a href="http://[\-~A-Za-z0-9_/\.]+)">URLNAME</a> into
URLNAME <http://url/>

can you wonderful people help me out again... im not sure how to strip from
the href= to the > , mainly because im not sure how to do it IF there's a "
or not (id like it to be flexible)


thanks in advance.

(sorry for double post -if any- my isp seems to be bummed out today)
--

Graham "red" Reeves

uk's Q3 news - - http://www.quadmonkey.co.uk/







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

Date: Sat, 10 Jun 2000 08:12:11 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: split using varible length white spaces as field separators
Message-Id: <Pine.GSO.4.10.10006100811110.10286-100000@user2.teleport.com>

On Sat, 10 Jun 2000, Ivo Zdravkov wrote:

> @array = split(/ +/,$line);
>     or better
> @array = split(/\w+/,$line);

Did you perhaps mean to use an 's' in place of the 'w' there? As written,
it's not likely to be correct. Cheers!

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



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

Date: 10 Jun 2000 13:27:10 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Time-Date Question ??
Message-Id: <8htc6u$jdk$1@orpheus.gellyfish.com>

On 9 Jun 2000 22:08:01 GMT Tina Mueller wrote:
> hi,
> 
> rrubin@rotor.net wrote:
> 
>> I have a timestamp of the following value 0006091338
> 
>> I would like to convert that to ... June 09, 2000 13:38
> 
> use Time::Local;
> $time = "0006091338";
> $year = substr($time,0,2);
> $m = substr($time,2,2);
> $d= substr($time,4,2);
> $h=substr($time,6,2);
> $min=substr($time,8,2);
> $time = localtime(timelocal(0,$min,$h,$d,$m-1,$year));
> print "$time\n";
> 
> perldoc -f localtime
> 

Some might prefer :


use Time::Local;
$time = "0006091338";
my ($year,$m,$d,$h,$min) = unpack "A2A2A2A2A2",$time;
$time = localtime(timelocal(0,$min,$h,$d,$m-1,$year));

print $time;

/J\
-- 
fortune oscar homer


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

Date: Sat, 10 Jun 2000 10:10:03 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Time-Date Question ??
Message-Id: <MPG.13ac164917ef974698ab5c@nntp.hpl.hp.com>

In article <8htc6u$jdk$1@orpheus.gellyfish.com>, gellyfish@gellyfish.com 
says...

> Some might prefer :
> 
> use Time::Local;
> $time = "0006091338";
> my ($year,$m,$d,$h,$min) = unpack "A2A2A2A2A2",$time;
> $time = localtime(timelocal(0,$min,$h,$d,$m-1,$year));
> 
> print $time;

Golfers might prefer 'A2'x5 (saves four strokes :-).

But the superiority of unpack over a set of substrs is quite clear.

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


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

Date: Sat, 10 Jun 2000 11:54:18 -0500
From: david <djhill@ameritech.net>
Subject: uses for PERL
Message-Id: <394272BA.73335058@ameritech.net>

I know PERL is widely used on websites, but it seems PHP is becoming
increasingly popular everyday.  What other uses are there for PERL
besides creating websites?

David



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

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


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