[11273] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4873 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 11 17:07:22 1999

Date: Thu, 11 Feb 99 14:00:23 -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           Thu, 11 Feb 1999     Volume: 8 Number: 4873

Today's topics:
        Announce: Perl Function Repository (was Re: Calculate y <dgris@moiraine.dimensional.com>
        Can anyone donate webspace to a person learning perl? j.kuiters@bigpond.com
    Re: Can anyone donate webspace to a person learning per (Randal L. Schwartz)
        Can't ODBC or ADO to Oracle8 NT <andystiff@pmsc.com>
    Re: change column of nmbers to 2 dim array (Bart Lateur)
        Changing the user inside a Perl script strattner@my-dejanews.com
    Re: Comments in Perl code <bmb@ginger.libs.uga.edu>
    Re: Comments in Perl code <rra@stanford.edu>
    Re: Comments in Perl code (Michael Rubenstein)
    Re: Creating /tmp files securely? <dwc3q@cs.virginia.edu>
        Date problem <jim_eichert@jhuapl.edu>
    Re: Date problem <bmb@ginger.libs.uga.edu>
    Re: Date problem <rra@stanford.edu>
    Re: displaying images in directory <Allan@due.net>
    Re: email a form mdlong@omnifcu.org
    Re: extracting data from returned script (Abigail)
    Re: fun with strings... (Bart Lateur)
    Re: fun with strings... <uri@ibnets.com>
    Re: Help extracting Internet Address with Regular Expre (Abigail)
    Re: How do I delete a hash element ?? (Abigail)
    Re: How do I delete a hash element ?? (Larry Rosler)
    Re: How do I use CGI.pm to fetch parameters? <gellyfish@btinternet.com>
    Re: How to calculate number of working days? (Abigail)
    Re: Is there another way (Abigail)
    Re: Matching elements in arrays or hashes? (Abigail)
        MySQL and moving within records <jrush@igic.com>
    Re: Need Perl Tcl/Tk for Linux (Abigail)
    Re: newbie perl and cgi question..... (Bart Lateur)
    Re: Parenthetical Expressions (Larry Rosler)
    Re: Parenthetical Expressions (Greg Bacon)
    Re: parseInt <Allan@due.net>
    Re: perl5 release <jglascoe@jay.giss.nasa.gov>
        Solaris: panic: corrupt saved stack index, <try> chunk  (Joe Loiacono)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 11 Feb 1999 12:11:16 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Announce: Perl Function Repository (was Re: Calculate yesterdays date)
Message-Id: <m3d83g92nf.fsf_-_@moiraine.dimensional.com>

[ comp.lang.perl.modules removed from Newsgroups: ]

lr@hpl.hp.com (Larry Rosler) writes:

> What I would like to see is a dynamic on-line equivalent of the kind of 
> code published in The Perl Cookbook, contributed to and reviewed 
> collaboratively, and with a searchable index.

Done.

The Perl Function Repository-
  http://moiraine.dimensional.com/~dgris/perl/pfr/

Right now the only piece of code included in the PFR is Russ
Allbery's yesterday() subroutine that was posted here yesterday.
(Russ, if you don't want the code in there, let me know).

Now, before everyone gets excited and starts flooding me with
code pieces to include- *don't send code directly to me.

I'd like to see any code that is intended for the PFR to be reviewed
here beforehand.  I believe that the peer review that open source
offers is the strongest advantage that our model has over the
proprietary development model and I'd like to see us exploit that
advantage as much as possible. Besides, I trust the ability of the
general perl community to catch bizarre bugs and gotchas much more
than I trust my own ability to do so.

If you need to CC me on posts about code that should be in the PFR,
feel free, but it isn't necessary.  I read clpm(od|isc) religiously
and am not likely to miss any interesting discussion.  If you'd like
to prepend `PFR:' to the subject of articles to make sure that I don't
miss them, that would be a good thing (plus it would allow people
uninterested in the project to easily skip articles related to it).

Finally, this was put together in about an hour last night and I 
fully expect that it has more than its share of bugs.  I'll clean
them up as we go.

Have the appropriate amount of fun.

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


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

Date: Thu, 11 Feb 1999 21:05:29 GMT
From: j.kuiters@bigpond.com
Subject: Can anyone donate webspace to a person learning perl?
Message-Id: <36c344a3.1763425@news.bigpond.com>

HI Everyone.

I'm currently learning Perl and am finding it lots of fun, however the
programs I'm creating are to show my employer the benifits of using
perl.

I don't and nor do they have a webserver on the internet that has perl
on it.

I was wondering if anyone would be interested in donating space (1 to
2 MB) to a budding programmer. There would be very low usage of the
site, and I'd probably only need it for a month or two to show how
great it is before they'll upgrade the server.

I'd need FTP access to upload the scripts, and to be able to access
them via a webserver (HTTP/www) , and (if possible) telnet access just
to chmod and debug the scripts.

Thanx everyone
Julian


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

Date: 11 Feb 1999 13:28:40 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Can anyone donate webspace to a person learning perl?
Message-Id: <m1n22kfx4n.fsf@halfdome.holdit.com>


[comp.lang.perl is dead dead dead for 3.5 years.  stop posting it!]

>>>>> "j" == j kuiters <j.kuiters@bigpond.com> writes:

j> I don't and nor do they have a webserver on the internet that has perl
j> on it.

Download Apache.  Run it nearly anywhere.

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Thu, 11 Feb 1999 20:49:01 GMT
From: Bueller <andystiff@pmsc.com>
Subject: Can't ODBC or ADO to Oracle8 NT
Message-Id: <79vfnp$h3k$1@nnrp1.dejanews.com>

Howdy all,

I've been writing Perl to connect to databases for a month or so now. I've
used WIN32::OLE and WIN32::ODBC and so far had no problems reading and
writing to MS Access and SQL Server databases. However I've installed Oracle
8.0.3 for NT and can't connect using any method. I get the following message
from the open connection -

[160] [] "Specified driver could not be loaded due to system error 126 (Oracle
ODBC Driver)."

I don't think it's an ODBC problem on the host as I can successfully link and
query tables from the Oracle database to an MS Access DB via ODBC.

I've checked all the doco, Oracles site and searched the Net and haven't had
any luck as yet. I have an uneasy feeling that it could be that the Oracle
8.0.3 driver is ODBC 2.5 not 3.0 (3.0 required for WIN32::ODBC etc.) but I'm
not completely sure that this is the case. Can anyone either confirm this (so
I'll get Oracle 8.0.4) or suggest a workaround.

Thanx a bunch. Please reply via email (andystiff@pmsc.com) if you can, cheers.

Catchya,
Andy.

Andy Stiff
Infrastructure Manager
Client Services Division
PMSC P/L
Melbourne Australia.

Catchya,
Andy.
Andy Stiff
Infrastructure Manager

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


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

Date: Thu, 11 Feb 1999 19:37:39 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: change column of nmbers to 2 dim array
Message-Id: <36c42b72.548371@news.skynet.be>

Abigail wrote:

><> grep/map in void context is considered bad form.
>
>It's considered bad form by some.  

Including me.

"grep" in void context is *definitly* bad form, since it doesn't do
anything it was designed for, i.e. filtering data.

"map" in a void context is bad too, again, because it's not used for
what it was designed for: construct a list of results of applying a
function to each item in a source list. In fact, the mere fact that
"map" *can* change that item is bad form enough. For efficiency reasons,
it will remain like that. But I, for one, think it is bad form to rely
on that fact.

Besides, what do you find so attractive in:

	map BLOCK LIST;

over:

	foreach (LIST) BLOCK

?
	Bart.


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

Date: Thu, 11 Feb 1999 21:00:27 GMT
From: strattner@my-dejanews.com
Subject: Changing the user inside a Perl script
Message-Id: <79vgd4$hob$1@nnrp1.dejanews.com>

Here's my situation:

I have some shell scripts that interact with db2. I would like to call these
scripts from the web, using an html form calling a perl cgi program. When I
tried to do so, the scripts failed to connect to db2; apparently the web
server runs the cgi script under user 'nobody'. The problem is, I have the
db2 databases require particular authorization in order to run SQL on them -
not just anybody (and that includes nobody) can query the database. I would
prefer to keep it this way, which is why I would like to change the working
user to one db2 will recognize - inside the Perl script.

I checked the documention, and it did mention a 'setuid'. However, I could
not find any reference to a setuid command, code samples, nothing. My
question is, where can I find helpful information on changing the effective
user within Perl?

Thanks in advance,

Scott

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


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

Date: Thu, 11 Feb 1999 15:22:38 -0500
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: Comments in Perl code
Message-Id: <Pine.A41.4.02.9902111521230.25262-100000@ginger.libs.uga.edu>

On Wed, 10 Feb 1999, Larry Rosler wrote:
> If there is real demand for this, perhaps a 'perl -#' flag would be the 
> best way to implement it.

No, no!  Comments should be made *mandatory*--pod, too!

-Brad



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

Date: 11 Feb 1999 12:26:49 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Comments in Perl code
Message-Id: <ylsocc7kl2.fsf@windlord.stanford.edu>

Larry Rosler <lr@hpl.hp.com> writes:
> Ala Qumsieh <aqumsieh@matrox.com> says...

>> % perl -pi.bak -e 's/\#.*$//' file.pl
>                        ^   ^
>                         Why?

The trailing $ clearly isn't needed, true.  The backslash before the # is
a habit I'm in as well since it unconfuses cperl-mode's syntax
highlighting, which otherwise is under the impression the rest of the
expression is a comment.

There are a few odd nits like that with cperl-mode (dealing with (\s|$) in
a regex is another one), some of which may be related to the fact that I'm
still using emacs 19.34 and therefore don't have the benefit of the new
parsing code that's supposedly in emacs 20.  (But for doubters, cperl-mode
works wonderfully the vast majority of the time and makes writing and
debugging Perl considerably faster.)

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Thu, 11 Feb 1999 21:09:30 GMT
From: miker3@ix.netcom.com (Michael Rubenstein)
Subject: Re: Comments in Perl code
Message-Id: <36cb45de.519000953@nntp.ix.netcom.com>

On Wed, 10 Feb 1999 22:36:08 -0800, lr@hpl.hp.com (Larry Rosler)
wrote:

>In article <x3yzp6ooncy.fsf@tigre.matrox.com> on Mon, 8 Feb 1999 
>11:45:50 -0500 , Ala Qumsieh <aqumsieh@matrox.com> says...
>> 
>> Eric Kihn <kihn@mindspring.com> writes:
>> 
>> > As a final thought. Has anyone considered how simple it would be to
>> > write a script called deploy.pl that simply
>> > strips all the comments (and even white space if you want) so that the
>> > "user" version is as fast as can be, but the coder get's his comments?
>> 
>> Yeah .. it's extremly simple .. 
>> 
>> % perl -pi.bak -e 's/\#.*$//' file.pl
>                       ^   ^
>                        Why?
>
>Well, that is indeed extremely simple, and -- like most extremely simple 
>solutions to complex problems -- it is extremely wrong.
>
>Consider the following (probably partial) list of ways in which it will 
>go astray:
>
>'#' within a string literal: 'x#y'
>'#' as a string-literal quote delimiter: q#foo#
>'#' as a regex delimiter: m#bar#

You forgot the one that was staring you in the face, '#' in a regular
expression such as

	s/\#.*$//

--
Michael M Rubenstein


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

Date: Thu, 11 Feb 1999 13:49:47 -0500
From: David Coppit <dwc3q@cs.virginia.edu>
To: Frank Varnavas <frank.varnavas@bankerstrust.com>
Subject: Re: Creating /tmp files securely?
Message-Id: <Pine.WNT.4.05.9902111340420.-108412089-100000@juggernaut>


Hi Frank, thanks for the reply.

On Thu, 11 Feb 1999, Frank Varnavas wrote:

> (1) generate the path I wanted
> (2) lstat it -- if in use go back to (1)
> (3) create it
> (4) lstat it -- if it's a symlink, close and go back to (1)
> (5) unlink it (while it's still open)

Sorry, I should have said that this script is supposed to be portable. I
can't rely on the 'ol "nonexistent file" trick on other platforms.

lstat'ing it is a good idea, though. Lemme see...

1) Generate the temporary file name /tmp/somename.
2) lstat it. If it's in use, go back to 1.
3) Set umask to 600.
4) Create it. Die if create fails. (Someone may have created a file with
   the same name between 2 and 4.)
5) lstat it to be sure that it's not a symlink, and I still own the file.
   Die if it's a symlink. (Someone may have created a symlink between 2
   and 4, in which case the file creation would have silently re-created
   the rouge destination file of the symlink.)
6) Read/write to the file.
7) Close it.
8) Unlink it.

Somehow, I think that steps 4 & 5 can be improved by telling open not to
follow symlinks, in which case it fails. That way there's no need to lstat
it the second time.

Regards,
David 

________________________________________________________________________
David Coppit - Graduate Student        coppit@cs.virginia.edu
The University of Virginia             http://www.cs.virginia.edu/~dwc3q
                "For I am a Bear of Very Little Brain,
             and long words Bother me" - Winnie the Pooh



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

Date: Thu, 11 Feb 1999 15:17:40 -0500
From: Jim Eichert <jim_eichert@jhuapl.edu>
Subject: Date problem
Message-Id: <36C33AE4.6D956D74@jhuapl.edu>

I am new to this group and relatively new to PERL.  I was wondering if
anybody could tell me how to get "yesterday's date" in DMY format.  I
know how to find "today's date" using the timelocal function.  I simply
can't subtract 1 day from the current day because I need to take into
consideration leap seconds.  If there was a Julian day function(s) which
could translate DMY into Julian day and another one to do the reverse
this would help since I could subtract 1 from Julian day.  Any
suggestions?

JimE



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

Date: Thu, 11 Feb 1999 15:48:20 -0500
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: Date problem
Message-Id: <Pine.A41.4.02.9902111537450.25262-100000@ginger.libs.uga.edu>

On Thu, 11 Feb 1999, Jim Eichert wrote:
> I am new to this group and relatively new to PERL.  I was wondering if
> anybody could tell me how to get "yesterday's date" in DMY format.  I
> know how to find "today's date" using the timelocal function.  I simply
> can't subtract 1 day from the current day because I need to take into
> consideration leap seconds.  If there was a Julian day function(s) which
> could translate DMY into Julian day and another one to do the reverse
> this would help since I could subtract 1 from Julian day.  Any
> suggestions?

I love it.

Jim, what I mean is, if you had been here yesterday, you'd have seen the
answer!  I know I'm not being helpful, but you'll get that once in a
while. :-)

--
#!/usr/local/bin/perl
print <<'_';
 _____  _____  _____  _____
/\  __'\\  __'\\  __'\\  __'\
\ \ \_\ \\ \_\ \\ \_\ \\ \ \ \
 \ \  __'.\  __'.\  __ \\ \ \ \
  \ \ \_\ \\ \'\ \\ \'\ \\ \_\ \
   \ \____/ \_\ \_\\_\ \_\\____/
    \/___/ \/_/`/_//_/`/_//___/
_



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

Date: 11 Feb 1999 12:53:07 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Date problem
Message-Id: <ylhfss7jd8.fsf@windlord.stanford.edu>

Jim Eichert <jim_eichert@jhuapl.edu> writes:

> I am new to this group and relatively new to PERL.  I was wondering if
> anybody could tell me how to get "yesterday's date" in DMY format.

Didn't I just answer this question the other day?  Was that you or someone
else?

> I know how to find "today's date" using the timelocal function.  I
> simply can't subtract 1 day from the current day because I need to take
> into consideration leap seconds.

Er... you have to take into consideration leap seconds?  Seriously?  The
length of time that it takes your script to run is as likely to change the
result that you get back as leap seconds are.

> If there was a Julian day function(s) which could translate DMY into
> Julian day and another one to do the reverse this would help since I
> could subtract 1 from Julian day.  Any suggestions?

I imagine there's probably a module to do Julian day conversions, but I'd
really recommend just using the yesterday function that I posted to this
newsgroup... yesterday.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Thu, 11 Feb 1999 15:24:15 -0500
From: "Allan M. Due" <Allan@due.net>
Subject: Re: displaying images in directory
Message-Id: <79vdti$hb1$1@camel18.mindspring.com>

dan wrote in message <36C32185.4852BB71@macdaddyusa.com>...
:is there a way to display every image in a directory on a web page?


I'm thinking the answer can't be no.  Are you asking for code, pointers,
permission to proceed?  It's really not too clear to me, but that just might
be me.

AmD

[removed the dead newsgroup from followups]






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

Date: Thu, 11 Feb 1999 21:03:28 GMT
From: mdlong@omnifcu.org
Subject: Re: email a form
Message-Id: <79vgip$hq6$1@nnrp1.dejanews.com>

In article <linberg-2001991740370001@ltl1.literacy.upenn.edu>,
  linberg@literacy.upenn.edu (Steve Linberg) wrote:
> In article <785l0j$36@nntpb.cb.lucent.com>, "Bill Sherry"
> <bsherry@lucent.com> wrote:
>
> > I have a need to email an HTML form that a user has filled out.
> >
> > I know how to create the form with HTML, I do not know how to write a script
> > that will extract the data from the form so that it can be emailed to
> > another person.
> >
> > Is there software that will create the script form the form?
> >
> > I have a NT server that I am using for the Web site. Most of the material I
> > see speaks to UNIX.
>
> You can use a MAILTO: action for the form; it will mail the form's
> contents to whomever you specify, although it will be escaped in the
> manner URLs are.  It's readable, but you may want a decoder for the other
> end.
>
> NT lacks sendmail.  In the latest service pack there is a method for
> mailing, but if you're on SP3 you'll have to use third-party software.
> There are several available; check the ms server newsgroups.
>
> --
> Steve Linberg, Systems Programmer &c.
> National Center on Adult Literacy, University of Pennsylvania
> email: <linberg@literacy.upenn.edu>
> WWW: <http://www.literacyonline.org>
>

I THOUGHT I had created and set up a form to email the RESULTS of the form to
two different people upon pressing the submit button.  But it only brings up
a BLANK email message that can be filled out and then sent to both people
with whatever text you type in it. Could someone check out my code and tell
me where I went wrong?

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="Michelle D. Long">
<title>Accounting Email Form</title>
<script>
<!--start script here
function checkform( thisform ) {

if ( thisform.FirstName.value == null || thisform.FirstName.value == "" ) {
	alert ("Please enter your First Name") ;
	thisform.FirstName.focus() ;
	thisform.FirstName.select() ;
	return false ;
}

if ( thisform.LastName.value == null || thisform.LastName.value == "" ) {
	alert ("Please enter your Last Name") ;
	thisform.LastName.focus() ;
	thisform.LastName.select() ;
	return false ;
}

if ( thisform.EmailAddress.value == null || thisform.EmailAddress.value == ""
) {	  alert ("Please enter your Email Address") ;	 
thisform.EmailAddress.focus() ; 	thisform.EmailAddress.select() ;     
  return false ; }

if ( thisform.DayPhoneAreaCode.value == null ||
thisform.DayPhoneAreaCode.value == "" ) {	alert ("Please enter your
Daytime Phone Area Code") ;   thisform.DayPhoneAreaCode.focus() ;    
thisform.DayPhoneAreaCode.select() ;	return false ; }

if ( thisform.DayPhonePrefix.value == null || thisform.DayPhonePrefix.value ==
"" ) {
	alert ("Please enter your Daytime Phone Prefix") ;
	thisform.DayPhonePrefix.focus() ;
	thisform.DayPhonePrefix.select() ;
	return false ;
}

if ( thisform.DayPhoneSuffix.value == null || thisform.DayPhoneSuffix.value ==
"" ) {
	alert ("Please enter your Daytime Phone Suffix") ;
	thisform.DayPhoneSuffix.focus() ;
	thisform.DayPhoneSuffix.select() ;
	return false ;
}
if ( thisform.Comments.value == null || thisform.Comments.value == "" ) {
	alert ("Please enter your Comment") ;
	thisform.Comments.focus() ;
	thisform.Comments.select() ;
	return false ;
}

}
// End of script-->

</script>

<meta name="Microsoft Border" content="tlb, default">
</head>

<body bgcolor="#FFFFFF">

<p>&nbsp;</p>
<div align="center"><center>

<table border="0" width="100%" height="49" cellspacing="0" cellpadding="0">
  <tr>
    <td width="100%" height="45">&nbsp;<div align="left"><table border="0"
cellpadding="0"
    cellspacing="0" width="100%" height="74">
      <tr>
        <td height="53" width="222"><p align="center"><img
src="../../images/mailbin3.gif"
        alt="E-mail Omni image" WIDTH="138" HEIGHT="105"></td>
        <td valign="bottom" height="53" width="763">&nbsp;<p><i><font
face="Arial"><big><big><strong>Accounting
        </strong></big></big><small><em>(All Fields are required<font
color="#000000">)</font></em></small></font></i></p>
        <hr style="color: rgb(0,0,0)" width="95%" align="left">
        </td>
      </tr>
    </table>
    </div></td>
  </tr>
</table>
</center></div><div align="center"><center>

<table border="0" width="100%" cellspacing="0" cellpadding="0">  <tr>  <td
width="84%" valign="top">&nbsp;<p><big><big><strong><i><font
face="Arial">&nbsp;&nbsp; </font></i></strong></big></big></p>	<form
METHOD="POST" ACTION="mailto:mdlong@omnifcu.org;sflanery@omnifcu.org" 
Name="EmailAccounting" onSubmit="return checkform( this )">  <div
align="left"><table border="0" width="85%" cellspacing="0" cellpadding="0" 
height="54">  <tr align="center">  <td width="20%" align="left"
height="25"><div align="right"><p><font face="Arial">First 
Name:&nbsp;&nbsp;&nbsp; </font></td>  <td width="30%" align="left"
height="25"><font face="Arial"><input type="text"  NAME="FirstName" size="15"
maxlength="25" tabindex="1"> MI <input type="text"  NAME="MiddleInit"
size="1" maxlength="1" tabindex="2"></font></td>  </tr>  <tr align="center"> 
<td width="20%" align="left" height="25"><div align="right"><p><font
face="Arial">Last  Name:&nbsp;&nbsp;&nbsp; </font></td>  <td width="30%"
align="left" height="25"><font face="Arial"><input type="text" 
NAME="LastName" size="15" maxlength="25" tabindex="3"></font></td>  </tr> 
<tr align="center">  <td width="20%" align="left" height="25"><div
align="right"><p><font face="Arial">E-Mail  Address:&nbsp;&nbsp;&nbsp;
</font></td>  <td width="30%" align="left" height="25"><font
face="Arial"><input type="text"  NAME="EmailAddress" size="25" maxlength="40"
tabindex="4"></font></td>  </tr>  <tr align="center">  <td width="20%"
align="left" height="25"><div align="right"><p><font face="Arial">Day 
Telephone:&nbsp;&nbsp;&nbsp; </font></td>  <td width="30%" align="left"
height="25"><font face="Arial"><input type="text"  NAME="DayPhoneAreaCode"
size="3" maxlength="3" tabindex="5"><input type="text"	NAME="DayPhonePrefix"
size="3" maxlength="3" tabindex="6"><input type="text"	NAME="DayPhoneSuffix"
size="4" maxlength="4" tabindex="7">&nbsp; Ext:&nbsp;&nbsp; <input 
type="text" NAME="DayPhoneExt" size="6" maxlength="6"
tabindex="8"></font></td>  </tr>  <tr>	<td width="20%" align="left"
height="1" valign="top"><div align="right"><p><font 
face="Arial">Comments:&nbsp;&nbsp;&nbsp; </font></td>  <td width="30%"
align="left" height="1"><font face="Arial"><textarea Name="Comments" 
wrap="virtual" ROWS="7" COLS="30" tabindex="9"> </textarea> </font></td> 
</tr>  </table>  </div><div align="center"><center><p><font
face="Arial"><input TYPE="submit"  onsubmit="return checkform( this )"
Value="Email Accounting!"> <input TYPE="reset"	Value="Clear
Form"></font></p>  </center></div>  </form>  </td>  </tr> </table>
</center></div>

<p>&nbsp;
</body>
</html>

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


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

Date: 11 Feb 1999 19:49:37 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: extracting data from returned script
Message-Id: <79vc8h$h4h$1@client2.news.psi.net>

Thijs (T.Elenbaas@stud.tue.nl) wrote on MCMLXXXVIII September MCMXCIII in
<URL:news:36C09E4C.9E8E146B@stud.tue.nl>:
^^ Hello,
^^ 
^^ I have a problem. I want to submit a form to a site and grab the
^^ returned page, so that
^^ I can extract the info I want. Is this possible, and if so, can someone
^^ please help me,


Just use 'save' from your browser!


HTH. HAND.



Abigail
-- 
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


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

Date: Thu, 11 Feb 1999 19:37:42 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: fun with strings...
Message-Id: <36c52dca.1148646@news.skynet.be>

Uri Guttman wrote:

>
>  RJK> a) the substitution may need to be extended to other escape sequences
>
>there are only a handful of escape sequences and \n and \t are among the
>most common. how many times do you see \a or \f? he did only ask for \n
>and \t. 

Than he was wrong. Consider a string that looks like this:

	You can represent a newline as '\n'

How would you encode it? And decode it again, so that it looks like this
again? You MUST provide an escape for the backslash.

Now, lets take this updated conversion list:

	encoded	char
	 '\n'	 "\n"
	 '\t'	 "\t"
	 '\\\\"	 "\\"

I chalenge you to find a repeated substitution mechanism that decodes
this, without screwing up. Let me spoil your fun, and tell you that you
can't find one.

Take the string that looks like

	\\n

Try decoding it, newline first, then backslash:

	s/\\n/\n/g;
	s/\\\\/\\/g;

result: backslash + newline.

Reverse the order:

	s/\\\\/\\/g;
	s/\\n/\n/g;

Now you can't distinuish between single and double backslashes. Result:
newline.

Both are wrong.

Now try

	%replace = ( n => "\n", t => "\t", "\\" => "\\");
	s/\\([nt\\])/$replace{$1}/g;

and you'll have the result you want: backslash + "n".

Your solution may seem straightforward, but it doesn't scale up well (it
slows down by a factor of 50% for this one addition), plus you have the
challenge to find a replacement sequence, if one exists, that actually
works.

My solution works perfectly, is virtually as fast with 3 as with 2
replacements, and adding more is a no-brainer.

	Bart.


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

Date: 11 Feb 1999 15:44:56 -0500
From: Uri Guttman <uri@ibnets.com>
Subject: Re: fun with strings...
Message-Id: <39lni4llfb.fsf@ibnets.com>

>>>>> "BL" == Bart Lateur <bart.lateur@skynet.be> writes:

  BL> Uri Guttman wrote:
  >> 
  RJK> a) the substitution may need to be extended to other escape sequences
  >> 
  >> there are only a handful of escape sequences and \n and \t are among the
  >> most common. how many times do you see \a or \f? he did only ask for \n
  >> and \t. 

but that is what he asked for. i agree that other solutions may be more
flexible or not. he had embedded literal \n and \t that he needed to
convert to real \n and \t. i just solved that problem, nothing else.

  BL> 	%replace = ( n => "\n", t => "\t", "\\" => "\\");
  BL> 	s/\\([nt\\])/$replace{$1}/g;

  BL> 	You can represent a newline as '\n'

and yours can't handle the above either. no one can since it is english
context sensitive. you can add support for '' but what if another
demarcation is used. 

my point is that you solve a problem according the known data set. my
solution did that as do the rest. if the data set can expand then you
can expand any of the solutions, some easier than others. and some run
faster than others. that is what makes perl and software engineering,
choices. remember, we are not bottommind!

uri

-- 
Uri Guttman                             Hacking Perl for Ironbridge Networks
uri@sysarch.com				uri@ironbridgenetworks.com	


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

Date: 11 Feb 1999 20:09:06 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Help extracting Internet Address with Regular Expression.
Message-Id: <79vdd2$h4h$2@client2.news.psi.net>

Nelson Beaman (nbeaman@msn.com) wrote on MCMLXXXIX September MCMXCIII in
<URL:news:OxwpUrPV#GA.248@upnetnews02.moswest.msn.net>:
,, I am trying to extract an Internet address (i.e. beaman@hboi.edu)


$ nslookup beaman@hboi.edu
Server:  gatekeeper.wayne.fnx.com
Address:  192.168.10.2

*** gatekeeper.wayne.fnx.com can't find beaman@hboi.edu: Non-existent host/domain


Nope, doesn't look like an "Internet address" to me.



Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


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

Date: 11 Feb 1999 20:11:32 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: How do I delete a hash element ??
Message-Id: <79vdhk$h4h$3@client2.news.psi.net>

paulosa@gcm.com (paulosa@gcm.com) wrote on MCMLXXXIX September MCMXCIII
in <URL:news:79suim$acg$1@nnrp1.dejanews.com>:
|| I tried "undef" does not work.
|| 
|| ex:
|| 
|| $hash{test} = "test";
|| undef $hash{test};
|| 
|| does not remove 'test' from the hash?? any ideas!


Did you search for 'delete' in the man page?




Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


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

Date: Thu, 11 Feb 1999 12:56:02 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How do I delete a hash element ??
Message-Id: <MPG.112ce3ba3186a102989a22@nntp.hpl.hp.com>

In article <79vdhk$h4h$3@client2.news.psi.net> on 11 Feb 1999 20:11:32 
GMT, Abigail <abigail@fnx.com> says...
> paulosa@gcm.com (paulosa@gcm.com) wrote on MCMLXXXIX September MCMXCIII
> in <URL:news:79suim$acg$1@nnrp1.dejanews.com>:
> || I tried "undef" does not work.
> || 
> || ex:
> || 
> || $hash{test} = "test";
> || undef $hash{test};
> || 
> || does not remove 'test' from the hash?? any ideas!
> 
> Did you search for 'delete' in the man page?

The technical term for your response is 'begging the question'.

He might have searched for 'undefine', 'remove', 'erase', 'expunge', 
'cancel', 'efface', or 'obliterate', and not found it.  But 'delete' 
*would* have found it, because that's the answer.

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


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

Date: 11 Feb 1999 21:03:54 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: How do I use CGI.pm to fetch parameters?
Message-Id: <79vgjq$262$1@gellyfish.btinternet.com>

On Mon, 8 Feb 1999 18:57:35 -0800 Sam Schulte wrote:
> The below should work Jonathan.  Why can't people just answer questions in
> this group instead of all this "go read more" stuff?
> 
> 
> 
> #!/usr/local/bin/perl
> 
> #####################
> # headlines.pl
> # Jonathan Stowe
> # 2/8/99
> #####################
> 

Lets put it like this  - I dont understand why you put my name in that header
but I think you failed to get the point.  The original poster has already
shown us *working* code that is possibly more idiomatic of CGI.pm than
what you have.  The problem he has is with the way that it is called and
*that* is not pertinent in this group.

There seems to have been an explosion recently of people giving incorrect
off-topic answers to basically off-topic questions and I dont think that
this trend should be encouraged - if people want to talk about CGI or SSI or
some other non-Perl related matters then they should go to the appropriate
group.

Anyhow for libel: *plonk*

/J\


-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 11 Feb 1999 20:12:40 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: How to calculate number of working days?
Message-Id: <79vdjo$h4h$4@client2.news.psi.net>

Hemant Shah (shah@xnet.com) wrote on MCMLXXXVIII September MCMXCIII in
<URL:news:79q9ij$kta$1@flood.xnet.com>:
!! 
!! Folks,
!! 
!!    I am looking for algorithm/module to calculate number of workdays,
!!    given a start date and end date. A work day is Mon through Fri. I do
!!    not care about holidays, count them as workday.
!!    
!!    Example:
!!       Start 06-29-1999
!!       End   07-06-1999
!!       
!!       6 working days


Date::Manip.



Abigail
-- 
perl -wleprint -eqq-@{[ -eqw\\\\- -eJust -eanother -ePerl -eHacker -e\\\\-]}-


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

Date: 11 Feb 1999 20:14:05 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Is there another way
Message-Id: <79vdmd$h4h$5@client2.news.psi.net>

Bob Lally (rlally1@nycap.rr.com) wrote on MCMLXXXIX September MCMXCIII in
<URL:news:N77w2.3491$YL3.211972@typhoon.nycap.rr.com>:
() Hi:
() 
() I have a variable that contains an ISO country code.  I want to output text
() depending on which country is coming in. I realize that not all domain names
() conform.  I have it currently designed with IF statements.  Does perl have a
() "switch" type statement?  Should I use else's for every statement after the
() first?  What method would be best to save time?

Did you search the documentation for 'switch'? Yes? Then what part
of didn't you understand?




Abigail
-- 
perl -wle '(1 x $_) !~ /^(11+)\1+$/ && print while ++ $_'


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

Date: 11 Feb 1999 20:15:06 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Matching elements in arrays or hashes?
Message-Id: <79vdoa$h4h$6@client2.news.psi.net>

mattd@ukcc.uky.edu (mattd@ukcc.uky.edu) wrote on MCMLXXXVIII September
MCMXCIII in <URL:news:79q93i$u7d$1@nnrp1.dejanews.com>:
__ 
__ I would like to take each element of the first file and compare it to
__ the ninth field of the second file and calculate the number of
__ occurrences. Then, add all those numbers to get a total value for
__ occurrences of elements in file A for file B.


FAQ



Abigail
-- 
perl -wlpe '}$_=$.;{' file  # Count the number of lines.


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

Date: Thu, 11 Feb 1999 15:42:03 -0500
From: Jay Rush <jrush@igic.com>
Subject: MySQL and moving within records
Message-Id: <36C3409B.A5BBAD8@igic.com>

Thanks for reading this..


I am using Perl and the Mysql.pm to access a Mysql db.  I have a set of
data returned back from a query, but here is where I am stuck.  I would
like to be able to jump around in the data by specifying the number of
records that I want to move, but I didn't see any such method in the
docs.

Any ideas?

Jay Rush
Developer
Internet Graphical Interface
jrush@igic.com


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

Date: 11 Feb 1999 20:16:04 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Need Perl Tcl/Tk for Linux
Message-Id: <79vdq4$h4h$7@client2.news.psi.net>

KC (dont@send.me.nothing) wrote on MCMLXXXVIII September MCMXCIII in
<URL:news:36C0C05A.D9664D5C@send.me.nothing>:
|| Where can I download the Perl Tcl/Tk module for linux. I found it once
|| but can't anymore.


CPAN



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


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

Date: Thu, 11 Feb 1999 19:37:37 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: newbie perl and cgi question.....
Message-Id: <36c32aea.413090@news.skynet.be>

Sam Holden wrote:

> I ended up reading your post, copying
>your code to another file, modifying that code, running perl, reading the
>documentation to see what was up, adding some prints to check that the my
>reading of the documentation was correct, and then typing a reply to your post
>and pasting some of the documentation in.

So now *you*'ve learned something as well.

;-)

	Bart.


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

Date: Thu, 11 Feb 1999 11:51:27 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Parenthetical Expressions
Message-Id: <MPG.112cd4973cc77416989a21@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <BVFw2.2181$rs2.2245583@client.news.psi.net> on Thu, 11 Feb 
1999 19:09:21 GMT, Skip Hollowell <thollowe@opentext.com> says...
> I have some data that I am parsing, and have come upon a unique situation.

Not really!

> I need to remove any parenthetical information from my data
> 
>      This is (a parenthetical expression) to be deleted
> would become
>      This is to be deleted
> 
> And for fun, there occasionally will be no right paren
> 
>      This is (a parenthetical expression
> would become
>      This is
> 
> Any ideas on where to start.  I know pattern matching and such, but I can't
> seem to get the
> wildcards for this to behave just quite right, and I haven't even thought of
> a safe way to do the
> second part.

   s/\(.*?(?:\)|$)//g

does what you want, except that there may be two spaces in a row where a 
phrase has been deleted.  You can deal with that as you wish.

As an exercise in pattern matching, this is quite simple -- it does what 
you said:

  s/\(       # Starting from each left parenthesis (/g modifier),
    .*?      #   eat up as few characters as possible
    (?:\)|$) #   until you hit a right parenthesis or the end,
   //gx      #   and get rid of it all

Instead of .*? one might use [^)]* but I don't know which is faster 
without benchmarking it.

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


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

Date: 11 Feb 1999 19:37:39 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Parenthetical Expressions
Message-Id: <79vbi3$l11$2@info.uah.edu>

In article <BVFw2.2181$rs2.2245583@client.news.psi.net>,
	"Skip Hollowell" <thollowe@opentext.com> writes:
:      This is (a parenthetical expression) to be deleted
: would become
:      This is to be deleted

    $text =~ s/\(.*?\)//g;

Just hope you don't have smileys in there. :-)

: And for fun, there occasionally will be no right paren
: 
:      This is (a parenthetical expression
: would become
:      This is
: 
: Any ideas on where to start.  I know pattern matching and such, but I
: can't seem to get the wildcards for this to behave just quite right,
: and I haven't even thought of a safe way to do the second part.

You didn't say when the deletion should terminate.  That would help.

Greg
-- 
Santa: Stan, remember the choo-choo when you were three?
Jesus: I died for your sins, boys, don't forget that..


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

Date: Thu, 11 Feb 1999 15:42:38 -0500
From: "Allan M. Due" <Allan@due.net>
Subject: Re: parseInt
Message-Id: <79vf02$huh$1@camel18.mindspring.com>

bababozorg@aol.com wrote in message <79v8bc$a28$1@nnrp1.dejanews.com>...
:hi
:there is a function in javascript:
:parseInt(number ,10)
:which give me a number less than "10" or any number i want!
:i am looking for the similar function in perl


perldoc -f rand
and if you need to convert to integers:
perldoc -f int
rounding?
see the FAQ and
perldoc -f sprintf

HTH

AmD




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

Date: 11 Feb 1999 14:57:21 -0500
From: Jay Glascoe <jglascoe@jay.giss.nasa.gov>
To: mduwjd@maersk.com
Subject: Re: perl5 release
Message-Id: <udd83gbtni.fsf@jay.giss.nasa.gov>

[courtesy cc of this posting sent to cited author]

mduwjd@maersk.com writes:

>  I know we are using perl version 5 but how do I find out what the release
> level is ?

on Unix, you simply type
$ perl -version

	Jay Glascoe
--  
ping.


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

Date: Thu, 11 Feb 1999 21:30:07 GMT
From: jloiacon@nastg.gsfc.nasa.gov (Joe Loiacono)
Subject: Solaris: panic: corrupt saved stack index, <try> chunk 1.
Message-Id: <36c34b45.112898259@news.gsfc.nasa.gov>

Recent 'make test' of Perl 5.004_04 on Solaris 2.5 fails:

/perl5.004_04/t: ./perl base/term.t
1..7
ok 1
ok 2
#3      :1: == :1:
ok 3
ok 4
ok 5
ok 6
ok 7
panic: corrupt saved stack index, <try> chunk 1.
panic: corrupt saved stack index, <try> chunk 1.
panic: corrupt saved stack index, <try> chunk 1.
panic: corrupt saved stack index, <try> chunk 1.
panic: corrupt saved stack index, <try> chunk 1.
panic: corrupt saved stack index, <try> chunk 1.
panic: corrupt saved stack index, <try> chunk 1.

Any ideas?

Thanks, Joe



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

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

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