[8134] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1752 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 28 15:17:40 1998

Date: Wed, 28 Jan 98 12:00:25 -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           Wed, 28 Jan 1998     Volume: 8 Number: 1752

Today's topics:
        -dates in perl- <James@cydaps.co.uk>
        5 REAL languages (was: Re: AOL SPAM) (Adam Turoff)
    Re: 5 REAL languages (was: Re: AOL SPAM) <ajohnson@gpu.srv.ualberta.ca>
    Re: Conversion to an array <barnett@houston.Geco-Prakla.slb.com>
    Re: Conversion to an array (Hasan Diwan)
    Re: FAQ too big (Was: Re: PERL forking) (Tad McClellan)
        Find ^M in file <dennis.kowalski@daytonoh.ncr.com>
    Re: Freidl's book mystery (Ilya Zakharevich)
        globbing probs via www (who)
    Re: HELP HELP HELP!!! - with function call parameters <alis@ssd.fsi.com>
        Help: h2ph and perl include files <etorres@mti.sgi.com>
    Re: help: open an existing page and replace parts of it (Earl Hood)
    Re: Looking for a really basic mailto/form script (Neil Briscoe)
        Perl ISAPI Build 315 for NT & Arguments john_helt@hp.com
    Re: Perl script reading in HTML POST Form info <barnett@houston.Geco-Prakla.slb.com>
        PGPLOT:  Can fonts be preserved in postscript output? (Brian Altheim)
        Problem With use <robert_sampleNOSPAM@mediaone.net>
    Re: READ THIS FIRST (Tad McClellan)
        Regexp substitution needed: Inserting commas into curre <chris@ixlabs.com>
    Re: Regexp substitution needed: Inserting commas into c <kmiles@erols.com>
    Re: Regexp substitution needed: Inserting commas into c <kmiles@erols.com>
        Repost of question re how to write information to a fil <dhoober@interserv.com>
    Re: Repost of question re how to write information to a (Earl Hood)
    Re: Searching using perl <jrj120@psu.edu>
        sed2perl conversion? (John Davidson Highfill)
        size limit to the length of a perl script cotal@delphi.com
    Re: size limit to the length of a perl script (Richard Bellavance)
    Re: Split (Zachary Brown)
    Re: Survival Of perl (Frank)
    Re: Survival Of perl <barnett@houston.Geco-Prakla.slb.com>
    Re: why no one ever reply? <r.goeggel@atos-group.de>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 28 Jan 1998 16:58:06 +0000
From: James <James@cydaps.co.uk>
Subject: -dates in perl-
Message-Id: <8nwcuGAeO2z0EwU5@cydaps.co.uk>


Hi,

I have managed to get a perl script to detect the date in a textfile
(written in seconds for ease instead of a normal format such as
31/01/98) and if the date is older than, or matches the date today then
it deletes the line in the text file. The problem that I have is that
each day an email is sent out to the user telling them about the latest
news regarding our services, but what I want to be able to do is to
place a line of text saying that their registration is due to expire on
the ....... (whatever date) in a clear format, not in seconds!

I can mange to do this for todays date, but how would I do it from a
variable containing a date in seconds, ie 886008059 (which would become
the 28/01/98)?

I have tried the following (as a guess of how to do it!)

($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = $date;

        $month = ($mon + 1);
        if ($mday < 10) {
                $mday = "0$mday";
        }
        if ($mon < 10) {
                $mon = "0$mon";
        }

        print "Your registration will expire on $mday/$month/$year\n\n";

but this does not work!!



TIA for any help with this.


James



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

Date: 28 Jan 1998 12:21:06 -0500
From: ziggy@panix.com (Adam Turoff)
Subject: 5 REAL languages (was: Re: AOL SPAM)
Message-Id: <6anpe2$lil@panix.com>

In article <34CF45C5.95E@min.net>, John Porter  <jdporter@min.net> wrote:
>[...]
>
>This also confirms my suspicion that there are in fact only five
>programming languages.  (As if C and Java have anything in common
>besides curly braces.)

I assume you mean (not necessarily in order):
	C/C++/Java, FORTRAN, Assembly Language, COBOL, Lithp/Scheme.

Where does perl fall into that list?

Z.



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

Date: Wed, 28 Jan 1998 11:48:14 -0600
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: 5 REAL languages (was: Re: AOL SPAM)
Message-Id: <34CF6F5E.1F75107C@gpu.srv.ualberta.ca>

Adam Turoff wrote:
!
! In article <34CF45C5.95E@min.net>, John Porter  <jdporter@min.net> wrote:
! >[...]
! >
! >This also confirms my suspicion that there are in fact only five
! >programming languages.  (As if C and Java have anything in common
! >besides curly braces.)
! 
! I assume you mean (not necessarily in order):
!         C/C++/Java, FORTRAN, Assembly Language, COBOL, Lithp/Scheme.
! 
! Where does perl fall into that list?

surely he must have meant:
    
    @programming_languages=(Perl1..Perl5);

:-)

regards
andrew


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

Date: Wed, 28 Jan 1998 08:39:00 -0600
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Re: Conversion to an array
Message-Id: <34CF4304.D05D4244@houston.Geco-Prakla.slb.com>

Kevin Tonkin wrote:
> 
> Can someone tell me if it is possible to convert the variables from a
> database file to an array?
> 
> Example:  Database stored in a text file like so...
> 
> Bob|24|blue|single
> Fred|32|green|married
> 
> If I wanted to put blue and green into an array, how would I achieve this?
> 
> Any help would be appreciated!
> Kevin
How about:
$file = "/what/ever/you/named/your/file/goes/here";
open (FILE, "$file) or die "cannot open: $!\n";
while (defined($line = <FILE>)) {
	($name,$age,$color,$status) = split(/|/, $line);
	push (@array, $color);
}

In your example, that should populate @array with blue and green, in
that order.  That what you had in mind?

HTH

Dave
-- 
"Security through obscurity is no security at all."
		-comp.lang.perl.misc newsgroup posting

------------------------------------------------------------------------
* Dave Barnett               U.S.: barnett@houston.Geco-Prakla.slb.com *
* DAPD Software Support Eng  U.K.: barnett@gatwick.Geco-Prakla.slb.com *
------------------------------------------------------------------------


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

Date: 28 Jan 1998 13:41:31 -0500
From: hdiwan@shell.clark.net (Hasan Diwan)
Subject: Re: Conversion to an array
Message-Id: <6anu4r$nd2@shell.clark.net>

Barring syntax errors, this foreach loop should do it:

foreach <FileVar> s/\n/ { # breakup records
    $line = $_; # assign line to dummy var
    @item = split($line,/|/);
    @results = $item[2];
}

"Kevin Tonkin" <kjt111@hotmail.com> writes:

>Can someone tell me if it is possible to convert the variables from a
>database file to an array?

>Example:  Database stored in a text file like so...

>Bob|24|blue|single
>Fred|32|green|married

>If I wanted to put blue and green into an array, how would I achieve this?

>Any help would be appreciated!
>Kevin
-- 
Hsiang Huang
University of California at Berkeley
Department of Electrical Engineering/Computer Science
hasandiwan@writeme.com


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

Date: Wed, 28 Jan 1998 09:58:50 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: FAQ too big (Was: Re: PERL forking)
Message-Id: <qjkna6.mn8.ln@localhost>

Bart Lateur (bart.mediamind@tornado.be) wrote:
: aml@world.std.com (Andrew M. Langmead) wrote:

: >Are you saying that many Windows users don't realize that there is any
: >way to search through text?

: Sortof. Make that "search though multiple text files".


But there does exist some way for them to do it?

Should the Win32 docs include how to do that on Windows?

Someone who uses Win32 want to file a bug report wherever you
do such things?


The docs are a powerful resource that Windows folk should be
able to use too.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Wed, 28 Jan 1998 14:03:26 -0500
From: Dennis Kowalski <dennis.kowalski@daytonoh.ncr.com>
Subject: Find ^M in file
Message-Id: <34CF80FE.79F7@daytonoh.ncr.com>

I have a file with "^M" in some records.
I think the ^M is a hex 0d

I am trying to drop the ^M and write out "".

I open the file in binmode and read it 1 byte at a time looking for a
double quote.

When I find it I start looking for another double quote or a hex 0d.

I am doing the following to determine if the byte is a hex 0d

$stat = read FILE, $byte, 1;
$wrk = sprint "%x",ord($byte);
if ($wrk == 13)
{
 xxxxx
}

I never get to the xxxx line.

Can anyone tell me why ????

NOTE:

I have also tried it with 10 instead of 13 
No luck there either

HELP


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

Date: 28 Jan 1998 17:20:51 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Freidl's book mystery
Message-Id: <6anpdj$r88$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to John Porter 
<jdporter@min.net>],
who wrote in article <34CF427D.70FE@min.net>:
> OTOH, it can be argued that *anything* written in C will faster than
> the equivalent in Perl, by orders of magnitude >=0.

Nonsense.  Do you have any idea what a simple expression like

	   $var = <>;

is doing in C?  Did you see the forest of #ifdefs to make it much
quickier that any "reasonably sane C"?

*Some* C may be quickier than internal Perl operations.  However,
these operations may have assembled man-years of coding to make them
what they are.  And since they are oneiric experiences, they may
combine beauty of implementation with ugliness of working around C
shortcomings.  It is probably impossible to reproduce the resulting
beauty/ugliness in any program not intended for such a wide use.

Ilya


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

Date: 28 Jan 1998 17:15:29 GMT
From: udta@rzstud1.rz.uni-karlsruhe.de (who)
Subject: globbing probs via www
Message-Id: <6anp3h$263$1@nz12.rz.uni-karlsruhe.de>

the following code works fine....
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<html><body>";
@a = <*>;
print "Halloooo\n";

foreach $produktdatei (@a) {
 print "Pruduktdatei: $produktdatei\n";
} #eo foreach

print "</body></html>";

via telnet .....but if i call the code via www (maybe within a html-page)
i get no output (@a is empty)..
does someone know, what4s wrong ?



--
MfG Tobias Poppe - Informatik HQ Karlsruhe
  *** eMail udta@rz.uni-karlsruhe.de ***
          ** sysop@hmc-bbs.org **


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

Date: 28 Jan 1998 18:38:54 GMT
From: "alis" <alis@ssd.fsi.com>
Subject: Re: HELP HELP HELP!!! - with function call parameters
Message-Id: <01bd2c1b$47e63410$a8fbbdce@alis-pc>



Bhanu P. Suravarapu <bhanu@usl.edu> wrote in article
<34CDC784.41C67EA6@usl.edu>...
> Hi,
> 
> I am using perl5.003.
> 
> In my perl script I have something like
> 
> open(somefile1....);
> print somefile1 $nodenumber;
> $response = &travlink($node);
> open(somefile....);
> print somefile2 $nodenumber;
> ...
> 
> I have the above code in a loop where $nodenumber takes values 1..9
> My function is something like this:
> sub travlink
> {
> open(somefile....);
> print somefile3 $_[0];
> 
> 1;
> }
> 
> 
> Now my problem is somefile1 and somefile2 have values 1..9
> BUT somefile3 has only few values 2,6,8 (say).
> 
> So my function is not being called sometimes I donot know
> why this is happening.
> 
> i have spent a lot of time to figure out the existance of this problem.
> 
> PLEASE HELP ME.
> 
> bhanu.
> bhanu@usl.edu
> 

Here's how I would write the subroutine:

sub travlink
{
  local ($lnode)=@_;
  open(somefile....);     I am assuming this is somefile3. right?
  print somefile3 $lnode;
}

Even better, would be if you pass the file handle to your subroutine like:

sub travlink
{
  local (*Fn,$lnode)=@_;
  print FN $lnode;
}

So you could open somefile3 in the body of the code then pass it to the
subroutine.
You would pass it like this:

$response = &travlink(*somefile3,$node);

Good luck!




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

Date: Wed, 28 Jan 1998 11:40:26 -0800
From: Edgar Torres-Silva <etorres@mti.sgi.com>
Subject: Help: h2ph and perl include files
Message-Id: <34CF89A9.4E6D8E85@mti.sgi.com>

Hi!
SHORT VERSION:
	What is the correct stddefs.ph equivalent of the following expression
that occurs in my stddefs.h file??

#define offsetof(t, memb) ((size_t)__INTADDR__(&(((t *)0)->memb)))

I get the following from h2ph:

	eval 'sub offsetof {
	    local($t, $memb) = @_;
	    eval "(( &size_t) &__INTADDR__(((($t *)0)->$memb)))";
	}' unless defined(&offsetof);

BUT Perl does not like the (((($t *)0)->$memb)) stuff.

LONG VERSION:
	I am trying to make a daemon in Perl (5.004_04).
>From the FAQ:perlfaq8
How do I fork a daemon process?
If by daemon process you mean one that's detached (disassociated from
its tty), then the following process is reported to work on most Unixish
systems.
Non-Unix users should check their Your_OS::Process module for other
solutions. 
     Open /dev/tty and use the the TIOCNOTTY ioctl on it. See tty(4) for
details. 
     Change directory to / 
     Reopen STDIN, STDOUT, and STDERR so they're not connected to the
old tty. 
     Background yourself like this: 
         fork && exit;

After realizing I need to 'use "ioctl.ph";' and that I needed to do h2ph
to get ioctl.ph, I saw that the conversion has some faults:
1. The expr subroutine in h2ph wrongly translates a && logical operator
to a & bitwise operator. I was able to fix this by changing the second
line within expr to (it was missing the '(\w|\()' and the '$1' parts:
	s/^\&(\w|\()/$1/;  # hack for things that take the address of

2. Some of the include files on my platform, SGI IRIX 6.4, use stuff
like: (the one below is from stddefs.h)
  #define offsetof(t, memb) ((size_t)__INTADDR__(&(((t *)0)->memb)))

What is the expected or correct translation for the above statement??

Thanks,
Edgar
-- 
Edgar L. Torres-Silva <etorres@mti.sgi.com> 
Silicon Graphics Computer Systems


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

Date: 28 Jan 1998 19:22:15 GMT
From: ehood@medusa.acs.uci.edu (Earl Hood)
Subject: Re: help: open an existing page and replace parts of it
Message-Id: <6ao0h7$bar@news.service.uci.edu>

In article <#E3#WgcK9GA.59@upnetnews03>,
Ilia Lobsanov <ilia@detoronics.net> wrote:
>Hello, I'm a beginner in Perl, and was wondering if there is an easy way to
>open an existing html page, replace specific parts of it, and return the new
>page to client.

You can try
<URL:http://www.perl.com/CPAN/authors/id/EHOOD/Text-Bind-0.01.tar.gz>.

There is also a Text::Template module at CPAN which may do what you
want.

	--ewh
-- 
             Earl Hood              | University of California: Irvine
      ehood@medusa.acs.uci.edu      |      Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME


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

Date: 28 Jan 1998 17:56:04 GMT
From: neilb@zetnet.co.uk (Neil Briscoe)
Subject: Re: Looking for a really basic mailto/form script
Message-Id: <memo.19980128175606.27721B@skep.compulink.co.uk.cix.co.uk>

In article <6amjb7$2e5@lincoln.gsat.edu.au>,
chamber@gsat.edu.au (Robert Tobin) wrote:

> I am looking for a basic form/mailto script
>
> can anyone help?
>

The script form2mail.pl is in the public domain and available
from http://hoohoo.ncsa.uiuc.edu - or was when I obtained it
three plus years ago.

Regards
Neil



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

Date: Wed, 28 Jan 1998 12:21:11 -0600
From: john_helt@hp.com
Subject: Perl ISAPI Build 315 for NT & Arguments
Message-Id: <886011154.1530331146@dejanews.com>

I am trying to use perl ISAPI & perl for win32 as to process CGI
information with IIS3.0.

But, for some reason, arguments are not being passed through.

For example, the following script:

      #!/usr/bin/perl

      print "Content-type: text/html\n\n";
      print "Argument= $ARGV[0]\n";

When launched from a web browser useing the command:

      http://computername.com/cgi-bin/test.pl?hello

Only returns:

      Argument=

Any suggestions??

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Wed, 28 Jan 1998 08:27:10 -0600
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Re: Perl script reading in HTML POST Form info
Message-Id: <34CF403E.244D01E6@houston.Geco-Prakla.slb.com>

mgeorgeadis@fallschurch.esys.com wrote:
> 
> Let me get right to the point. I'm constructing web pages using perl
> scripts, which parse the info submitted from the previous form. However,
> a security problem has arisen which added an additional password field
> to the login page. Submission of the form info causes the fields and
> values to appear in the URL. I know that the METHOD=POST option of
> FORM in HTML solves this problem, but I'm not sure how to access the
> info passed to the next perl script.( The GET Method passes the info
> into the QUERY_STRING variable. The scripts now access and parse
> out the info from QUERY_STRING.) Any ideas? Thanks.
> 
> -MG
Go to http://www.perl.com and follow the CPAN link.

Look for CGI.pm.  It makes the entire process rather painless, and the
documentation in the module is sufficient to get started using it right
away.

HTH.

-- 
"Security through obscurity is no security at all."
		-comp.lang.perl.misc newsgroup posting

------------------------------------------------------------------------
* Dave Barnett               U.S.: barnett@houston.Geco-Prakla.slb.com *
* DAPD Software Support Eng  U.K.: barnett@gatwick.Geco-Prakla.slb.com *
------------------------------------------------------------------------


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

Date: 28 Jan 1998 16:29:37 GMT
From: altheim@agc.bio.ns.ca (Brian Altheim)
Subject: PGPLOT:  Can fonts be preserved in postscript output?
Message-Id: <6anmdh$57u1@sapphire.mtt.net>

Hi all...

I've run into a small problem using pgplot.  After my happy little program
is done running, I output the files into .ps format, so I can transform
them into usable .ai files using ghostscript's ps2ai utility.  The problem
is that the text produced by pgplot's .ps exporter is not exported as text,
but as crafted points in the postscript files.  Is there some command in
the pgplot module that I'm missing with which I could export files with
proper fonts?  Or am I stuck with pseudo-text in all of my .ps files?

Any insight into this problem would be much appreciated.  I must say that
this is the only problem I'm having with pgplot...the power of this module
really blows me away (I'm tempted to never use Matlab again :-).

Brian


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

Date: Wed, 28 Jan 1998 13:43:36 -0500
From: "Robert Sample" <robert_sampleNOSPAM@mediaone.net>
Subject: Problem With use
Message-Id: <6anua2$q13$1@wbnws01.ne.highway1.com>

Hi Folks,

I am using:

This is perl, version 5.003_07

Copyright 1987-1996, Larry Wall

        + suidperl security patch
        Win32 port Copyright (c) 1995-1996 Microsoft Corporation.
                All rights reserved.
        Developed by ActiveWare Internet Corp., http://www.ActiveWare.com

Perl for Win32 Build 315 - Built 09:33:08 Dec 31 1997

I am running Perl 5.003_07 on Windows NT 4.0/SP3.

I have created two simple scripts both of which use "use".  The first one
is:

# Test using Perl Module

use Cwd;
$curDir = getcwd();
print "Current directory = $curDir\n";

and the second one is:

# Get the Lotus 1-2-3 required Registry values

use Win32::Registry;

$HKEY_LOCAL_MACHINE->Open($LotusObj, "\SOFTWARE\Lotus\123\98.0") || die $!;
$LotusObj->QueryValues($Path, "Path");
print "$Path\n";
$LotusObj->QueryValues($Name, "Name");
print "$Name\n"

The problem is this message:
Can't locate Win32/Registry.pm in @INC at LotusReg.pl line 3.
BEGIN failed--compilation aborted at LotusReg.pl line 3.

or for the first script:

Can't locate Cwd.pm in @INC at TestModule.pl line 3.
BEGIN failed--compilation aborted at TestModule.pl line 3.

I have \Perl5\Lib on my path as well as \Perl5.  Is there something I am
missing here?

TIA...Robert







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

Date: Wed, 28 Jan 1998 10:03:54 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: READ THIS FIRST
Message-Id: <atkna6.mn8.ln@localhost>

John Porter (jdporter@min.net) wrote:
: ENROLD wrote:
: >     Programmer's Report 1998. For all JAVA, C++, C programmers ONLY.
: >     EXCLUSIVE 1998 report by Applications & Programming Cap-Division,
: >      NOTE:Not for Eiffel or Ada programmers. For Java, C++, & C
: >      programmers only.  Send $1.00:

: Damn.  As an ADA programmer, I was thinking this report might be
: useful for me. I won't send for it, because I'm afraid they would
: check up on me, to make sure I'm a card-carrying C++ programmer.

: This also confirms my suspicion that there are in fact only five
: programming languages.  (As if C and Java have anything in common
: besides curly braces.)


And whatever it is that they are selling only works in three of them.


They're just trying to qualify their sales leads.


Damn spammers.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Wed, 28 Jan 1998 10:59:24 -0800
From: Chris Schoenfeld <chris@ixlabs.com>
Subject: Regexp substitution needed: Inserting commas into currency value
Message-Id: <34CF800C.F59@ixlabs.com>

I need to insert the appropriate commas (if needed) into a currency
string of the format:

$\d+\.\d\d

Examples:

$0.99
$1.12
$23000.00
$2345890984587834.34

I'm willing to use something less slick than a one-line s// as long as
it's robust.

Thanks!
Chris


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

Date: Wed, 28 Jan 1998 14:20:21 -0500
From: Kevin Miles <kmiles@erols.com>
Subject: Re: Regexp substitution needed: Inserting commas into currency value
Message-Id: <34CF84F5.784D@erols.com>

Chris Schoenfeld wrote:
> 
> I need to insert the appropriate commas (if needed) into a currency
> string of the format:
> 
> $\d+\.\d\d
> 
> Examples:
> 
> $0.99
> $1.12
> $23000.00
> $2345890984587834.34
> 
> I'm willing to use something less slick than a one-line s// as long as
> it's robust.
> 
> Thanks!
> Chris
Try this, I think this is in one of the perl FAQ's

1 while $_ =~ s/($?[-+]?\d+)(\d{3})/$1,$2/;


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

Date: Wed, 28 Jan 1998 14:29:04 -0500
From: Kevin Miles <kmiles@erols.com>
Subject: Re: Regexp substitution needed: Inserting commas into currency value
Message-Id: <34CF8700.707A@erols.com>

Kevin Miles wrote:
> 
> Chris Schoenfeld wrote:
> >
> > I need to insert the appropriate commas (if needed) into a currency
> > string of the format:
> >
> > $\d+\.\d\d
> >
> > Examples:
> >
> > $0.99
> > $1.12
> > $23000.00
> > $2345890984587834.34
> >
> > I'm willing to use something less slick than a one-line s// as long as
> > it's robust.
> >
> > Thanks!
> > Chris
> Try this, I think this is in one of the perl FAQ's
> 
> 1 while $_ =~ s/($?[-+]?\d+)(\d{3})/$1,$2/;

SORRY, forgot to escape the $

correction:

1 while $_ =~ s/(\$?[-+]?\d+)(\d{3})/$1,$2/;


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

Date: Mon, 26 Jan 1998 12:14:43 -0800
From: "DianaH" <dhoober@interserv.com>
Subject: Repost of question re how to write information to a file.
Message-Id: <6aiqrb$spi$1@lal.interserv.com>

I have checked the resources mentioned in the message new postees receive
and cannot identify an answer to the situation described below.  If this is
to advanced a question for this posting area, please let me know.

I am new to perl scripting but have been creating internal pages using html,
perl and cgi scripts for about 5 months now so I do understand a little.  I
have a project which requires placing information from an internal web page
into another web page.  Normally, to place information in the destination
page it is necessary to login in using passwords and identification, then a
form is filled out and the information is placed on the external web page.
Both pages are on the same server.  Is this an instance where the open
command would be used to pass info and if so, is it necessary to write any
sort of subroutine to take care of the password entry to the destination
page?





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

Date: 28 Jan 1998 19:16:10 GMT
From: ehood@medusa.acs.uci.edu (Earl Hood)
Subject: Re: Repost of question re how to write information to a file.
Message-Id: <6ao05q$b2h@news.service.uci.edu>

In article <6aiqrb$spi$1@lal.interserv.com>,
DianaH <dhoober@interserv.com> wrote:
 ...
>have a project which requires placing information from an internal web page
>into another web page.  Normally, to place information in the destination
>page it is necessary to login in using passwords and identification, then a
>form is filled out and the information is placed on the external web page.
>Both pages are on the same server.  Is this an instance where the open
>command would be used to pass info and if so, is it necessary to write any
>sort of subroutine to take care of the password entry to the destination
>page?

Password stuff should be handled by the server and not concern for you
unless you are not relying on HTTP authentication schemes.  As for
copying the data from internal to the external, since the pages are on
the same server, basic Perl file I/O can be used.

	--ewh
-- 
             Earl Hood              | University of California: Irvine
      ehood@medusa.acs.uci.edu      |      Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME


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

Date: Mon, 26 Jan 1998 19:04:37 +0000
From: James Juran <jrj120@psu.edu>
To: Kevin Tonkin <kjt111@hotmail.com>
Subject: Re: Searching using perl
Message-Id: <34CCDE45.29AD58D6@psu.edu>

Kevin Tonkin wrote:

> How do I go about using perl to search a database file which is arranged
> like so:
> var1|var2|var3 etc ?
> 
> If I want to search the first variable, for example, how would I do this?

I'm using look.pl, which is included with the standard Perl
distribution.  It does a binary search of a file based on the beginning
of the line.  I'm using the following snippet of code to position the
file pointer at the beginning of the line containing the key I'm looking
for:  

    # Put the file pointer at the beginning of the row >= the
    # key we're looking for.
    look(*DATABASE, $key, 0, 1);

>From the look.pl source:

;# Usage: &look(*FILEHANDLE,$key,$dict,$fold)

;# Sets file position in FILEHANDLE to be first line greater than or
equal
;# (stringwise) to $key.  Pass flags for dictionary order and case
folding.

HTH,

--
James Juran
jrj120@psu.edu


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

Date: 28 Jan 1998 18:35:11 GMT
From: davidson@unity.ncsu.edu (John Davidson Highfill)
Subject: sed2perl conversion?
Message-Id: <6antov$aca$1@uni00nw.unity.ncsu.edu>

Hi, i am trying to learn perl and know a bit about sed (more than i
know about perl) and heard that there is a sed2perl sc utility out
there but i have had little sucess finding it.  anyone out know wher
i can find it?

thanks.

			-Davidson

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
	NAME: Davidson Highfill		POSITION: Student Extrodinare
      E-MAIL: davidson@unity.ncsu.edu  or  nature_boy@earthling.net 
         "The last bug isn't fixed until the last user is dead..."
When mailing me don't forget to take the 1st "n" out of my email address
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


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

Date: Wed, 28 Jan 1998 12:11:52 -0600
From: cotal@delphi.com
Subject: size limit to the length of a perl script
Message-Id: <886009786.1510866945@dejanews.com>

Is there a size limit to the length of a perl script running as a cgi?

My script is about 1500 lines, across 3 different files.

It fails to run if I add another line or another subroutine.

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: 28 Jan 1998 13:40:30 -0500
From: charlot@CAM.ORG (Richard Bellavance)
Subject: Re: size limit to the length of a perl script
Message-Id: <6anu2u$rk3@stratus.CAM.ORG>

In article <886009786.1510866945@dejanews.com>,  <cotal@delphi.com> wrote:
>Is there a size limit to the length of a perl script running as a cgi?
>

I don't believe there's a limit on the size of a Perl program.  The fact that
it is a CGI changes nothing from the Perl interpreter's point of vue.

>My script is about 1500 lines, across 3 different files.
>
>It fails to run if I add another line or another subroutine.
>

What is the error message ?  Does it come from the Perl interpreter, the
HTTP server, or the operating system ?

It *might* be a Perl problem (although I highly doubt it), but you haven't
given enough information to really say.  If you get an error from Perl,
repost it here with information about which version of Perl you're using,
and on which platform, and we'll be able to help you better.

On the other hand, if the error seems to be from the Web server or the OS,
you'll get better answers in the newsgroups or FAQs that discuss them.

Hope this helps,
Richard.
-- 
Richard Bellavance -- charlot@cam.org -- http://www.cam.org/~charlot/
    "All along this path I tread  /  My heart betrays my weary head
     With nothing but my love to save / From the cradle to the grave"
                                 (Eric Clapton, "From the cradle")


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

Date: 28 Jan 1998 11:58:15 -0500
From: zbrown@lynx01.dac.neu.edu (Zachary Brown)
Subject: Re: Split
Message-Id: <6ano37$pie@lynx01.dac.neu.edu>

In article <34CF4B52.B2FA28C1@jen.co.il>,
Moshe Aaron Allen  <moshea@jen.co.il> wrote:
>Hi,
> I'm need to split() a pararaph after every five words. Can anyone help?

$paragraph =~ s/(\s.*?\s.*?\s.*?\s.*?\s.*?)/$1\n\n/g;

Zack

>MA
>




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

Date: Wed, 28 Jan 1998 18:04:02 GMT
From: FHeasley@chemistry.com (Frank)
Subject: Re: Survival Of perl
Message-Id: <34cf6ea3.9498732@news.halcyon.com>

The Future of The Web

Scene opens on a dingy apartment in a dingy city somewhere in the
world.  Doesn't matter where, except that it would probably be
considered typically American.

A lone figure sits in his underwear in front of a television screen on
a slightly soiled and ragged sofa, remote control in one hand, can 'o
beer in the other.

Joe Sixpack has been thinking to himself for some time about putting
up one of those fancy virtual reality internet pages, but hasn't had
the energy to do it for awhile.  But, tonight's the night!

A few clumsy strokes of the remote control set up the opening scenes,
previously gathered from countless excursions across the net.  A few
more enter the attributes of the characters and their surroundings and
access the programs that control them.  Joe enters the final touches
to the login screen, with the appropriate places for users to enter
their payment information, and sits back to admire his work.

Joe doesn't expect much from his effort - there are countless millions
of other pages out there with similar content, and ten times more in
every conceivable permutation of humanity's thoughts.   But maybe,
just maybe, his will be one of the lucky ones to earn more than it
costs.

As the first few "hits" start to roll in, Joe finishes his beer,
switches off the set and prepares to fall asleep on the sofa.

Joe doesn't know it, but he's just finished using the efforts of
countless thousands of programmers who strove to make programming
simpler and simpler, to the point that anyone with a TV and a remote
control, and a 5th grad education, could set up complex systems on the
internet.  Maybe the language they ultimately settled on was perl.
Maybe it was something else.

<obvious>
1.  It takes complexity to make technology simple to use.
2. Technology always gets easier to use. (Natural selection).
3. 1 + 2 = "progress"
</obvious>

God help us all.

Frank



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

Date: Wed, 28 Jan 1998 08:19:37 -0600
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Re: Survival Of perl
Message-Id: <34CF3E79.DA862A7E@houston.Geco-Prakla.slb.com>

Tad McClellan wrote:
> 
> Jason Christian (jason@primal.ucdavis.edu) wrote:
> 
<snip>

> : reading the faq,
> 
> There are thousands of Perl programmers. Each and every one of
> them was new at some point. Trying to learn Perl.
> 
> Just like today's new Perl programmers.
> 
> Don't these new users think that their particular question might
> just maybe have been asked by 20-10,000 of the people who have
> walked that road previously?
<snip>
> 2) Get the answer from the FAQ
> 
>    Get answer in ten minutes at the most, even with an Operating
>    System that is not very helpful in your operating of the system.
> 
>    Get an answer that has been examined by _thousands_ of other
>    people. Some of them the very people who wrote the language
>    interpreter that you are trying to learn how to use.
> 
> Hmmm. Which should they chose?   ;-)
> 
Over the past several months, I've been working on becoming proficient
at programming in Perl.  I have personally seen my skill level improve. 
I recently reviewed a script I wrote when I originally starting writing
in Perl, and found several bugs, and other somewhat stupid things I had
done.

In the process of learning Perl, I've asked several questions here, some
of which is covered in the Blue Camel, but was unclear to me.  The FAQ
is a good source of information, but I find it cumbersome to find
information in.

Do I use perldoc -f function?  Do I use perldoc module name?  Which one
of the 9 perlfaq's should I start with?

I'm more than willing to read something that makes sense and answers my
question(s), but I find it terribly difficult sometimes to find what I
need in the FAQ.  Maybe this is just me, but there was a recent post
regarding the same type of thing.  There has to be a better way, but I'm
not sure what it is.  An SQL type interface maybe?  or some other means
to 'easily' locate a relevant topic?

Anyway.  My US$0.02.

<snip>
> : stick around, quietly perhaps, and come back, and become decent and
> : confident users of their computers and this wonderful language, then
> : there is something you (plural!) can do:  edit the venom from the
> : flames, offer politely (as many of you do) the suggestion to go to a
> : more appropriate newsgroup, perhaps even ship off the canned discussion
> : of where the boundary lies between a CGI question and a perl question.
> : If instead you wish there to be a Sacred Priesthood of Perl, to which
> : None but the Brilliant May Aspire, then by all means set the
> : flamethrowers on Scorch.
>
I've found that lurking here, and reading the other posted responses
(and responding to the simpler ones) has helped me out quite a bit along
the way in my endeavor to learn Perl.  Thanks to all who have assisted. 
:-)
 
<snip>

Dave
-- 
"Security through obscurity is no security at all."
		-comp.lang.perl.misc newsgroup posting

------------------------------------------------------------------------
* Dave Barnett               U.S.: barnett@houston.Geco-Prakla.slb.com *
* DAPD Software Support Eng  U.K.: barnett@gatwick.Geco-Prakla.slb.com *
------------------------------------------------------------------------


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

Date: Wed, 28 Jan 1998 18:36:45 +0100
From: "Ronald G\"oggel" <r.goeggel@atos-group.de>
Subject: Re: why no one ever reply?
Message-Id: <6anqf4$pit$1@news.pop-stuttgart.de>


angyny@interport.net schrieb in Nachricht <34CE67DF.68FB@interport.net>...
>I've posted several times but never get anyone reply.
<snipped>

what about giving a hint in the subject ;-)




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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.  

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

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