[11031] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4631 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 12 15:07:13 1999

Date: Tue, 12 Jan 99 12:00:22 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 12 Jan 1999     Volume: 8 Number: 4631

Today's topics:
    Re: A really easy string question dhosek@webley.com
        Archive::Tar question/issue sboss@my-dejanews.com
        compile to C <jfauerba@pc079.ncdc.noaa.gov>
        cut <a14203@cig.mot.com>
    Re: Generating a unique number (Greg Ward)
        Generating hidden fields <ilowe@interlog.com>
        Graphical SNMP Monitor (Tk)? otis@my-dejanews.com
    Re: High resolution timing ! (Abigail)
    Re: How to stop perldoc scroll on find? <design@raincloud-studios.com>
    Re: Making perl do tasks at specific times.. troutmask2@my-dejanews.com
        Need Help!!! <ytsiow@singnet.com.sg>
        paragraphs (_cim_)
    Re: paragraphs (Sam Holden)
    Re: perl cgi (win95) doesn't work with CGI.pm ed_c@my-dejanews.com
    Re: perl cgi (win95) doesn't work with CGI.pm <Allan@Due.net>
    Re: Perl Criticism <mhc@Eng.Sun.COM>
    Re: Perl Criticism (Sean McAfee)
    Re: Perl Criticism topmind@technologist.com
        question about File::Find <eedalf@eed.ericsson.se>
    Re: question about File::Find (Greg Ward)
        regexp in a var ?  <vogel@pixelpark.com>
    Re: Sprite 3.21 flat file database problem <bdeitte@blue.weeg.uiowa.edu>
        SUMMARY: Optimizing `eval' in a loop <hniksic@srce.hr>
        tied hashed hash looses item #1 <mymail@nospam.com>
    Re: Verify an email address <dgris@moiraine.dimensional.com>
    Re: Verify an email address (I R A Aggie)
    Re: Web and perl (brian d foy)
        what's going on here?  LWP problem, example doesn't wor (Ryan McGuigan)
    Re: Year 2038 problem (Greg Ward)
    Re: Year 2038 problem (Michal Jaegermann)
    Re: Year 2038 problem (Bart Lateur)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Tue, 12 Jan 1999 19:21:03 GMT
From: dhosek@webley.com
Subject: Re: A really easy string question
Message-Id: <77g7av$ef1$1@nnrp2.dejanews.com>

In article <77fr4p$5pq$1@news.panix.com>,
  clay@panix.com (Clay Irving) wrote:
> In <369ba4f0.9065131@news.newsguy.com> info@gadnet.com writes:

> >I'm new to this perl lark and struggling to do the following:

> >I have a variable ($variable) which contains:

> >$pathname = "/path-of-indeterminate-length/myfile.txt";

> >I want to end up with a variable that contains:

> >myfile.txt

> >I can do it as follows:

> >$variable = substr($variable,12);
> >chop($variable);
> >chop($variable);

> >But there has to be a neater way.

> Using split:

(3 lines including print)

> Using File::Basename (included in the Perl distribution):

(4 lines including print and use)

Personally, I like to use pattern matching to snarg things out of strings.

$pathname =~ /\/([^\/]+)$/;
print "$1\n";

You can use $1, $2, etc to grab the nth parenthesized text from a pattern
matching operation like that above. The pattern that I use matches on a /
followed by one or more non-slash characters to the end of the string. This
will handle most cases except for the pathological case where a file name
contains a slash (unlikely but possible). If there may not be an explicit
path in $pathname (e.g. "foo.txt") put a ? after the first \/ to make it
optional.

If you want to be a perl stud, learn your regexps. They are your friend.

-dh

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 12 Jan 1999 18:42:23 GMT
From: sboss@my-dejanews.com
Subject: Archive::Tar question/issue
Message-Id: <77g52f$88r$1@nnrp2.dejanews.com>

Hello,

I am trying to use Archive::Tar to tar up my Win32 based machines
(Windows95b) for a backup.  I have a drive letter (S:) which is a NFS mount
to a Unix box that I have space to store my .tar file for my backup.  I want
to be able to just tar the root directory (c:\) and all of its contents.  I
get soo far, and I get a OUT OF MEMORY error.  I have 192 meg of RAM and the
file is only a couple of meg at max when it barfs.  How can I get around this
to accomplish my goal? Should I use something else besides tar?  zip?

Thanks
Scott

PS>  Please email me directly since I do not get to read the newsgroups very
often.

--
Scott Boss
Atlanta Perl Mongers Fearless Leader
website:   http://atlanta.pm.org
community: http://www.dejanews.com/~apm

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 12 Jan 1999 13:33:57 -0500
From: John Fauerbach <jfauerba@pc079.ncdc.noaa.gov>
Subject: compile to C
Message-Id: <369B9595.53227CF@pc079.ncdc.noaa.gov>

Has anybody been able to use perlcc and compile it to C under Unix or MS
Windows 95? If so, what do I need besides perl and gcc?

Thanks,
John Fauerbach




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

Date: Tue, 12 Jan 1999 11:39:14 -0600
From: Gump <a14203@cig.mot.com>
Subject: cut
Message-Id: <369B88C2.6796@cig.mot.com>

Hi, all,
   Is there a function in perl which can do task just like
"cut" command in Unix?
for example, get third part ("1.2.0") from below string:

"KingSoftware   StarTest   1.2.0   01-01-1999"

thanks,
Gump

Please reply to my email.


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

Date: 12 Jan 1999 19:07:37 GMT
From: gward@thrak.cnri.reston.va.us (Greg Ward)
Subject: Re: Generating a unique number
Message-Id: <77g6hp$5jv$1@news0-alterdial.uu.net>

Daniel <daniel.mendyke@digital.com> wrote:
> I'm looking for a way to assign truely unigue id numbers
> to each visiter to a web site.  I'd like to use charators as well
> as numbers and keep the number of digits to eight.
> 
> One possible solution might be to use the system
> date and time to generator a unique number.

That's a start, but what if another process is doling out unique IDs
simultaneously (if this is a CGI script, that's entirely possible).
Safer to mix the process ID in as well, something like

  $user_id = $$ . '_' . time;

However, this is all digits and doesn't fit in eight characters (which
breaks your requirements).  You could do foolish things like chop off
extraneous-seeming digits from the time, but then you lose your
guarantee of uniqueness.  

If you can handle arbitrary ASCII characters in the ID, then you could
pack the PID (a 16-bit integer) and the time (a 32-bit integer) into a
few bytes:

  $id = pack ('si', $$, time);

but that won't work too well if you have to use that ID in the
filesystem, or present it to the user, or something like that.

Try messing around with some of the other options that 'pack' makes
available -- it's quite powerful (but rather obscure!).

        Greg
-- 
Greg Ward - software developer                    gward@cnri.reston.va.us
Corporation for National Research Initiatives    
1895 Preston White Drive                      voice: +1-703-620-8990 x287
Reston, Virginia, USA  20191-5434               fax: +1-703-620-0913


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

Date: Tue, 12 Jan 1999 14:31:36 -0500
From: Iain Lowe <ilowe@interlog.com>
Subject: Generating hidden fields
Message-Id: <369BA318.6102E7D2@interlog.com>

Hi:

I'm new at this.

I'm trying to figure out how to generate hidden fields to save form
state in a second launch of a Perl CGI app. I'm using CGI.pm.

My understanding is that I need to dump the $query key/value pairs into
a hash, then for each param in the query, dump the key and value using
the 

print $query->hidden(); 

function

I'm not quite sure how to do this, though.

I can get the param names using something like @fields = $query->param

but this doesn't retrieve the values as well, does it? Or does it?

I've tried several hacks through this and, while none of them break the
script, they don't generate anything either.

Help!


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

Date: Tue, 12 Jan 1999 17:40:53 GMT
From: otis@my-dejanews.com
Subject: Graphical SNMP Monitor (Tk)?
Message-Id: <77g1f7$udk$1@nnrp2.dejanews.com>

Hello,

I was wondering if there are any utilities that will monitor SNMP and display
the results graphically?

I'm aware of MRTG and SNMP::Monitor, but they both use a browser.  I was
wondering if there is something that uses Tk to display traffic, nodes, etc.

Thanks,

Otis
--
eZines Db - 3,000+ magazines, newspapers, journals, e-zines...
http://www.dominis.com/Zines/?dn

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 12 Jan 1999 16:01:54 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: High resolution timing !
Message-Id: <77frli$3h8$2@client3.news.psi.net>

Stefan Nonneman (stefan.nonneman@cec.be) wrote on MCMLX September
MCMXCIII in <URL:news:369B07B6.D29D0EC0@cec.be>:
 .. Dear all,
 .. 
 .. I am looking for a high-resolution timer (1ms or finer) that can be used
 .. in PERL.
 .. Recently I found some sites with enormous ammounts of modules etc for
 .. PERL but I have no idea where
 .. to look.
 .. 
 .. Some suggestion ???


Try the Time subdirectory....




Abigail


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

Date: 12 Jan 1999 18:54:44 GMT
From: "Charles R. Thompson" <design@raincloud-studios.com>
Subject: Re: How to stop perldoc scroll on find?
Message-Id: <77g5pk$v2@bgtnsc03.worldnet.att.net>

>perldoc -f stat | more
>perldoc -f stat | page
>perldoc -f stat | less
>perldoc -f stat > file; vi file


Thank you very much.




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

Date: Tue, 12 Jan 1999 19:22:15 GMT
From: troutmask2@my-dejanews.com
Subject: Re: Making perl do tasks at specific times..
Message-Id: <77g7d7$egf$1@nnrp2.dejanews.com>

In article <19990112005133.07277.00011762@ng113.aol.com>,
  firstagyg@aol.com (FirstAGYG) wrote:
> Hello, im fairly new to the group and Perl itself. I have 2 perl books, and i
> cant seem to find any info on how to schedual perl to do things at specific
> times, without any intervention from me or a user. Does anyone know of the
> tecnique? Thanks a bunch.
>
> John
>

If you mean you want to have your Perl script execute at specific times,
you'll need to set up crontab (in UNIX) or AT (in Windows NT)...you have to
have some process initiate the Perl script. I use crontab to start my Tracker
checking script at www.troutmask.com.

-TM

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 13 Jan 1999 01:24:33 +0800
From: "Yong Teck" <ytsiow@singnet.com.sg>
Subject: Need Help!!!
Message-Id: <77g0fi$ev6$1@mawar.singnet.com.sg>

If I got an application call password.exe and this is how the application
work:

1) I got to run the application in this way in the Dos Mode : password.exe
c:\security\users alex
    where users is the file that keeps all the user id and password. alex is
the new user id to add in to the users
file

2) After I key in all that and press enter, the application will immediately
ask for a password and I got to key in the password and press enter.

3) Then the application will ask me to re-enter the password again.


I need to write a Perl script to call the application and pass in all these
information.  I try to use system() function in this way:

$userid = "alex";
system ("password.exe", "c:/security/users $userid");

I manage to call the application and open up the users file to add in the
alex user.  But it will then prompt me to enter password.  Is there a way to
pass in the password to the application together so that the application
will not ask me to key in the password.

A million thanks if anyone can help.  I really need this urgently for my
final year project and I am really running out of time.  Thanks you.






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

Date: Tue, 12 Jan 1999 19:00:31 GMT
From: cim@online.ee (_cim_)
Subject: paragraphs
Message-Id: <369b9a92.22438052@news.online.ee>

I have a txt file with multiple lines - 12 paragraphs separated by
empty lines.
I open this file.

Now i need get those paragraphs separately. How can i do it. I can put
special markers at the beginning and end of each paragraph. I need to
do it fast. Which method would be the best.


PS! any good perl IRC channels out there?


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

Date: 12 Jan 1999 19:26:32 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: paragraphs
Message-Id: <slrn79n8f8.qvl.sholden@pgrad.cs.usyd.edu.au>

On Tue, 12 Jan 1999 19:00:31 GMT, _cim_ <cim@online.ee> wrote:
>I have a txt file with multiple lines - 12 paragraphs separated by
>empty lines.
>I open this file.
>
>Now i need get those paragraphs separately. How can i do it. I can put
>special markers at the beginning and end of each paragraph. I need to
>do it fast. Which method would be the best.

RTFM.

perlfaq5 : How can I read in a file by paragraphs?

-- 
Sam

 "... the whole documentation is not unreasonably transportable in a
 student's briefcase." - John Lions describing UNIX 6th Edition
 "This has since been fixed in recent versions." - Kernighan & Pike


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

Date: Tue, 12 Jan 1999 18:26:38 GMT
From: ed_c@my-dejanews.com
Subject: Re: perl cgi (win95) doesn't work with CGI.pm
Message-Id: <77g44u$57a$1@nnrp2.dejanews.com>

In article <369a6b07.2599230@news>,
  el@fiz-karlsruhe.de (Edwin Litterst) wrote:
> A small demo perl script works nice if called from the command line
> but doesn't return anything if CGI.pm is included:
>
>
> Thanks in advance for every help,
> Eddie
>

One problem I have noticed with CGI.pm and Windoze95 is that the ActiveState
build is version 5.003_xxx and CGI.pm has a 'require 5.004' at the top.  To
get CGI.pm to work I had to change that line to 'require 5.003'.  Some gurus
out there please correct me, but for simple CGI processing this difference
really shouldn't matter all that much.

Hope this helps,

Ed

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 12 Jan 1999 19:40:27 GMT
From: "Allan M. Due" <Allan@Due.net>
Subject: Re: perl cgi (win95) doesn't work with CGI.pm
Message-Id: <77g8fb$guf$0@206.165.165.154>

ed_c@my-dejanews.com wrote in message <77g44u$57a$1@nnrp2.dejanews.com>...
>In article <369a6b07.2599230@news>,
>  el@fiz-karlsruhe.de (Edwin Litterst) wrote:
>> A small demo perl script works nice if called from the command line
>> but doesn't return anything if CGI.pm is included:
>> Thanks in advance for every help,
>> Eddie
>
>One problem I have noticed with CGI.pm and Windoze95 is that the
ActiveState
>build is version 5.003_xxx and CGI.pm has a 'require 5.004' at the top.  To
>get CGI.pm to work I had to change that line to 'require 5.003'.  Some
gurus
>out there please correct me, but for simple CGI processing this difference
>really shouldn't matter all that much.


Umm, the latest ActiveState release is Perl 5.005_02, build 509.  Might be
time to upgrade.

HTH

AmD






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

Date: 12 Jan 1999 10:10:58 -0800
From: Mike Coffin <mhc@Eng.Sun.COM>
Subject: Re: Perl Criticism
Message-Id: <8p6u2xwe4zx.fsf@Eng.Sun.COM>

Jerome O'Neil <jeromeo@atrieva.com> writes:

> topmind@technologist.com wrote:
> 
> > > >
> > > >@_(-->$/(.)/up/Your*$s\\|>you&%!$@#crypt=++||#@tol<>>??logists!@#
> > >
> > > Thats not valid perl.
> > >
> > 
> > But I bet it is only a few keystrokes away from being runnable.
> 
> I'll take that wager.  If you loose, you go away and never come back.

You lose;

  "@_(-->$/(.)/up/Your*$s\\|>you&%!$@#crypt=++||#@tol<>>??logists!@#";

is runnable.

-mike


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

Date: Tue, 12 Jan 1999 18:57:14 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: Perl Criticism
Message-Id: <eWMm2.1746$Ge3.8713069@news.itd.umich.edu>

In article <8p6u2xwe4zx.fsf@Eng.Sun.COM>, Mike Coffin  <mhc@Eng.Sun.COM> wrote:
>Jerome O'Neil <jeromeo@atrieva.com> writes:
>> topmind@technologist.com wrote:
>> > > >@_(-->$/(.)/up/Your*$s\\|>you&%!$@#crypt=++||#@tol<>>??logists!@#

>> > > Thats not valid perl.

>> > But I bet it is only a few keystrokes away from being runnable.

>> I'll take that wager.  If you loose, you go away and never come back.

>You lose;
>  "@_(-->$/(.)/up/Your*$s\\|>you&%!$@#crypt=++||#@tol<>>??logists!@#";
>is runnable.

Not quite:

In string, @tol now must be written as \@tol at -e line 1, near "$@#crypt=++||#@tol"
Execution of -e aborted due to compilation errors.

Using single quotes makes it runnable, though.

-- 
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
            | K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
            | tv+ b++ DI++ D+ G e++>++++ h- r y+>++**          | umich.edu


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

Date: Tue, 12 Jan 1999 19:28:36 GMT
From: topmind@technologist.com
Subject: Re: Perl Criticism
Message-Id: <77g7p5$f1n$1@nnrp2.dejanews.com>

In article <x7n23rk8o3.fsf@home.sysarch.com>,
  Uri Guttman <uri@home.sysarch.com> wrote:
> >>>>> "t" == topmind  <topmind@technologist.com> writes:
>
>   t> No no no no! 20 LOCAL Variables. Why have a list like this:
>
>   t> local(foo, bar, smoo, smar, fart, tart, bla, bra)
>
>   t> When all you need is one keyword, "isolate". It also saves typing  P-)
>
> hey dweezlehead, how do you pass in arguments with isolate? no params
> allowed if they are not local? how do you access globals with isolate?
> oh, you don't allow globals! well then you will have to pass the entire
> world  around from sub to sub. 20 variables? that sounds too low to me.


"Isolate" has NO EFFECT on parameters and Globals. Perhaps i did
not state that clearly enough.

"Isolate" simply makes a function not "see" the variables
created or inherited by the parent. Parameters still go in
(and back out if so set).


>
>   t> Why not just use a subroutine with parameters by reference?
>
> call by reference is a pain in the ass. have you ever worked with PL/I?
> i doubt it. you have to copy everything before you can touch it. c has
> call by value but you explicitly pass references. perl has call by
> reference but the idiom is to do local copies immediately. both allow
> you CONTROL over what is by valie and by reference.

In call by reference, you don't have to make a local copy. You use
call by reference if you are going to permanently change it, and call by
value (or read-only as I propose) if you are not planning on
changing it.

I am proposing that both passing options be made available.
(With possible differences from the current approaches.)

>
>   t> Why have 10 different ways to do things. It might save
>   t> 30% typing, but results in programs that are 300%
>   t> harder to read. (Perhaps you see this as an exeration,
>   t> but readability (maintanability) is a HUGE cost for
>   t> companies.)
>
> we have yet to see any code of your in any language. nor have we seen
> any serious language designs, just a random collection of halfbaked and
> borrowed ideas (which breaks one of your commandments. IMPERFECT!
> IMPERFECT! NOMAD MUST STERILIZE!).

I NEVER said the ideas have to be new, just not chosen purely for
backward familiarity. I have proposed several new ideas: Read-only
parameters, pre-while loops, attribute nulls, Isolate, and some others.
(It is possible other languages have these, I just have not seen
them yet.)

For example Perl has these stupeeds:

  thisdate = `date`;
  dothis || die "error"

Perl put these things in purely for backward familiarity with
Unix scripting. The backtics are WAY too easy to confuse with
string quotes, the the || in this context should be a
regular "if" statement.
Why not have a Pipe() or Exec() function instead of backtics?

What the hell was going throught their mind? I suspect they
thought it was somehow clever or cute to use goofy symbols
in goofy contexts. That was probably before the days that maintanability
and readability became part of Computer Science.

Keep the good, chuck the bad!

> come up with a real and complete
> language specification, show how it handles scoping, expressions, I/O
> and other fun stuff. write a compiler/interpreter for it. create the
> large set of runtime code needed to support your gee-whiz
> paradigms. when you are done in the 30 years it will take you, we will
> look and listen.
>


Why are you (appearently) claiming it will be bloated?
You keeping launching missles, but never give the coordinates.


>   t> It is not how fast you can crap, but how easy it is
>   t> to manage the result. (Yuk!)
>
> and you are a fast crapper!
>
> why do you claim to know perl and offer to do perl work, when you
> obviously don't even know the language. have you ever written anything
> in perl and have been paid for it? i would like to meet that person who
> paid you so i can charge $120/hour to clean up the mess you left.
>

My Perl coding tends to resemble non-piping languages such as VB.
I don't use many of its hidden parameters and goofy stuff.
If's use if's, loops use loops, etc. It is 10 times more
readable than that crap that looks like a 3-year-old got
their finger stuck in the keyboard.

Perler's actually have
contests to see who can write and read the most cryptic code.
"Nerd Machoism" is what I call it.


> uri
>
> --
> Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
> Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
> uri@sysarch.com  ------------------------------------  http://www.sysarch.com
> The Best Search Engine on the Net -------------  http://www.northernlight.com
>

-tmind-
http://www.geocities.com/SiliconValley/Lab/6888/langopts.htm

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 12 Jan 1999 19:14:47 +0100
From: Alexander Farber <eedalf@eed.ericsson.se>
Subject: question about File::Find
Message-Id: <369B9117.90241DA0@eed.ericsson.se>

Hi,

could someone explain me the difference between
find() and finddepth() in File::Find ?

Thanks!
Alex


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

Date: 12 Jan 1999 19:13:32 GMT
From: gward@thrak.cnri.reston.va.us (Greg Ward)
Subject: Re: question about File::Find
Message-Id: <77g6ss$5jv$2@news0-alterdial.uu.net>

Alexander Farber <eedalf@eed.ericsson.se> wrote:
> could someone explain me the difference between
> find() and finddepth() in File::Find ?

finddepth() does a depth-first search, while find() does something
midway between breadth-first and depth-first.  Say you have this
directory structure:

  dir/ --- sub1/ -- file1
           sub2/

find(), like the Unix command 'find' in its default state, visits each
file or directory as soon as it finds it.  finddepth() (like 'find' with
the '-depth' option) goes all the way down first, and then visits as it
backtracks.  Eg.

% perl -MFile::Find -e 'find (sub { print "$File::Find::name\n" }, "dir");'
dir
dir/sub1
dir/sub1/file1
dir/sub2

% perl -MFile::Find -e 'finddepth (sub { print "$File::Find::name\n" }, "dir");'
dir/sub1/file1
dir/sub1
dir/sub2
dir

Hope this clears things up.

        Greg
-- 
Greg Ward - software developer                    gward@cnri.reston.va.us
Corporation for National Research Initiatives    
1895 Preston White Drive                      voice: +1-703-620-8990 x287
Reston, Virginia, USA  20191-5434               fax: +1-703-620-0913


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

Date: Tue, 12 Jan 1999 18:49:15 +0100
From: "Thomas M. Vogel" <vogel@pixelpark.com>
Subject: regexp in a var ? 
Message-Id: <369B8B1B.8A3180C8@pixelpark.com>

hi,

what i need is something like this:

$my_replace = 's/(\d).(\d)/$2.$1/' ;
$new =~ $my_replace ;

any idea ?

    Thomas




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

Date: Tue, 12 Jan 1999 13:08:10 -0600
From: Brian Deitte <bdeitte@blue.weeg.uiowa.edu>
Subject: Re: Sprite 3.21 flat file database problem
Message-Id: <Pine.A41.3.95.990112130503.52142A-100000@red.weeg.uiowa.edu>

On 12 Jan 1999, Joe wrote:

> I've upgraded to the 3.21 version of Sprite.pm and I'm having a problem
> with the select clause with a where statement.  It seems if your field name
> starts with 'LE' like in a field name 'LEASE' and you use it in a where
> statement, the select clause never works.  I'm wondering if anyone ran into
> this problem?  I think it is related to the translation of 'LE' to '<=' but
> don't know how to fix?

I don't know the specifics of what's going wrong, but I can offer a
solution: put the field name in a variable beforehand.  ($lease = 'LEASE'
and then substitute $lease where 'LEASE' is).  If I remember the little I
remember of Sprite, this should solve your problem.  -Brian



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

Date: 12 Jan 1999 20:35:20 +0100
From: Hrvoje Niksic <hniksic@srce.hr>
Subject: SUMMARY: Optimizing `eval' in a loop
Message-Id: <kigr9t0e13b.fsf@jagor.srce.hr>

Thanks to everyone who replied; as proposed by most people, I now use
this:

$closure = eval "sub { $expr }"
  || die "Error while compiling code: $expr\n";

loop {
  ...
  eval { &$closure; } || die "Error while evaluating code: $expr\n";
  ...
}

(Of course, the second eval is merely to trap runtime errors.)


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

Date: Tue, 12 Jan 1999 07:20:17 -0500
From: JPAH-FLA <mymail@nospam.com>
Subject: tied hashed hash looses item #1
Message-Id: <369B3E00.B172104F@nospam.com>


I apologize if this post arrives twice- I posted it around 23 Dec but it
never showed up, so I'm trying again.

I'm finding that an anon hashed hash tied with dbmopen consistently
looses the fist item of each hash. I've demonstrated it in W32 as well
as unix. I couldn't find any reference to this issue in Camel or this
newsgroup or websites, but not for lack of trying!

I created a hashed hash similar to the example in camel 2nd Ed P 270. It
worked fine:

  $h{tom}{ctype} = "cat";  $h{tom}{colour} = "brown"; $h{tom}{build} =
"fat";
  $h{tim}{ctype} = "cat"; $h{tim}{colour} = "white"; $h{tim}{build} =
"slim";

  foreach $cat (keys %h)
   {print "cat: $cat\n";
     foreach (keys %{ $h{$cat} })
     {print "$_ => $h{$cat}{$_}\n";
     }
   }

produces the desired result:

  >perl cats.pl
  cat: tom
  build => fat
  colour => brown
  ctype => cat
  cat: tim
  build => slim
  colour => white
  ctype => cat

However, when I use the same exact code, but tie h to a dbm with:

     dbmopen %h, $DB, 0766 || die "cant open DBM: $!\n";

All of the %h{cat_i}{ctype}'s vanish:

  cat: tom
  build => fat
  colour => brown
  cat: tim
  build => slim
  colour => white

Any particular reason? Do I need to define %h differently if I'm tying
it?

Thank-You..



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

Date: 12 Jan 1999 11:12:35 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Verify an email address
Message-Id: <m3ww2stl64.fsf@moiraine.dimensional.com>

Scratchie <upsetter@ziplink.net> writes:

> So, for my purposes, I find it useful to use a regex which (among other
> things) does not allow spaces in user names, even though 
> "a f &#$% "@someserver.com 
> may be a perfectly valid user name. 

Does your employer understand that you have decided that some of
their customers aren't important?  Does your employer understand
that you have made an arbitrary decision to disallow contact with
an undetermined number of customers?  Does your employer understand
that the only net effect of this is to drive potential paying
clients away?

More importantly, do your employer's customers understand that because
they don't match your sensibilities of what is and is not valid that
they will not be allowed to communicate with your employer?  Do you really
think that this is justifiable under any circumstances?

> Sorry that everyone's business needs don't match yours, but there's not a
> lot I can do about that.

I am finding it difficult to imagine a situation where anyone's business
needs are met by refusing to communicate with clients.

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: Tue, 12 Jan 1999 13:17:00 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Verify an email address
Message-Id: <fl_aggie-1201991317000001@aggie.coaps.fsu.edu>

In article <20Lm2.51$N4.4458@news.shore.net>, Scratchie
<upsetter@ziplink.net> wrote:

+ David Formosa (aka ? the Platypus) <dformosa@zeta.org.au> wrote:

+ : postmaster@[127.0.0.1]
 
+ In most real-world applications (typically web forms where someone signs
+ up for a mailing list), I would *want* my email-checker to reject that
+ address, thank you very much.

And it would also reject "user@[207.82.252.251]"...

James - 207.82.252.251 == hotmail.com...


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

Date: Tue, 12 Jan 1999 14:41:10 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Web and perl
Message-Id: <comdog-ya02408000R1201991441100001@news.panix.com>

In article <BfLm2.297$2u.5302330@news.siol.net>, "Mark Jean Do" <markopavlisic@iname.dot.com> posted:

> I can get some html with Perl. But how can I get file if it requires to
> logon? I know username and password.

use LWP and supply the authorization information.  see the docs for
examples.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>


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

Date: Tue, 12 Jan 1999 19:57:19 GMT
From: ryan@mail.ramresearch.com (Ryan McGuigan)
Subject: what's going on here?  LWP problem, example doesn't work!
Message-Id: <zONm2.844$5I.1590797@news.abs.net>

Hi, if anyone could give me any clue as to why this doesn't work I'd
really really appreciate it, please, while I still have hair left! ;-)

Ok, here's the example I copied from the docs, the only difference is the
URL and the content being sent.  I know I have used this code before,
about 6 months ago probably and it worked fine.  I tried this on 2
machines, one running the same copy of perl that this worked on...  It's
odd, it doesn't print the error message so it appears to be successful,
but it doesn't print the content...  

  # Create a user agent object
  use LWP::UserAgent;
  $ua = new LWP::UserAgent;
  $ua->agent("AgentName/0.1 " . $ua->agent);

  # Create a request
  my $req = new HTTP::Request POST => 'http://www.cardgame.com/cgi-bin/cardgame/cg.pl';
  $req->content_type('application/x-www-form-urlencoded');
  #$req->content('match=www&errors=0');
  $req->content('email=ryan@cardweb.com&password=crap');

  # Pass request to the user agent and get a response back
  my $res = $ua->request($req);

  # Check the outcome of the response
  if ($res->is_success) {
      print $res->content;
  } else {
      print "Bad luck this time\n";
  }


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

Date: 12 Jan 1999 18:44:54 GMT
From: gward@thrak.cnri.reston.va.us (Greg Ward)
Subject: Re: Year 2038 problem
Message-Id: <77g576$4kj$2@news0-alterdial.uu.net>

Abigail <abigail@fnx.com> wrote:
> 30 years wasn't enough going from 2 digit years to 4 digit years.
> What makes you think 40 years will be enough to go from 32 bits to 64?

<sarcasm>
Oh c'mon!  The great thing about humanity is that we *learn* from our
mistakes!  Surely *no one* will ever write software so short-sighted
as to use a mere two digits for the year again!  (Or 32 bits for the
seconds since some epoch.)
</sarcasm>

But seriously: I hope that medical science figures out how to keep me
alive until I'm 130, because I'm betting there will be a Year 2100
problem... ;-)

        Greg
-- 
Greg Ward - software developer                    gward@cnri.reston.va.us
Corporation for National Research Initiatives    
1895 Preston White Drive                      voice: +1-703-620-8990 x287
Reston, Virginia, USA  20191-5434               fax: +1-703-620-0913


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

Date: 12 Jan 1999 19:19:26 GMT
From: michal@gortel.phys.ualberta.ca (Michal Jaegermann)
Subject: Re: Year 2038 problem
Message-Id: <77g77u$lq4$1@pulp.ucs.ualberta.ca>

Bart Lateur (bart.lateur@skynet.be) wrote:
: John Robson wrote:

: >I heard that Perl and perhaps Linux as well have a 'year 2038' problem. 
: >Has something to do with an internal 32-bit reperesentation.  
: >Just out of curiosity, can someone explain to me where this '2038' number
: >come from?  What does it entail?

: You're right.

Hardly. :-)

perl -e 'print (scalar localtime 2**55, "\n")'
Sat Jun 12 23:26:08 1141709097

This is Perl and Linux (on Alpha machine, but so what :-).

Width of time_t type is really not prescribed although on 32-bit
machine it is convenient to have it as a signed 32-bit type.
This is really something for a particular implementation of underlying
libraries to resolve and has nothing to do with Perl (or Linux, for
that matter).  Besides your applications do not have to use time_t
to represent dates; check, for example, a range of avaialable
dates in Oracle on any platform.  (The fact that Oracle does not
have any sane provisions to keep dates time zone independent is
another story.)

  --mj


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

Date: Tue, 12 Jan 1999 19:33:06 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Year 2038 problem
Message-Id: <369ba1e3.1069554@news.skynet.be>

Michal Jaegermann wrote:

>perl -e 'print (scalar localtime 2**55, "\n")'
>Sat Jun 12 23:26:08 1141709097

So in your system, a 64-bit number is used?

I think, countrary to Abigail, that indeed the 2038 problem is quite
easily solvable, because most routines that use time do not depend on
the format of the time. They just hope that the room they provide to
store the number, is enough.

This would indeed imply that 64 bit integers should be implemented in
all programming languages. But, to paraphrase Randal:

	"Stop using 38 year old software!"


The largest problems are probably in the Unix kernels. Which, most
likely, could be recompiled without much trouble. Your practical example
using Linux shows it can be done.

	Bart.


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

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


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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

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

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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


------------------------------
End of Perl-Users Digest V8 Issue 4631
**************************************

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