[10041] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3634 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 4 12:05:59 1998

Date: Fri, 4 Sep 98 09:00:25 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 4 Sep 1998     Volume: 8 Number: 3634

Today's topics:
    Re: #!/usr/bin/perl not working? <dparrott@ford.com>
    Re: array of "objects" (Andrew M. Langmead)
    Re: array of "objects" <jdporter@min.net>
        Beginner's question <kamrani@ifi.uio.no>
    Re: Beginner's question (Larry Rosler)
    Re: CGI search engines scripts <dan@fearsome.net>
        cmd parsing when using Net::Telnet <raj.subramani@citicorp.com>
    Re: COBOL and Perl (Mark-Jason Dominus)
        creating directories tripredacus@earthling.net
    Re: Denver/Boulder Perl Mongers <tchrist@mox.perl.com>
    Re: email attachments (Randy Kobes)
        Error message.....Perl.exe did not produce a valid head <Art.vanMeeteren@fmr.com>
    Re: Error message.....Perl.exe did not produce a valid  <dan@fearsome.net>
        Help with references needed <areeves@us.ibm.com>
    Re: Help with references needed (Sean McAfee)
    Re: HELP: Forking perl script from C program. ? <bohorquez_bernard@non-hp-france-om4.om.hp.com>
    Re: How do I get a $scalar to print literal ..... (Clinton Pierce)
        how does one charge credit cards online ()
    Re: how does one charge credit cards online <Geert.Roovers@ericsson.com>
    Re: how does one charge credit cards online <eashton@bbnplanet.com>
    Re: Is perl millennium compliant ? <jdporter@min.net>
    Re: Misinterpreted => why no true/false keywords? <zenin@bawdycaste.org>
    Re: object refs and memory handling (Andrew M. Langmead)
        or vs || with open function <Liznet@cookwood.com>
    Re: or vs || with open function (Larry Rosler)
    Re: Parsing XML and HTML (was: Re: Better Regular Expre <zenin@bawdycaste.org>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Fri, 04 Sep 1998 10:43:49 -0400
From: "Dennis M. Parrott" <dparrott@ford.com>
To: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: #!/usr/bin/perl not working?
Message-Id: <35EFFCA5.3778@ford.com>

Jeff Pinyan wrote:
>
> > Andrew Mulvey <triangle@iinet.net.au> wrote:
> >
> > I can easily run perl scripts I have written in Linux (RH5.0) by typing
> > "perl exename" at the shell prompt but even if i start the script with
> > #!/usr/bin/perl my script won't run simply by entering its name at the
> > prompt (and yes i have set the file the script is saved in as executable
> > by u, g and o). The perl exe is sitting in /usr/bin btw.
> 
> It might be the curse of the screwy path.
> Try typing ./exename instead of just exename.  If that works, then that
> means that for some fruity reason, the . directory is not in your path.
> It needs to be added to your path.
> 

depending on who set up the path for Andrew, it *may* have been left
out on PURPOSE. I don't remember where I read it, but, there are some
admins who consider having "." in the PATH as a security risk (and I 
may not have the whole story here either -- it may well relate to the 
position of "." in the PATH)

possibly some of our other more Unix-admin fluent readers could 
confirm this...

all of this is a long way of saying that leaving "." is probably not
due to a 'fruity reason'...

> Jeff Pinyan
> Crusoe Communications, Inc.
> 973-882-1022
> jeffp@crusoe.net
> ICQ 10222129
> www.crusoe.net

-- 

-----------------------------------------------------------------------
Dennis M. Parrott        |            Unix:  dparrott@ford.com
PCSE Webmaster           |           PROFS:  DPARROTT
Ford Motor Company       |             VAX:  EEE1::PARROTT
Dearborn, Michigan USA   | public Internet:  dparrott@ford.com
-----------------------------------------------------------------------
Voice: 313-322-4933  Fax: 313-248-1234  Pager: 313-851-2958


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

Date: Fri, 4 Sep 1998 15:14:09 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: array of "objects"
Message-Id: <EyrMBL.BAx@world.std.com>

norbert heller <norbertheller_dontspammeatall@swol.de> writes:

>i am looking for a way to create an array of "objects"   with perl 5

Objects are blessed references, and references are simply scalars. It
is a simple matter to add an arbitrary number of scalars onto an array
most commonly using the push() or unshift() functions. (In perl arrays
grow on demand) I'm not quite sure from your question where your
problem lies. If you are unsure about maninpulating arrays themselves,
then maybe the best thing would be to pick up a tutorial book on perl
like "Learning Perl" If you are unsure about how to create objects
whose data is contained in files, maybe something like the perltoot
man page.


#!/usr/bin/perl -w

use strict;

package DataObject;

sub new {
  my $class = shift;
  my $id = shift;
  my $color = shift;
  my $direction = shift;
  my $data = shift;
  my $obj = { id => $id, color => $color, 
              direction => $direction, data => $data };
  return bless $obj, $class;
}

sub print {
  my $self = shift;
  my $filehandle = shift || *STDOUT;
  print $filehandle "id=$self->{id} color=$self->{color} ", 
            "direction=$self->{direction} data=$self->{data}\n";

}

package main;

my @array;

{
  local $/ = '';
  while(<DATA>) {
    my ($id, $color, $direction, $data) = 
                             /(\w+):.*\n\s*(\w+),\s*(\w+),\s*(\w+)/;
    push @array, DataObject->new($id, $color, $direction, $data);
    # or do you mean something like:
    # my($elem) = $id =~ /obj(\d+)/;
    # $array[$elem] = DataObject->new($id, $color, $direction, $data);
    # if so, you probably eant to have an "obj0"
  }
}

my $object;
foreach $object (@array) {
  next unless ref $object;
  $object->print();
}
  
__DATA__
obj1:
    red, left, string

obj2:
    blue,  right, number

obj3:
    yellow, left, string

obj4:
    white, middle, string
-- 
Andrew Langmead


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

Date: Thu, 03 Sep 1998 11:44:07 -0400
From: John Porter <jdporter@min.net>
Subject: Re: array of "objects"
Message-Id: <35EEB947.65F7239A@min.net>

norbert heller wrote:
> 
> i am looking for a way to create an array of "objects" with perl 5
> 
> in my program is wish to init a table or database with all object
> descriptions accordingly, without having to rely on a fixed  number of
> objects ( 2 - 100 maybe)

Maybe what you want is 'push'.

Can you post the code you've got so far, that isn't quite doing what
you want?

John Porter


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

Date: Fri, 04 Sep 1998 15:41:12 +0200
From: Kamran <kamrani@ifi.uio.no>
Subject: Beginner's question
Message-Id: <35EFEDF8.4DCD@ifi.uio.no>

Hi

How do I tell perl to extract text between to pattern encounter ?
For instance I want to print out whatever is of text between
the first and the second encounter of the word "public" in
the following example

-----------

public abstract void translate(int x,int y)

          Translates the origin of the graphics context to the point
          (x, y) in the current coordinate system. Modifies this
          graphics context so that its new origin corresponds to the
          point (x, y) in this graphics context's original coordinate
          system. All coordinates used in subsequent renderingoperations
          on this graphics context will be relative to this new origin.
          

public abstract color getColor()
 ...
 ...
 ..

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

Thanks in advance

Kmaran


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

Date: Fri, 4 Sep 1998 07:54:39 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Beginner's question
Message-Id: <MPG.10599f052a93c3d3989825@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <35EFEDF8.4DCD@ifi.uio.no> on Fri, 04 Sep 1998 15:41:12 +0200, 
Kamran <kamrani@ifi.uio.no> says...
 ...
> How do I tell perl to extract text between to pattern encounter ?
> For instance I want to print out whatever is of text between
> the first and the second encounter of the word "public" in
> the following example
 ... 
> public abstract void translate(int x,int y)
 ...    description of Java function?       
> public abstract color getColor()

Though you may be a beginner, this isn't really a "Beginner's question" -
- that subject is a good way to be ignored here.

Get the data into one string.  (If being read from a file, see the 
documentation of '$/' in perlvar.)  Then you can use a positive look-
ahead assertion:

/public(.*?)(?=public)/s;
print $1;

To make that safer (to match 'public' only if it is at the very beginning 
of a line), use:

/^public(.*?)(?=^public)/sm;

(The order of the suffixes doesn't matter, but neither order looks good.  
'ms' is a commercial for Bill, and sm for the Marquis de Sade.  Is there 
a difference?)

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


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

Date: Fri, 4 Sep 1998 15:44:54 +0100
From: "Daniel Adams" <dan@fearsome.net>
Subject: Re: CGI search engines scripts
Message-Id: <904920893.27231.0.nnrp-06.c2deb1c5@news.demon.co.uk>

For a pre-made one, who knows. Try www.cgi-resources.com or even
www.cgiresources.com

Bear in mind it will be generic and there is a slim chance of it doing
exactly what you want. If you don't find one you like, pay someone to write
it for you. Or learn Perl, which would be more rewarding in the long run,
and financially expedient in the short run.

--

Dan Adams
dan@fearsome.net
http://fearsome.net


vivekvp@hotmail.com wrote in message <6sofni$99o$1@nnrp1.dejanews.com>...
>are there any CGI search engine scripts out there?  i want one that will
>search the majoy search engines form one site - then returnt he output to
me.
> is there such an animal - or do i have to pay to get one?
>
>thanx!
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum




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

Date: Fri, 04 Sep 1998 14:42:02 +0100
From: Raj Subramani <raj.subramani@citicorp.com>
Subject: cmd parsing when using Net::Telnet
Message-Id: <35EFEE2A.F8FD8796@citicorp.com>

I'm sending a "ps -ef | grep foo | grep -v grep"
command via Telnet's cmd function.

Say, I start three foo processes:
(raj)~/perl # jobs
[1] +Running          foo
[2] -Running          foo
[3]  Running          foo



When I execute my perl script:
 ...
@psList = &executeCmd("ps -ef | grep foo | grep -v grep");
$total = @psList;
print("Number of foo processes is $total\n");
print("@psList\n");


I get the following:
Number of foo processes is 4
 12664 ttyp8   1:11 foo
  12662 ttyp8   1:51 foo
  12663 ttyp8   1:03 foo
 [2]



Obviously 4 is the wrong answer.
I can't figure out what the [2] in the last line of the output is.
I don't think its the echo back of the command sent (is it?).
How could I make sure that number of foo processes returned is
only 3?



Any pointers would be much appreciated.



Cheers
-raj


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

Date: 4 Sep 1998 09:45:16 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: COBOL and Perl
Message-Id: <6soqtc$smb$1@monet.op.net>

In article <35EF1AC7.F1F9B3DC@plano.net>,
Charles Richmond  <richmond@plano.net> wrote:
>So perhaps this post meant to reference the Princeton machine.

It didn't.


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

Date: Fri, 04 Sep 1998 15:37:02 GMT
From: tripredacus@earthling.net
Subject: creating directories
Message-Id: <6sp1eu$co$1@nnrp1.dejanews.com>

I'm just learning Perl, so please forgive my ignorance....  Is there a Perl
command that can create subdirectories?  If there is, can that command be
fixed to CHMOD them too?  Thanks.

Static-Pulse
khovak@hotmail.com

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 4 Sep 1998 15:04:28 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Denver/Boulder Perl Mongers
Message-Id: <6sovhs$85a$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, cfedde@my-dejanews.com writes:
:The first meeting of the Denver/Boulder Perl Mongers group
:will be held at:
:    Wynkoop Brewing Co.
:    1634 18th, DENVER CO
:    Monday, Sept 14 1998
:    6:30PM

It may just be that I'm in Boulder not Denver, but it seems
counterproductive to hold a get together at a beer-drinking place 
when people have to *drive* home. :-(

Oh well.  I guess drinking is highly optional.  Oh -- is there smoking
there?

--tom
-- 
If I had to choose between System V and 4.2, I'd resign. --Peter Honeyman


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

Date: 4 Sep 1998 15:26:50 GMT
From: randy@theory.uwinnipeg.ca (Randy Kobes)
Subject: Re: email attachments
Message-Id: <slrn6v0258.der.randy@theory.uwinnipeg.ca>

On Fri, 04 Sep 1998 15:38:10 +1000, 
	Jye Tucker <jye@buckconsultants.com.au> wrote:
>Hi everyone,
>I'm having some trouble trying to work out how to get a perl script of mine
>to send an email with a plain text file attachment. I would have thought
>one of the mail modules would have handled this but haven't been able to
>find anything.

Hi,
  MIME-tools-4.121.tar.gz, under
	http://www.perl.com/CPAN/authors/id/ERYQ/
has modules for parsing and creating MIME entities. To install these
modules, you'll also have to install the modules in
	http://www.perl.com/CPAN/authors/id/GBARR/MailTools-1.11.tar.gz
	http://www.perl.com/CPAN/authors/id/GAAS/MIME-Base64-2.06.tar.gz
	http://www.perl.com/CPAN/authors/id/ERYQ/IO-stringy-1.203.tar.gz
Examples of its use are contained in the MIME-tools documentation.
-- 
		Best regards,
		Randy Kobes

Physics Department		Phone: 	   (204) 786-9399
University of Winnipeg		Fax: 	   (204) 774-4134
Winnipeg, Manitoba R3B 2E9	e-mail:	   randy@theory.uwinnipeg.ca
Canada				http://theory.uwinnipeg.ca/


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

Date: Fri, 04 Sep 1998 10:23:53 -0400
From: Art vanMeeteren <Art.vanMeeteren@fmr.com>
Subject: Error message.....Perl.exe did not produce a valid header
Message-Id: <35EFF7F9.3FDB9396@fmr.com>

Hello.... I've been working on taking over some code for about 3 days
now... and I'll have the code all set... run it in a DOS screen... and
it produces the HTML code that I want... so then I load it on the server
and run it and get this  error message:

[04/Sep/1998:10:07:12] failure: for host 172.22.13.190 trying to GET
/shell/Entrance.pl, cgi-parse-output reports: the CGI program
C:\Perl\5.00502\bin\MSWin32-x86-object\Perl.exe did not produce a valid
header (program terminated without a valid CGI header (check for core
dump or other abnormal termination)

Its really starting to piss me off... cause after I run that
application... I have another that is VERY simple... and it does the
same thing... then I change a few line... add a comment or blank line...
then it works again.... But I can't get the big app to work.

Does anyone have a better way to check code or how do I debug this to
get it to work.... or better yet... what the hell does this damn error
messsage mean... I can't find it in any documentation.

Thanks for your help.

Art



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

Date: Fri, 4 Sep 1998 15:49:27 +0100
From: "Daniel Adams" <dan@fearsome.net>
Subject: Re: Error message.....Perl.exe did not produce a valid header
Message-Id: <904920901.27231.1.nnrp-06.c2deb1c5@news.demon.co.uk>

Assuming you are trying to print HTML code to the screen, always make sure
that first thing that gets out is a content-type header, in this case
"Content-type:text/html".

Also, you need to make sure you then state "new line" before you print your
HTML code. Thus, the code should be (roughly) :

print "Content-type: text/html\n\n";

That applies _whenever_ you are printing HTML code to the screen.

--

Dan Adams
dan@fearsome.net
http://fearsome.net


Art vanMeeteren wrote in message <35EFF7F9.3FDB9396@fmr.com>...
>Hello.... I've been working on taking over some code for about 3 days
>now... and I'll have the code all set... run it in a DOS screen... and
>it produces the HTML code that I want... so then I load it on the server
>and run it and get this  error message:
>
>[04/Sep/1998:10:07:12] failure: for host 172.22.13.190 trying to GET
>/shell/Entrance.pl, cgi-parse-output reports: the CGI program
>C:\Perl\5.00502\bin\MSWin32-x86-object\Perl.exe did not produce a valid
>header (program terminated without a valid CGI header (check for core
>dump or other abnormal termination)
>
>Its really starting to piss me off... cause after I run that
>application... I have another that is VERY simple... and it does the
>same thing... then I change a few line... add a comment or blank line...
>then it works again.... But I can't get the big app to work.
>
>Does anyone have a better way to check code or how do I debug this to
>get it to work.... or better yet... what the hell does this damn error
>messsage mean... I can't find it in any documentation.
>
>Thanks for your help.
>
>Art
>




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

Date: Fri, 04 Sep 1998 10:00:23 -0400
From: Adam Reeves <areeves@us.ibm.com>
Subject: Help with references needed
Message-Id: <35EFF273.B0245FDA@us.ibm.com>

With the following code:
use strict;    # Restrict unsafe constructs
 .....
$xxx = ${"Q::$name"};

I get the following error:
Can't use string ("Q::firstname") as a SCALAR ref while "strict refs" in
use at reftest.pl line 10(#2).

    (F) Only hard references are allowed by "strict refs". Symbollic
refs are disallowed. See perlref.

Uncaught exception from user code:
        Can't use string ("Q::firstname") as a SCALAR ref while "strict
refs" in use at reftest.pl line 10.

I can avoid the error message with the following code:
use strict;    # Restrict unsafe constructs
 .....
no strict 'refs';
$xxx = ${"Q::$name"};
use strict 'refs';

Is there anyway to do the same thing with hard references? I am not sure
that I understand the difference, or even what is actually going on
here. Any help would be greatly appreciated!

Cheers,
Adam
areeves@us.ibm.com




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

Date: Fri, 04 Sep 1998 14:45:03 GMT
From: mcafee@seawolf.rs.itd.umich.edu (Sean McAfee)
Subject: Re: Help with references needed
Message-Id: <P1TH1.1030$F7.4253164@news.itd.umich.edu>

In article <35EFF273.B0245FDA@us.ibm.com>,
Adam Reeves  <areeves@us.ibm.com> wrote:
>With the following code:
>use strict;    # Restrict unsafe constructs
>.....
>$xxx = ${"Q::$name"};

>I get the following error:
>Can't use string ("Q::firstname") as a SCALAR ref while "strict refs" in
>use at reftest.pl line 10(#2).

>    (F) Only hard references are allowed by "strict refs". Symbollic
>refs are disallowed. See perlref.

>I can avoid the error message with the following code:
>use strict;    # Restrict unsafe constructs
>.....
>no strict 'refs';
>$xxx = ${"Q::$name"};
>use strict 'refs';

>Is there anyway to do the same thing with hard references?

Yes:

$xxx = ${$Q::{$name}};

>I am not sure
>that I understand the difference, or even what is actually going on
>here.

A hard reference is analogous to a pointer type in C, whereas a symbolic
reference is simply a string that contains the name of a variable.

$x = 10;
$x_hard_ref = \$x;
$x_symbolic_ref = "x";

$y = ${$x_hard_ref};      # accessing $x through hard ref
$y = ${$x_symbolic_ref};  # accessing $x through symbolic ref
                          #   (disallowed when use strict in effect)

In my solution to your question above, $Q::{$name} is a hard reference to
the variable in package Q called "$name"; see the perlmod man page, in the
section called "Symbol Tables".

For a more complicated example, if you have the package name stored in one
scalar and the variable name stored in another, you can retrieve the
scalar's value like this:

$pkg = "Q";
$name = "foo";

$val = ${${$::{"${pkg}::"}}{$name}};

 ...and "use strict" won't complain!

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


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

Date: Fri, 04 Sep 1998 08:54:48 +0200
From: Bohorquez Bernard <bohorquez_bernard@non-hp-france-om4.om.hp.com>
To: ankur@yahoo.com
Subject: Re: HELP: Forking perl script from C program. ?
Message-Id: <35EF8EB8.27DB@non-hp-france-om4.om.hp.com>

Hi,

I think you should use the nohup shell command to run your perl script:
         execvp('nohup perl script');
This command will make your script dependent from process n=B01

Good luck.

ankur@yahoo.com wrote:
> =

> Hello:
> =

> I want to fork a perl script from my C program (Solaris 2.5/ perl 5.040=
4).
> Currently my perl script dies when C program exits. How can I make
> sure that perl script keeps running even if C program dies.
> Here's my C program,
> =

>     if (fork() =3D=3D 0)
>         {
>         setsid();
>         execvp('perl script');
>         exit();
>         }
>      ..continue..
> =

> I read FAQ and tried following in my perl script but it did not solve t=
he
> problem.  * Open /dev/tty and use the the TIOCNOTTY ioctl on it. See th=
e
> tty(4)       manpage for details.  * Change directory to /  * Reopen ST=
DIN,
> STDOUT, and STDERR so they're not connected to the old tty.  * Backgrou=
nd
> yourself like this:  fork && exit;
> =

> When I do 'ps' it appears that perl script has 1 as its parent process
> and is detached from tty. Stiil when C program exists, perl script dies=
=2E
> =

> You help is greatly appreciated.
> =

> Thanks,
> =

> Ankur Shah
> ankur@yahoo.com
> =

> -----=3D=3D Posted via Deja News, The Leader in Internet Discussion =3D=
=3D-----
> http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum=



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

Date: 4 Sep 1998 13:42:28 GMT
From: cpierce1@cp500.fsic.ford.com (Clinton Pierce)
To: "Doyle Johnson" <sales@madm.com>
Subject: Re: How do I get a $scalar to print literal .....
Message-Id: <6soqo4$nqi1@eccws1.dearborn.ford.com>

In article <6so7j7$86a$1@nnrp03.primenet.com>,
	"Doyle Johnson" <sales@madm.com> writes:
>print "$bigdeal = "$user";\n";
>
>ok variable $bigdeal needs to stay "$bigdeal" when printed to the new
>file... but
>"$user" needs to return its value to be printed to the new file.  Am I
>making sense?

Read up on the differences between single quotes (i.e. '') and 
double quotes (i.e. "").  Your answer (or one of them) is there!

Might I suggest "Programming Perl" or even "Learning Perl" from O'Reilly?


-- 
+------------------------------------------------------------------------+
|  Clinton A. Pierce    |   "If you rush a Miracle Man,   | http://www.  |
|  cpierce1@ford.com    |     you get rotten miracles"    | dcicorp.com/ |
| fubar@ameritech.net   |--Miracle Max, The Princess Bride| ~clintp      |
+------------------------------------------------------------------------+
GCSd-s+:+a-C++UALIS++++P+++L++E---t++X+b+++DI++++G++e+>++h----r+++y+++>y*



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

Date: 4 Sep 1998 13:58:50 GMT
From: impactid@pantheon.yale.edu ()
Subject: how does one charge credit cards online
Message-Id: <6sormq$hrh@jupiter.planet.net>

hi all... i'm putting together a mini shopping site online
but don't know how to take credit card numbers and charge 
them... i.e. after i get their cc number.. how do i intreface
with the bank and deduct that amount from their account?
how do i even validate that they're really who say who they
are... 

thanks! (i'm on a unix - solaris2.5 platform if that matters)

cwu@geocities.com


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

Date: Fri, 04 Sep 1998 16:27:41 +0200
From: Geert Roovers <Geert.Roovers@ericsson.com>
Subject: Re: how does one charge credit cards online
Message-Id: <35EFF8DD.95B4E00E@ericsson.com>

I don't think this is really a perl question.

As far as I know, there is no way of telling if the one supplying the
info, really the owner of the card. You can only ask for all info that
is on the card, which is, the number, the name, and the expiration date.
And ofcourse the brand (Visa, MasterCard, Eurocard, American Express,
Diner's Club, whatever you want to accept). If the user has a stolen
credit card, he/she can supply all this, but that's the real owner's
responsibility, not yours.

I suppose after that, you go to the company that supplied the card (i.e.
Visa, or one of the others, ask them if this card happens to be invalid
or stolen. If not, charge them, and send away the stuff you're selling.

you might want to ask one of the major creditcard companies how they
want you to contact them for the info.

good luck

Geert

impactid@pantheon.yale.edu wrote:
> 
> hi all... i'm putting together a mini shopping site online
> but don't know how to take credit card numbers and charge
> them... i.e. after i get their cc number.. how do i intreface
> with the bank and deduct that amount from their account?
> how do i even validate that they're really who say who they
> are...
> 
> thanks! (i'm on a unix - solaris2.5 platform if that matters)
> 
> cwu@geocities.com


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

Date: Fri, 04 Sep 1998 15:46:14 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: how does one charge credit cards online
Message-Id: <35F008EF.8E98C4D0@bbnplanet.com>

this isn't a perl question but since i deal a lot with e-commerce
solutions i would highly recommend doing your homework and purchasing a
solution rather than rolling your own. banking is personal and shouldn't
be handled lightly.

e.


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

Date: Thu, 03 Sep 1998 11:30:31 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Is perl millennium compliant ?
Message-Id: <35EEB617.A8958CB7@min.net>

Les George wrote:
> 
> Does snybody knwo if the current releases of perl have been certified
> for millennium compliance ?

I know that Perl complies with all Directives from The Millenium;
but my CPR instructor won't issue the certification.

John Porter


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

Date: 4 Sep 1998 14:04:16 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Misinterpreted => why no true/false keywords?
Message-Id: <904917781.474467@thrush.omix.com>

Anton Berezin <tobez@plab.ku.dk> wrote:
: 	Will also initialize the %FIELDS hash if one of the base classes has
: 	it.
: Please note this ``roughly''.  And ``initialize the %FIELDS'', also.
        >snip<

        New features.  The %FIELDS stuff didn't exist in 5.004*, and with
        5.005* being such a major pain to switch to safely (in large
        systems at least), 5.004 will be with us longer then 4*... :-(

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: Fri, 4 Sep 1998 14:38:03 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: object refs and memory handling
Message-Id: <EyrKnG.9MG@world.std.com>

"Simon Taylor" <sztaylor@alaska.net> writes:

>Question 1:
>I'm curious how perl handles re-assignment of object refs?  For example:

>$objRef = class->new();
>$objRef = $objRef->subReturnsNewInstance();

>Is the memory allocated for the orginal instance of class "orphaned" in this
>case?  If yes do I need to write a "copy constructor" as in C++, or is there
>a different perl-style solution?

Perl data is reference counted. Each time a new reference is made to a
piece of data, the reference count is incremented. Once removed, it is
decremented. Once the reference count goes to zero, the object is
deleted. Making some test cases for yourself that use the DESTROY
method of a object might be interesting exercise.

#!/usr/bin/perl -w

use strict;

package Foo;

sub new {
  my $class = shift;
  my $obj = bless {}, $class;
  print STDERR "creating $obj\n";
  return $obj;
}

sub clone {
  my $self = shift;
  my $class = ref $self;
  new $class;
}

sub DESTROY {
  my $self = shift;
  print STDERR "destroying $self\n";
}


package main;

my $objRef = Foo->new();
$objRef = $objRef->clone();
print "bye bye\n";

-- 
Andrew Langmead


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

Date: Fri, 04 Sep 1998 10:44:44 -0500
From: Liz Castro <Liznet@cookwood.com>
Subject: or vs || with open function
Message-Id: <35F00AE8.E644E3C9@cookwood.com>

On page 191 of the 2nd edition Camel, under the explanation for the open
function, it says:

"(And you must also be careful to use "or die" after the statement rather than
"|| die", because the precedence of || is higher than list operators like open.)

Throughout the 2nd edition Llama book, Schwartz consistently uses "|| die".
And in all the scripts I've downloaded and looked over, they also use "||
die". 

What's the deal?

Thanks,
Liz


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

Date: Fri, 4 Sep 1998 08:31:12 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: or vs || with open function
Message-Id: <MPG.1059a79ad98066d4989828@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <35F00AE8.E644E3C9@cookwood.com> on Fri, 04 Sep 1998 10:44:44 
-0500, Liz Castro <Liznet@cookwood.com> says...
> On page 191 of the 2nd edition Camel, under the explanation for the open
> function, it says:
> 
> "(And you must also be careful to use "or die" after the statement rather than
> "|| die", because the precedence of || is higher than list operators like open.)
> 
> Throughout the 2nd edition Llama book, Schwartz consistently uses "|| die".
> And in all the scripts I've downloaded and looked over, they also use "||
> die". 
> 
> What's the deal?

The deal has to do with precedence.  If you assiduously use parentheses 
around the arguments to 'open', then either disjunction will work.  And 
that is the style of the Llama.

(I choose to leave them off whenever possible for built-in functions, and 
always to use them for my own subroutines, as a sort of visual mnemonic, 
but that is probably just a personal quirk.)

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


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

Date: 4 Sep 1998 14:48:02 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Parsing XML and HTML (was: Re: Better Regular Expressions)
Message-Id: <904920407.127316@thrush.omix.com>

Abigail <abigail@fnx.com> wrote:
: That of course has nothing to do with HTML vs XML. XML isn't going
: to make authors smart.
        >snip<

        Ahh!  But that's where I think you may be wrong.  There is
        bad HTML because everything accepts bad HTML, sometimes even
        better then it does valid HTML.

        After the fiasco that has been HTML, I think most people will
        be sticking to the strict XML spec and properly blowing chunks
        on bad code.

        XML is also far beyond HTML in complexity, and although nothing
        close to full blown SGML I don't think it is really simple enough
        for most current HTML authors to grasp directly.  I see XML
        authoring tools and code generators being the norm, which will only
        help prevent human errors and bad markup.

: And it's considered a feature that browsers try to do the right thing on
: broken HTML.

        Some of us consider it a bug.

: Just like Perl is very forgiving.

        Perl *never* accepts invalid code.  Try to leave off a paren or
        mismatch your brackets like this {( }) some time and see if it
        still runs.

        "Forgiving" in terms of loose data types and such is one thing.
        Accepting invalid code is another entirely.

: Would you want a television that goes blank when it receives a signal
: that's not 100% clear,

        This is analog vs digital, and as such doesn't apply.

: or a computer that reboots whenever an application encounters an error?

        I don't know of a single computer ever made that will detect
        invalid machine code and try to "do the right thing".

        >snip<
:     This makes parsing easier, but it doesn't matter for tokenizing,
:     and that's what's being discussed here.

        "Re: Parsing XML and HTML (was: Re: Better Regular Expressions)"

        Funny, I thought parsing was what we were talking about here?

:  4) No CDATA declared content.
:     This makes tokenizing easier, as no knowledge of a DTD is needed
:     (together with 1) and 2)).

        I'll have to double check my copy of the spec.  I could have
        swarn there was CDATA stuff defined.

:  5) Tags and attributes are case sensitive.
:     Does this make things easier? Maybe.

        In perl, probably not much if any.  In other languages, a little.

        If you're using Unicode it can help a lot and cut down processing
        time quite a bit as well.

:  7) Character sets.
:     Various character sets are allowed for XML documents, including 
:     ASCII, ISO-8859-*, UTF-8, UTF-16, EBCDIC and USC-4. UTF-8 support is
:     only supported in the newest development releases of Perl, and there's
:     no sign of UTF-16 or USC-4 support. UTF-8 and UTF-16 support is a
:     requirement for XML parsers.

        There's nothing that says a Perl XML parser has to be in Perl.  It
        would probably be better done as a C/C++ XS module, and once it's
        in a data structure or object it won't matter anyway, for the most
        part.

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: 12 Jul 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 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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