[11117] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4717 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 22 01:06:18 1999

Date: Thu, 21 Jan 99 22:00:19 -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, 21 Jan 1999     Volume: 8 Number: 4717

Today's topics:
    Re: CGI/Perl: passing information to SSI? <jamesht@idt.net>
        Converting String to Integer... <marvs@portalinc.com>
    Re: Converting String to Integer... <rick.delaney@home.com>
    Re: Converting String to Integer... <m_ching@hotmail.com>
    Re: Converting String to Integer... <m_ching@hotmail.com>
    Re: Converting String to Integer... <rick.delaney@home.com>
    Re: dereference entire array of array references (Randal L. Schwartz)
    Re: File Upload. horng@earthlink.net
    Re: Help with RE for separate Perl codes and comments <dgris@moiraine.dimensional.com>
    Re: Help with RE for separate Perl codes and comments (Matthew Bafford)
    Re: Help with RE for separate Perl codes and comments (Tad McClellan)
    Re: How do I define a scalar name with a scalar (Tad McClellan)
    Re: locking file for updating <jdf@pobox.com>
    Re: Looking for free Web Server with CGI <m_ching@hotmail.com>
        Newbie - Whats wrong with this script? <targa@cornhusker.net>
    Re: open() "bad file number" help! (Tad McClellan)
    Re: PERL Security Issues (Tad McClellan)
    Re: Perl5.00502 and @INC <partha@mihy.mot.com>
    Re: Perl5.00502 and @INC <jamesht@idt.net>
    Re: PROOF: Jesus is NOT LORD of the Sabbath!         ,: <Jesusisaphonygod@getreal.net>
    Re: PROOF: Jesus is NOT LORD of the Sabbath!         ,: <Jesusisaphonygod@getreal.net>
    Re: PROOF: Jesus is NOT LORD of the Sabbath!         ,: <Jesusisaphonygod@getreal.net>
    Re: PROOF: Jesus is NOT LORD of the Sabbath!         ,: <Jesusisaphonygod@getreal.net>
    Re: PROOF: Jesus is NOT LORD of the Sabbath!         ,: <Jesusisaphonygod@getreal.net>
    Re: PROOF: Jesus is NOT LORD of the Sabbath!         ,: <Jesusisaphonygod@getreal.net>
    Re: Random Invoice # (Tad McClellan)
    Re: Reading a log file from an HTML Page (Tad McClellan)
    Re: Return a blank form <jamesht@idt.net>
    Re: Simple CGI with Perl <m_ching@hotmail.com>
        SWIG with ActiveState? <beisner@acm.org>
    Re: Trying to work with a text database <jamesht@idt.net>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Thu, 21 Jan 1999 23:57:24 -0500
From: jamesht <jamesht@idt.net>
To: "M. Morgan" <mmorgan@gladstone.uoregon.edu>
Subject: Re: CGI/Perl: passing information to SSI?
Message-Id: <36A80533.6C0E516A@idt.net>

Hello,

This is really not so much a perl question as a CGI (SSI) question. You should
try comp.infosystems.www.authoring.cgi

It's easy enough if you want to return the info from a script instead of an
ssi...

hth,

James



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

Date: Fri, 22 Jan 1999 11:34:35 +0800
From: Marvin Lim <marvs@portalinc.com>
Subject: Converting String to Integer...
Message-Id: <36A7F1C0.C1FF4C53@portalinc.com>

  Hi.. I just wanna know.. How will i convert a string character "45" to
an integer 45 ??

cause i need it to be in my computation..

thanx... I will be thankful for any replies..

James



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

Date: Fri, 22 Jan 1999 03:28:32 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Converting String to Integer...
Message-Id: <36A7F234.239BCAB1@home.com>

[posted & mailed]

Marvin Lim wrote:
> 
>   Hi.. I just wanna know.. How will i convert a string character "45" 
> to an integer 45 ??
> 
> cause i need it to be in my computation..

print "45" - 3;

-- 
Rick Delaney
rick.delaney@shaw.wave.ca


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

Date: Thu, 21 Jan 1999 05:33:15 -1000
From: "Michael Ching" <m_ching@hotmail.com>
Subject: Re: Converting String to Integer...
Message-Id: <36a7d645.0@news.hawaii.rr.com>

read up on scalars, you can just use it as a number

$scalar = "45";
print $scalar + 5;


Marvin Lim wrote in message <36A7F1C0.C1FF4C53@portalinc.com>...
>  Hi.. I just wanna know.. How will i convert a string character "45" to
>an integer 45 ??
>
>cause i need it to be in my computation..
>
>thanx... I will be thankful for any replies..
>
>James
>




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

Date: Thu, 21 Jan 1999 05:56:40 -1000
From: "Michael Ching" <m_ching@hotmail.com>
Subject: Re: Converting String to Integer...
Message-Id: <36a7dbc3.0@news.hawaii.rr.com>

oops.
misread. thought he already had a scalar.

then again.. string character?  does he mean he has a character with ascii
value of 45?

Rick Delaney wrote in message <36A7F234.239BCAB1@home.com>...
>[posted & mailed]
>
>Marvin Lim wrote:
>>
>>   Hi.. I just wanna know.. How will i convert a string character "45"
>> to an integer 45 ??
>>
>> cause i need it to be in my computation..
>
>print "45" - 3;
>
>--
>Rick Delaney
>rick.delaney@shaw.wave.ca




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

Date: Fri, 22 Jan 1999 04:45:37 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Converting String to Integer...
Message-Id: <36A80434.EDF5E879@home.com>

[posted & mailed]

Michael Ching wrote:
> 
> oops.
> misread. thought he already had a scalar.

Not sure what you mean.

42;         # this is a scalar
'42';       # this is a scalar
$foo;       # this is a scalar
$foo[42];   # this is a scalar
$foo{'42'}; # this is a scalar
            # the list goes on...

I see very little difference between our posts, except that yours is the
answer to his question, and mine is the answer to everything.  ;-)

> then again.. string character?  does he mean he has a character with 
> ascii value of 45?

I guess.  The point is that perl will treat a number represented as a
string and a bare number the way you want in arithmetic calculations.

See the section 'Scalar values' in perldata.

-- 
Rick Delaney
rick.delaney@shaw.wave.ca


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

Date: 21 Jan 1999 19:50:34 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: dereference entire array of array references
Message-Id: <m1btjsm0dx.fsf@halfdome.holdit.com>

>>>>> "Tad" == Tad McClellan <tadmc@metronet.com> writes:

Tad>    This is comp.lang.perl.misc.

Tad>    rec.humor.funny is somewhere else.

ooops.

:-)

-- 
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: Fri, 22 Jan 1999 04:40:54 GMT
From: horng@earthlink.net
Subject: Re: File Upload.
Message-Id: <788vgl$v25$1@nnrp1.dejanews.com>

I have a similar question.  I need to upload files using the web browser.  The
input type for the HTML form is "file" so that i can browse the local file
lists.  The question is, how can I transfer files from client side to the
server?  By using ftp.pl package??  I appreciate any help.

Felix


In article <36A6ED92.7EC03B43@khayal.com>,
  Ghulam Hussein Kara <ghulam@khayal.com> wrote:
> Assuming that your file input variable is "cv" , the following should
> suffice :
>
> #-------Beginning Code----------
>
> #!/usr/bin/perl
> require "cgi-lib.pl";
> &ReadParse;
> open (F, ">uploaded.dat");
> print F "$in{'cv'}\n";
> close (F);
>
> #-------End of Code-------------
> Note : You can name the new file  to whatever you want instead of
> "uploaded.dat" depending on type.e.g "wordfile.doc"
>
> piece of cake, huh?
>
> Alex Blyumenkrants wrote:
>
> > Hi!
> >
> > I have the following problem:
> >
> > i need to upload a file from an Html,
> > if i use type="file"
> > what should i do to save this file in my Cgi?
> >
> > Thank You,
> > Alex
>
>

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


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

Date: 21 Jan 1999 20:21:38 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Help with RE for separate Perl codes and comments
Message-Id: <m33e54hu0t.fsf@moiraine.dimensional.com>

Ala Qumsieh <aqumsieh@matrox.com> writes:

<snip trying to match comments in perl code>

> $script =~ s/\#.*\n//g;

$array [$#array] = qq;apparently, i'm a comment\n;;

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


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

Date: Fri, 22 Jan 1999 04:17:25 GMT
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: Help with RE for separate Perl codes and comments
Message-Id: <slrn7afuod.1a4.dragons@Server.Network>

On 21 Jan 1999 20:21:38 -0700,
in article <<m33e54hu0t.fsf@moiraine.dimensional.com>>,
Daniel Grisinger <dgris@moiraine.dimensional.com> wrote:
=> Ala Qumsieh <aqumsieh@matrox.com> writes:
=> 
=> <snip trying to match comments in perl code>
=> 
=> > $script =~ s/\#.*\n//g;
=> 
=> $array [$#array] = qq;apparently, i'm a comment\n;;

The syntax file included with vim does it by only matching comments
that follow a space.

That passes your example, but still fails on:

$var = qw#
			Foo
		 #; print "I'm a comment!";

It also matches comments inside REs/pod, but if you've got comments in an
re, why not match 'em? :-)

If you wanted to be as close as possible (using a re), you could match a
# only if it doesn't follow tr, y, s, m, qq, q, qx, qw (I think I may have
missed some), or a $ sign (I'm SURE I missed one (or more)).  That would still
count my above snippet as having a comment, though.

=> dgris

--Matthew

-- 
Not to mention there are better ways of doing your example.
:-)


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

Date: Thu, 21 Jan 1999 22:34:20 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Help with RE for separate Perl codes and comments
Message-Id: <c4v887.kpv.ln@magna.metronet.com>

Ala Qumsieh (aqumsieh@matrox.com) wrote:

: Jerry Chen <016781c@acadiau.ca> writes:

: > I have some difficulties to parse Perl code to identify
: > the source part and comment part using
: > regular expression.  From searching the Dejanews archive,
: > I know that it is difficult to separate codes with comments.

: Comments in Perl start with a '#' until the end of the line. There is
: no other way for comments in Perl (except if you use pod constructs,
: but those aren't "comments").


   There are other uses for # though...

      s#</a>##;  # so long anchor end tags...


: > However, I do not need to be 100% accurate.  Something close
: > will be ok.

: I wonder why!!!
: But anyway, the following should work ..

: $script =~ s/\#.*\n//g;


   That leaves the single character 's' for the example line above.


   Jerry heard right. It is difficult.


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


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

Date: Thu, 21 Jan 1999 22:58:08 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: How do I define a scalar name with a scalar
Message-Id: <0h0987.kpv.ln@magna.metronet.com>

Matt Johnson (cpuweb@cpuweb.com) wrote:
: In my program I am wanting to use a scalar as part of the name for another
: scalar.


   You want "Symbolic references". See 'perlref.pod'.

   (but you shouldn't really want them. There is nearly always
    a better way to get what you want with modern perls.
   )


: Here is an example of what I am trying to acomplish, and what I would like
: for the output.

: $scalar1 = 1;
: $special1 = "Have a nice day";
: print $special$scalar1;


   print ${"special$scalar1"};


: What I want it to print "Have a nice day"

   # better way without symbolic references:
   $scalar1 = 1;
   $special[1] = "Have a nice day";
   print $special[$scalar1];


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


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

Date: 22 Jan 1999 04:25:36 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: miko@idocs.com
Subject: Re: locking file for updating
Message-Id: <m367a00z0v.fsf@joshua.panix.com>

miko@idocs.com writes:

> So what I need is some sort of sometimes-lock mechanism.  Sharing is
> OK most of the time, but sometimes the file is locked.

Unless I misunderstand your post, what you want is a shared lock.  The 
sharing processes request a shared lock with

    use Fcntl ':flock';
    flock(FH, LOCK_SH) || die ...

while the janitor process requests an exclusive lock with

    flock(FH, LOCK_EX) || die...

I have no idea whether file locking works in Win95, so good luck!

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: Thu, 21 Jan 1999 05:43:51 -1000
From: "Michael Ching" <m_ching@hotmail.com>
Subject: Re: Looking for free Web Server with CGI
Message-Id: <36a7d8c4.0@news.hawaii.rr.com>

goto serverwatch.com or winfiles.com .. recommend xitami and omni for simple
setup
Stefan Mueller wrote in message <36A733CF.5831@ruhr-uni-bochum.de>...
>Chris wrote:
>>
>> Hi
>>
>> Are there any free Web servers for Win98 (even trial versions) that
>> allow me to mess around with CGI & Perl? Last time I tried this (years
>> ago), PWS was supposed to do it but it was broken (or I was broken, or
>> something)
>
>Try apache. There're binaries available on www.apache.org
>And get perl from www.activestate.com.
>
>It works fine for me.
>
>Stefan.
>
>
>--------------------------------------------
>Dipl.-Ing. Stefan Mueller
>Ruhr-University Bochum
>AG f. num. Meth. i.d. Mechanik und
>  Simulationstechnik
>Germany
>--------------------------------------------




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

Date: Thu, 21 Jan 1999 22:16:20 -0600
From: "Michael J. Bahr" <targa@cornhusker.net>
Subject: Newbie - Whats wrong with this script?
Message-Id: <36A7FB93.DD491876@cornhusker.net>

Extremely new to perl - go easy.

I get this error -
Can't modify subroutine entry in scalar assignment at
E:\XITAMI\cgi-bin\netimage.cgi line 20, near "$hosts;"
Execution of E:\XITAMI\cgi-bin\netimage.cgi aborted due to compilation
errors.

from the following script:
#! perl
use GD;
# Collect IP nodes to ping
open(NODES,'nodes.dat');
while() {
  chop;
  ($xy, $ipaddr) = split(" "); # parse into two values
  push(@check,$ipaddr);        # add ip address to list
  $hosts{$ipaddr} = $xy;      # add both to lookup table
 }
close(NODES);
open(RESULTS, "ping -u @check 2>/dev/null |");
open(GIF,"test.gif") || die;
    $myImage = newFromGif GD::Image(GIF) || die;
#   $RED = $im->colorAllocate(255,0,0);
$im->fill($x,$y,$RED);
open(RESULTS, "ping -u @check 2>/dev/null |");
while() {            # While any failing nodes
   chop;                         take off extraneous
   $xy = $hosts{$_};          # Lookup x,y coordinate
   ($x,$y) = split(/,/,$xy);  # parse it into x and y
   $im->fill($x,$y,$red);  # flag the node as down
}

close(RESULTS);
$| = 1;
print "Content-type: image/gif\n\n";
print $im->gif;

Whats wrong??? What needs to be where {$_} is???

Any help greatly appreciated!

Thanks

Mike



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

Date: Thu, 21 Jan 1999 22:18:46 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: open() "bad file number" help!
Message-Id: <67u887.kpv.ln@magna.metronet.com>

cometsoft@yahoo.com wrote:
: I am having a problem with a Perl/CGI script. It returns a "Bad file number"
: error.

: open (F, $filename);
: print F $file_contents;


   You cannot write to a filehandle that you have opened for reading.

   Open it for writing instead (see open() in 'perlfunc.pod')


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


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

Date: Thu, 21 Jan 1999 23:02:56 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: PERL Security Issues
Message-Id: <0q0987.kpv.ln@magna.metronet.com>

Nick Smith (nick.smith@team.xtra.co.nz) wrote:

: 	I am preparing a document that relates to the security issues
: pertaining to hosting PERL enabled websites on a webserver. Could any
: of you either email me or point me to a reference that contains an
: exhaustive guide re: PERL Scripting Security issues?


   See the 'perlsec.pod' man page for Perl security.

   You better also find out about additional issues for the
   CGI environment (but CGI is discussed in another newsgroup)


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


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

Date: Fri, 22 Jan 1999 10:02:40 +0530
From: Ramanujam Parthasarathi <partha@mihy.mot.com>
To: Kevin Clancy PhD <clancy@eri.uchsc.edu>
Subject: Re: Perl5.00502 and @INC
Message-Id: <36A7FF68.3DF05139@mihy.mot.com>

Hi,

I don't think anything has changed. Just check out @INC - print it using
both the versions - maybe you'll find somenthing.

HTH
-PArtha

Kevin Clancy PhD wrote:

> Hi Folks
>
> Has something changed with pushing scripts and needed files to @INC in
> the latest Perl?
>
> I have a program which worked well up to 5.00401 with the following
> start stateements:
>
> #!/usr/local/bin
> require 5.002; #this is to use Tkperl later on...
> $version = "1.20";
> require "program-paths.pl"; # a series of configurable paths...
> ...
> the program then continues
>
> When I now call the prog under the latest perl, I get a message that
> program-paths.pl cannot be found in @INC (it lists all the direcories it
> can see but doesn't include the program-paths.pl directory. Do I now
> need to push @INC the directories?
>
> Second question - should I use use rather than require?





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

Date: Thu, 21 Jan 1999 23:54:43 -0500
From: jamesht <jamesht@idt.net>
To: Kevin Clancy PhD <clancy@eri.uchsc.edu>
Subject: Re: Perl5.00502 and @INC
Message-Id: <36A80493.C3504F8C@idt.net>

Hello,

use lib './required_dir';

This is the proper way to change @INC; since it's a 'use' and not a require,
it's a compiler directive, rather than a runtime command, so it should be in
your main script file.

hth,

James



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

Date: Thu, 21 Jan 1999 20:45:39 -0700
From: "STONES ARE GOD!!" <Jesusisaphonygod@getreal.net>
Subject: Re: PROOF: Jesus is NOT LORD of the Sabbath!         ,: (5G`0(
Message-Id: <36A7F462.A051A776@getreal.net>



Anonymous wrote:
>A BUNCH OF SHIT!

WHY THE FUCK ARE YOU POSTING THIS OFF-TOPIC SHIT AT THE STONES NEWSGROUP?
TAKE YOUR FUCKING LIES SOMEWHERE ELSE, ASSHOLE!!!!
YOU DON'T KNOW THE TRUTH, STOP READING THE BUYBULL AND THEN YOU WILL SEE THE REAL LIGHT!





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

Date: Thu, 21 Jan 1999 20:45:48 -0700
From: "STONES ARE GOD!!" <Jesusisaphonygod@getreal.net>
Subject: Re: PROOF: Jesus is NOT LORD of the Sabbath!         ,: (5G`0(
Message-Id: <36A7F46B.E66C6599@getreal.net>



Anonymous wrote:
>A BUNCH OF SHIT!

WHY THE FUCK ARE YOU POSTING THIS OFF-TOPIC SHIT AT THE STONES NEWSGROUP?
TAKE YOUR FUCKING LIES SOMEWHERE ELSE, ASSHOLE!!!!
YOU DON'T KNOW THE TRUTH, STOP READING THE BUYBULL AND THEN YOU WILL SEE THE REAL LIGHT!





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

Date: Thu, 21 Jan 1999 20:45:52 -0700
From: "STONES ARE GOD!!" <Jesusisaphonygod@getreal.net>
Subject: Re: PROOF: Jesus is NOT LORD of the Sabbath!         ,: (5G`0(
Message-Id: <36A7F470.F86C0CA4@getreal.net>



Anonymous wrote:
>A BUNCH OF SHIT!

WHY THE FUCK ARE YOU POSTING THIS OFF-TOPIC SHIT AT THE STONES NEWSGROUP?
TAKE YOUR FUCKING LIES SOMEWHERE ELSE, ASSHOLE!!!!
YOU DON'T KNOW THE TRUTH, STOP READING THE BUYBULL AND THEN YOU WILL SEE THE REAL LIGHT!





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

Date: Thu, 21 Jan 1999 20:45:57 -0700
From: "STONES ARE GOD!!" <Jesusisaphonygod@getreal.net>
Subject: Re: PROOF: Jesus is NOT LORD of the Sabbath!         ,: (5G`0(
Message-Id: <36A7F475.D0AF4EAA@getreal.net>



Anonymous wrote:
>A BUNCH OF SHIT!

WHY THE FUCK ARE YOU POSTING THIS OFF-TOPIC SHIT AT THE STONES NEWSGROUP?
TAKE YOUR FUCKING LIES SOMEWHERE ELSE, ASSHOLE!!!!
YOU DON'T KNOW THE TRUTH, STOP READING THE BUYBULL AND THEN YOU WILL SEE THE REAL LIGHT!





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

Date: Thu, 21 Jan 1999 20:46:04 -0700
From: "STONES ARE GOD!!" <Jesusisaphonygod@getreal.net>
To: Anonymous <Use-Author-Address-Header@[127.1]>
Subject: Re: PROOF: Jesus is NOT LORD of the Sabbath!         ,: (5G`0(
Message-Id: <36A7F47C.E3192DF1@getreal.net>



Anonymous wrote:
>A BUNCH OF SHIT!

WHY THE FUCK ARE YOU POSTING THIS OFF-TOPIC SHIT AT THE STONES NEWSGROUP?
TAKE YOUR FUCKING LIES SOMEWHERE ELSE, ASSHOLE!!!!
YOU DON'T KNOW THE TRUTH, STOP READING THE BUYBULL AND THEN YOU WILL SEE THE REAL LIGHT!





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

Date: Thu, 21 Jan 1999 20:46:10 -0700
From: "STONES ARE GOD!!" <Jesusisaphonygod@getreal.net>
To: Anonymous <Use-Author-Address-Header@[127.1]>
Subject: Re: PROOF: Jesus is NOT LORD of the Sabbath!         ,: (5G`0(
Message-Id: <36A7F482.87E7076D@getreal.net>



Anonymous wrote:
>A BUNCH OF SHIT!

WHY THE FUCK ARE YOU POSTING THIS OFF-TOPIC SHIT AT THE STONES NEWSGROUP?
TAKE YOUR FUCKING LIES SOMEWHERE ELSE, ASSHOLE!!!!
YOU DON'T KNOW THE TRUTH, STOP READING THE BUYBULL AND THEN YOU WILL SEE THE REAL LIGHT!





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

Date: Thu, 21 Jan 1999 23:15:59 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Random Invoice #
Message-Id: <fi1987.t6.ln@magna.metronet.com>

Brian Thompson (hitbyabus@mindspring.com) wrote:
: Is there anyway that I can assign a random number to a scalar? I'm using it
: for invoice numbers....I want it to begin with 00000000 and then goto
: 00000001 and so on, everytime the form is submitted


   But that is sequential, not random.

   Which do you want?

   I'll guess that you do _not_ want random even though you
   said so twice.


   In that case, Perl FAQ part 5 will get you going:

      "I still don't get locking.  
       I just want to increment the number in the file.  
       How can I do this?"


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


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

Date: Thu, 21 Jan 1999 22:17:11 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Reading a log file from an HTML Page
Message-Id: <74u887.kpv.ln@magna.metronet.com>

Brian Thompson (hitbyabus@mindspring.com) wrote:
: I am trying to give some employees access to a log file for security
: monitoring........how do I access a log file? 


   They same way you access any other file.


: I try using the standard
: technique:

[snip fine Perl code]

: That is an example I got from a book I'm reading.....my problem is, the
: actual log file is about 16 lines long, How do I display all of these lines
: instead of them running together in one straight line???


   The appearance of text in a browser is controlled by HTML.


   You have the wrong newsgroup.

         comp.infosystems.www.authoring.html


   <BR> is the HTML tag for forcing a line BReak


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


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

Date: Thu, 21 Jan 1999 23:51:10 -0500
From: jamesht <jamesht@idt.net>
To: Darren <darrensw@ix.netcom.com>
Subject: Re: Return a blank form
Message-Id: <36A803BE.83706772@idt.net>

Hello,

Have your script do everything it needs to do, and then do this:

print "Location: the_original_html_form_page.html\n\n";
exit;

James




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

Date: Thu, 21 Jan 1999 05:41:29 -1000
From: "Michael Ching" <m_ching@hotmail.com>
Subject: Re: Simple CGI with Perl
Message-Id: <36a7d834.0@news.hawaii.rr.com>

Have you tried yet?  Try, then post and problems you may come across.
People here are more likely to answer specific questions.

also, if not perl and all cgi, try a cgi newsgroup
(comp.infosystems.www.authoring.cgi)

Chris Yeates wrote in message <787h76$o7n$1@fafnir.cf.ac.uk>...
>I am just embarking on a project to produce web pages with multiple choice
>tests at the end of each section. Does anybody know how I can write a CGI
>script to mark the tests and prevent access to the next section to those
>failing to achieve a high enough mark. ie 8 out of 10.
>
>Cheers
>
>C.N.Yeates@cs.cf.ac.uk
>
>




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

Date: Thu, 21 Jan 1999 21:25:33 -0800
From: Steve Beisner <beisner@acm.org>
Subject: SWIG with ActiveState?
Message-Id: <36A80BCD.F0D532EF@acm.org>

Is anyone successfully using SWIG with ActiveState
(5.0 patchlevel 5 subversion 02)?

I can build and install it fine, but I'm getting
undefined symbols at link time on even the simplest
examples.  From the symbol names, it looks like
perhaps something has changed name (just a wild
guess) in perlcore.lib.  Missing symbols are
	__imp__PL_stack_sp
	__imp__PL_stace_base
	__imp__PL_markstack_ptr
	__imp__PL_sv_yes

Or maybe there's a .lib file I'm missing? Any help
appreciated.

-- 
Steve Beisner
Email:  beisner@acm.org


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

Date: Fri, 22 Jan 1999 00:48:06 -0500
From: jamesht <jamesht@idt.net>
To: Matt Johnson <cpuweb@cpuweb.com>
Subject: Re: Trying to work with a text database
Message-Id: <36A81116.B85564C1@idt.net>

Hello,

I do believe that this is a job for the beloved Schwartzian Transform!!

#################################
#
#    here we go
#

@arr = ("one,,Work Order Number,,First Name,,Last Name,,Order Date,,Due
Date11758,,Matt,,Johnson,,12-31-98,,01-05-99",
 "two,,BWork Order Number,,First Name,,Last Name,,Order Date,,Due
Date11758,,Matt,,Johnson,,12-31-98,,01-05-99",
 "two,,DWork Order Number,,First Name,,Last Name,,Order Date,,Due
Date11758,,Matt,,Johnson,,12-31-98,,01-05-99",
 "two,,CWork Order Number,,First Name,,Last Name,,Order Date,,Due
Date11758,,Matt,,Johnson,,12-31-98,,01-05-99",
 "two,,AWork Order Number,,First Name,,Last Name,,Order Date,,Due
Date11758,,Matt,,Johnson,,12-31-98,,01-05-99");


#print ((split(',,', $arr[0]))[1]) . "\n";
#exit;

$index_to_sort_by = 1;

#
# Schwartzian Transform
#
@sorted_arr =  map {$_->[0]}
  sort { $a->[1] cmp $b->[1] }
  map {[$_ , (split(',,', $_))[$index_to_sort_by]]}
  @arr;

print join("\n", @sorted_arr) . "\n";

###################################

That's it.

hth,

James



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

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

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