[25232] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7477 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Dec 2 21:05:44 2004

Date: Thu, 2 Dec 2004 18:05:05 -0800 (PST)
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, 2 Dec 2004     Volume: 10 Number: 7477

Today's topics:
    Re: $ in text string <amead@comcast.net>
    Re: $ in text string <jgibson@mail.arc.nasa.gov>
    Re: $ in text string <brian_helterline@hp.com>
    Re: $ in text string <tadmc@augustmail.com>
    Re: [Proposal] Q: RE lexical scopes and sub declaration <bik.mido@tiscalinet.it>
    Re: [Proposal] Q: RE lexical scopes and sub declaration (Anno Siegel)
    Re: [Proposal] Q: RE lexical scopes and sub declaration <tadmc@augustmail.com>
    Re: A problem with fork() and managing processes <bik.mido@tiscalinet.it>
    Re: A problem with fork() and managing processes <bik.mido@tiscalinet.it>
    Re: A problem with fork() and managing processes xhoster@gmail.com
    Re: A problem with fork() and managing processes xhoster@gmail.com
    Re: executable perl man pages <matthew.garrish@sympatico.ca>
        FAQ 4.41: How can I remove duplicate elements from a li <comdog@panix.com>
    Re: how to manage phpBB, windows 2003 server and FreeBS <bik.mido@tiscalinet.it>
        pb solved!!! Re: dmake.exe:  Error code 255, while maki <thirault@liberation.fr>
        Perl / MySql / Shopping cart <grapeape88@hotmail.com>
    Re: Perl Books <bik.mido@tiscalinet.it>
    Re: Perl Books <uri@stemsystems.com>
    Re: Perl Books <spamtrap@dot-app.org>
    Re: Perl Books <uri@stemsystems.com>
    Re: Problem parsing tcpdump tcp[13] output (Michael Fuhr)
        testing for existence of an inline file with Inline::Fi (Sven Wolf)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 02 Dec 2004 13:37:25 -0600
From: Alan Mead <amead@comcast.net>
Subject: Re: $ in text string
Message-Id: <pan.2004.12.02.19.37.24.249392@comcast.net>

On Thu, 02 Dec 2004 10:06:33 -0700, Terri wrote:

> I'm brand new to perl any help would be appreciated. I have a perl script
> that parses 2 files and imports data into a database. One file maps field
> names between the data source and destination. The other file is the source
> of the data.  The script was working fine until I needed to add a field
> called $custom1.

Insert 'use strict;' at the top of your script.  Fix the resulting errors.
Or, if you cannot, post a small example of your code and we'll try to help.

-Alan


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

Date: Thu, 02 Dec 2004 12:05:31 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: $ in text string
Message-Id: <021220041205310394%jgibson@mail.arc.nasa.gov>

In article <conidb$b54$1@reader2.nmix.net>, Terri <terri@cybernets.com>
wrote:

> I'm brand new to perl any help would be appreciated. I have a perl script
> that parses 2 files and imports data into a database. One file maps field
> names between the data source and destination. The other file is the source
> of the data.  The script was working fine until I needed to add a field
> called $custom1.
> 
> In my mapping fiel a line might look like this:
> 
> Table1.Field1 = price.price
> 
> The above works. This wont work.
> 
> Table1.Field1 = price.$custom1
> 
> Instead of getting the value of $custom1 in my destination field I get the
> string "price"
> 
> I understand that the $ is used to declare a variable in perl. How can I get
> perl to interpret $custom1 as a string and not a variable?

Put it in single quotes: '$custom1' or q/$custom1/


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

Date: Thu, 2 Dec 2004 12:44:25 -0800
From: "Brian Helterline" <brian_helterline@hp.com>
Subject: Re: $ in text string
Message-Id: <41af816a$1@usenet01.boi.hp.com>


"Terri" <terri@cybernets.com> wrote in message
news:cono5p$crj$1@reader2.nmix.net...
>
> I realize I 'm not giving you much to go on. I going to experiment with
> using single and double quotes. Eval() often appears in the code. I'll
> continue to look at this and post back if I can formulate a more precise
> question with sample code.
> Thanks
>
If you want another shot in the dark, try
price.\$custom1




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

Date: Thu, 2 Dec 2004 15:49:15 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: $ in text string
Message-Id: <slrncqv3er.c49.tadmc@magna.augustmail.com>

Terri <terri@cybernets.com> wrote:


> Thanks to both of you for replying. I didn't post the code because I didn't
> write it, I don't understand it, it's long, and it's copyrighted by a
> third-party vendor.


Then ask the vendor to fix it.


> Eval() often appears in the code. 


That can be very dangerous, I hope the vendor is a True Expert, else
there is a very high probability that the code opens security holes...

My guess is that the vendor is a script kiddie, and that the
many eval()s are not strictly necessary.

Who is the vendor?

What is the name of their software?

Surely they won't object to you giving that info out, it is
free advertising for them!


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Thu, 02 Dec 2004 21:10:27 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: [Proposal] Q: RE lexical scopes and sub declarations
Message-Id: <aaruq05eicbk4docp7a7dgsn94mm585fhv@4ax.com>

On Wed, 01 Dec 2004 12:49:04 +0100, Michele Dondi
<bik.mido@tiscalinet.it> wrote:

>This is Yet Another Humble Proposal... I am aware of the risks of
>exposing possibly naive ideas like this, but I'm asking anyway.

"Utter nonsense", then?


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: 2 Dec 2004 21:50:55 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: [Proposal] Q: RE lexical scopes and sub declarations
Message-Id: <coo2nv$60i$1@mamenchi.zrz.TU-Berlin.DE>

Michele Dondi  <bik.mido@tiscalinet.it> wrote in comp.lang.perl.misc:
> This is Yet Another Humble Proposal... I am aware of the risks of
> exposing possibly naive ideas like this, but I'm asking anyway.

Well... not to say these questions couldn't be interesting, but
they hit the average clpm regular in the wrong mode.  For one thing,
we are tuned to thinking in Perl, not about Perl, which is an entirely
different business.  Also, a reasoned answer to such a proposal takes
more time than the average question.  My first reaction was the standard
"Would take too long to answer, so next".  That is not rejection of
the idea, but refusal to look at it (now).  On Usenet, you got to
learn to read the silence.  If it were immediately recognizable as
nonsense (as you implied in your followup), you'd have heard about it.

However, after doing my homework, I don't think it's viable.  See below.

> I wonder wether forward declaring a sub in a lexical scope could be
> made to let the actual sub access variables lexically scoped to it. In
> other words if
> 
>   {
>       my $u;
>       sub u;
>   }
>   
>   # ...
>   
>   sub u { 
>       $u;
>   }
> 
> could be made to be implicitly equivalent to
> 
>   {
>       my $u;
>       sub u { 
>   	$u;
>       }
>   }

You mean you want to declare a lexical variable in one block, and use
it in another?  Oh boy, is that wrong!  It breaks the concept of lexical
scope, in a long-distance way.  I don't think you'll find fans on p5p
for this.

Anno


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

Date: Thu, 2 Dec 2004 16:48:00 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: [Proposal] Q: RE lexical scopes and sub declarations
Message-Id: <slrncqv6t0.c61.tadmc@magna.augustmail.com>

Michele Dondi <bik.mido@tiscalinet.it> wrote:
> On Wed, 01 Dec 2004 12:49:04 +0100, Michele Dondi
><bik.mido@tiscalinet.it> wrote:
> 
>>This is Yet Another Humble Proposal... I am aware of the risks of
>>exposing possibly naive ideas like this, but I'm asking anyway.
> 
> "Utter nonsense", then?


I thought so because you can use a vanilla forward declaration
along with the more proper closure that you had presented.

   sub foo;

   ...

   {  my $foovar;
      sub foo {  ... }
   }


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Thu, 02 Dec 2004 21:10:29 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: A problem with fork() and managing processes
Message-Id: <7bruq0d06j4lbktjrbpbasfik3iopqk944@4ax.com>

On Wed, 01 Dec 2004 12:49:04 +0100, Michele Dondi
<bik.mido@tiscalinet.it> wrote:

>I hope that the subject is not too imprecise and that this is not too
>OT (I am aware that part of the issue is OS-specific rather than
>Perlish)...
>
>I was experimenting with fork(), signals, and other process management
>functions in perl. I am reproducing a minimal example here:

Any idea?

Note: if you think that it would be appropriate, I can make a followup
restating the problem and crossposting it to an OS specific newsgroup.
Any recommendation?


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Fri, 03 Dec 2004 00:01:05 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: A problem with fork() and managing processes
Message-Id: <2c5vq0la150c6fdaqko5f0e0gg6tfut7su@4ax.com>

On 2 Dec 2004 14:20:08 GMT, anno4000@lublin.zrz.tu-berlin.de (Anno
Siegel) wrote:

>>       local $SIG{TERM} = sub { 
>>           kill 15, @family;
>>           waitpid $_, 0 for @family;
[snip]
>>   	next if $forked;
>>   	kill 15, @family;
>>           goto &rest;

>You have no SIGCHLD handler anywhere, so the seven zombies are simply
>the seven original children of your main process.  They *must* be
>zombies as long as the parent runs.  The second-generation processes
>don't become zombies because their parents are dead.

First of all let me thank you so much for answering. As it must be
clear I'm trying my hand at 'this kind of things' but I don't have
much specific knowledge about them. So all in all this experience is
revealing to be very instructive and rewarding...

>I don't know about the active processes, but that may clear itself
>up when you fix the missing handler.

I must admit that it took me some time to understand what you meant,
or rather to understand why it is actually so. In fact I did read some
relevant docs (both from signal(7) and 'perldoc perlipc').

I had naively assumed that signaling on the one hand and handling
signals on the other one would have been all that was needed. I added
the

             waitpid $_, 0 for @family;

line "only" because I thought it would have been better to die only
after all of one's childs are gone.

Following your advice I was about to add

  local $SIG{CHLD} = sub { waitpid $_, 0 for @family };

too, when I guessed that maybe I could simply do for the firestarting
code what I was already doing for the propagation one instead. So I
*tried* adding a

        waitpid $_, 0 for @family;

line soon after the second

   	kill 15, @family;

in the code quoted above and... et voila', indeed it does seem to work
as expected. Do you think I should also install a SIGCHLD handler
anyway?

Also, as far as the randomic persistence of non-zombie instances goes,
I *think* that it may be related to the process removal phase
beginning too early, possibly "interfering" with the "diffusion" one
which may not be terminated yet for some of the forked processes: to
be fair I cannot see clearly what was going on, but indeed even before
making the modifications described above I tried adding

     	sleep 5;

soon after

     	next if $forked;

and that solved the problem in a repeated series of tests (in a
perfectly identical situation to the previous ones): i.e. I "only" got
the seven little zombies. And now they're gone too!

As a qualitative observation, it *seems* to me that if I leave out the
C<sleep 5;> statement in the version that does correct child
management, also these randomic misbehaviours are more rare -
certainly not absent! but I wouldn't swear on this.

Now I don't know if 5 seconds is appropriate or if there are
alternative stategies at all (I mean: that simple!) but as I said it
seems to work well in all tests I've done so far.

For reference the complete minimal example program now looks like
this:


  #!/usr/bin/perl -l
  
  use strict;
  use warnings;
  
  sub busy ();
  sub rest();
  sub killnwait;
  
  sleep 5;
  busy;
  
  sub busy () {  # Let the fun begin!! ;-)
      my $forked=0;
      my @family;
      for (1..7) {
  	defined (my $pid=fork) or
  	  warn "Couldn't fork: $!\n";
  	$forked *= 2;
  	if ($pid) {
  	    push @family, $pid;
  	} else { 
              @family=();
              $forked++;
  	}
      }
      
      local $SIG{TERM} = sub { 
          killnwait @family;
  	die "[$forked:$$] Stopping now: ",
            "signaled (@family)\n"
      };
      
      while (1) {
  	next if $forked;
          sleep 5;
          killnwait @family;
          goto &rest;
      }
  }
  
  sub rest () {
     sleep 10 while 1;
  }
  
  sub killnwait {
  	kill 15, @_;
          waitpid $_, 0 for @_;
  }
  
  __END__


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: 03 Dec 2004 00:50:30 GMT
From: xhoster@gmail.com
Subject: Re: A problem with fork() and managing processes
Message-Id: <20041202195030.921$bQ@newsreader.com>

Michele Dondi <bik.mido@tiscalinet.it> wrote:
>
>       local $SIG{TERM} = sub {
>         kill 15, @family;
>           waitpid $_, 0 for @family;

Here you wait for your family.

>         die "[$forked:$$] Stopping now: ",
>             "signaled (@family)\n";
>       };
>
>       while (1) {
>         next if $forked;
>         kill 15, @family;

Here you don't.

>           goto &rest;
>       }
>   }
>
>   sub rest () {
>      sleep 10 while 1;
>   }
>
>   __END__
>
> It should (i) fork() up to 127 copies of itself, (ii) kill them and
> then go to rest.
>
> Now, *generally* it works, *but* (i) it still leaves around exactly
> seven <defunct> childs; (ii) what's worst, *in some cases*
> (appearently at random), it leaves a small but variable number of
> active childs too.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


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

Date: 03 Dec 2004 01:06:17 GMT
From: xhoster@gmail.com
Subject: Re: A problem with fork() and managing processes
Message-Id: <20041202200617.510$aR@newsreader.com>

Michele Dondi <bik.mido@tiscalinet.it> wrote:
>
> Also, as far as the randomic persistence of non-zombie instances goes,
> I *think* that it may be related to the process removal phase
> beginning too early, possibly "interfering" with the "diffusion" one
> which may not be terminated yet for some of the forked processes:

You don't install the sig term handler until after the for loop.  The
parent finishes all seven trips through the loop and starts killing its
family.  But some members of the family maybe haven't quite finished their
trips through the loop at the time they are sent a TERM by the parent.
Since they haven't yet installed the handler, they don't execute the
handler code.  So *their* children never get killed.  I think that just
moving the handler assingment to before the for loop should fix the
problem.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


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

Date: Thu, 2 Dec 2004 19:10:55 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: executable perl man pages
Message-Id: <faOrd.23032$Ad3.1709256@news20.bellglobal.com>


"Lynn David Newton" <lynn.newton@cox.net> wrote in message 
news:87d5xs944u.fsf@cox.net...
>
> I've been programming in Perl for about five years. Yesterday I was
> leafing though some things at the beginning of the Camel book, which I
> just bought, and found the place on page xxv where it says that one
> may run the name of a Perl man page as an executable, with a search
> pattern argument, e.g.,
>

[snip explanation of it not working]

>
> So what are all those systems missing to make that capacity possible,
> assuming that the Camel book knows what it's talking about and that
> all the systems I can access are missing something?
>

Those tools never got bundled with Perl. Google on pmtools if you're 
interested, or check here:

http://groups.google.com/groups?q=g:thl684537337d&dq=&hl=en&lr=&selm=39fdbbaf%40cs.colorado.edu&rnum=26

and here:

http://www.cpan.org/misc/cpan-faq.html#How_installed_modules

(Just scroll down a bit on the last one)

Matt 




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

Date: Thu, 2 Dec 2004 23:03:01 +0000 (UTC)
From: PerlFAQ Server <comdog@panix.com>
Subject: FAQ 4.41: How can I remove duplicate elements from a list or array?
Message-Id: <coo6v4$nal$1@reader1.panix.com>

This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with Perl.

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

4.41: How can I remove duplicate elements from a list or array?

    There are several possible ways, depending on whether the array is
    ordered and whether you wish to preserve the ordering.

    a)  If @in is sorted, and you want @out to be sorted: (this assumes all
        true values in the array)

            $prev = "not equal to $in[0]";
            @out = grep($_ ne $prev && ($prev = $_, 1), @in);

        This is nice in that it doesn't use much extra memory, simulating
        uniq(1)'s behavior of removing only adjacent duplicates. The ", 1"
        guarantees that the expression is true (so that grep picks it up)
        even if the $_ is 0, "", or undef.

    b)  If you don't know whether @in is sorted:

            undef %saw;
            @out = grep(!$saw{$_}++, @in);

    c)  Like (b), but @in contains only small integers:

            @out = grep(!$saw[$_]++, @in);

    d)  A way to do (b) without any loops or greps:

            undef %saw;
            @saw{@in} = ();
            @out = sort keys %saw;  # remove sort if undesired

    e)  Like (d), but @in contains only small positive integers:

            undef @ary;
            @ary[@in] = @in;
            @out = grep {defined} @ary;

    But perhaps you should have been using a hash all along, eh?



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

Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short.  They represent an important
part of the Usenet tradition.  They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.

If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile.  If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.

Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release.  It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.

The perlfaq manual page contains the following copyright notice.

  AUTHOR AND COPYRIGHT

    Copyright (c) 1997-2002 Tom Christiansen and Nathan
    Torkington, and other contributors as noted. All rights 
    reserved.

This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.


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

Date: Thu, 02 Dec 2004 21:10:20 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: how to manage phpBB, windows 2003 server and FreeBSD user accounts simultaneously.
Message-Id: <1mruq05i7rjeu4t2escijpj70f896pnnti@4ax.com>

On 1 Dec 2004 18:36:30 -0800, jiing.deng@gmail.com (jiing) wrote:

>My boss told me phpBB part can be solved by directly access the mySQL database.

Then perl offers excellent support for this kind of things. Please
check

  perldoc -q SQL


HTH,
Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Thu, 2 Dec 2004 22:51:44 +0100
From: "tt" <thirault@liberation.fr>
Subject: pb solved!!! Re: dmake.exe:  Error code 255, while making 'test'
Message-Id: <coo2q7$j4r$1@s5.feed.news.oleane.net>


"tt" <thirault@liberation.fr> a écrit dans le message de news: 
col6sp$p1i$1@s5.feed.news.oleane.net...
>
> "Michael Carman" <mjcarman@mchsi.com> a écrit dans le message de news: 
> coirg7$2vs1@onews.rockwellcollins.com...
>> Please don't top-post. Place your comments *after* the text you are
>> replying to. [post reordered]
>>
>> tt wrote:
>>>
>>> "Ben Morrow" <usenet@morrow.me.uk> a écrit dans le message de news:
>>> eckp72-ts4.ln1@osiris.mauzo.dyndns.org...
>>>
>>>> Quoth "tt" <thirault@liberation.fr>:
>>>>>
>>>>> [Alternative: text/html]
>>>>
>>>> Don't do that.
>>>>
>>>>> [Attachment type=image/gif, name=BlankBkgrd.gif]
>>>>
>>>> And *certainly* don't do that.
>>>
>>> I don't understand.
>>
>> Usenet is a textual medium. Don't post markup (like HTML). Not everyone
>> is using a newsreader that understands such things. Similarly, don't
>> post binaries (like images). [There are newsgroups where posting of
>> binaries is permitted, but these usually have "binaries" somewhere in
>> their name.]
>>
>> -mjc
>
> Ok thanks for informations.
>
> t
>
Hello,
I finally found the pb, that was I haden't put enough informations in the 
path environment variable. I put finally all this:

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program 
Files\Fichiers communs\Roxio 
Shared\DLLShared;C:\MinGW\MinGW\bin;C:\Perl\perl-5.8.5\win32;C:\Perl\perl-5.8.5\win32\startup;C:\Perl\perl-5.8.5\win32\bin;

It ran after I added the last three items ( C:\Perl\perl-5.8.5\win32\startup 
is the dmake folder I put here ). I'm not sure the three were required.
This wasn't mentioned in the perl's windows Readme file.

Thanks
bye.
 




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

Date: Fri, 03 Dec 2004 00:45:40 GMT
From: "Tony M M" <grapeape88@hotmail.com>
Subject: Perl / MySql / Shopping cart
Message-Id: <UGOrd.133732$5K2.15385@attbi_s03>


Has anyone on this message group ever thought of modifying, or building a
shopping cart that is real world and usable then putting it out to the
populous?

What I see is bloated, non working perl scripts that are missing the mark in
the area.

I see one script that seems like a perfect starting point but needs to be
developed and a simple hack like I am is unable to get it to interact with a
real time credit card processor. (
http://www.digitalpressworks.com/shoppingcart.html )

That is a great starting point with the cart. After that it needs two types
of things to be built -- accounting and inventory ability (using MySql).

I asked this question after looking at perl shopping carts for the last 6
months and seeing what  I indicated above.... If this has been tackled in
the past could anyone point me to the thread? If not, is this the type of
newsgroup that participates like this?

Thank you,

Tony <Mike> M.




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

Date: Thu, 02 Dec 2004 21:10:26 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Perl Books
Message-Id: <uiquq0d2ofjngpbshg7kk47528eb86os28@4ax.com>

On 2 Dec 2004 02:07:30 GMT, "A. Sinan Unur" <1usa@llenroc.ude.invalid>
wrote:

>> # Catogarizing the input
>
>Non-sensical comments are worse than no comments at all.

Maybe it does make sense to a Catogary Thoery expurt...


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Thu, 02 Dec 2004 21:34:05 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Perl Books
Message-Id: <x7is7ke65v.fsf@mail.sysarch.com>


me thinks we scare the kid away. he asked for feedback and help and
didn't seem to be able to handle the results. be careful what you ask
for. now the question is will he learn from this and learn more perl? as
other have stated english is probably not his first language so will he
write in his native language? is there demand in that language for perl
help (or at least decent perl help)?

i always wonder how people like this learn perl in a vacuum and think
they actually know it. he kept refering to other languages (which isn't
always a good idea, assuming your reader know those langs) as if he knew
them well too. generally if you are very good at coding in one lang it
isn't hard to learn others. those who can't code well in one are usually
bad in all :).

oh well. we must have burst his bubble.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: Thu, 02 Dec 2004 16:53:43 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Perl Books
Message-Id: <scqdnTur9956EzLcRVn-uw@adelphia.com>

Uri Guttman wrote:

> now the question is will he learn from this and learn more perl?

Doubtful. He'll probably just go cry in aother forum about how "mean" 
those "Perl people" were to him. It's amazing how many people can't tell 
the difference between honesty and hostility.

> he kept refering to other languages (which isn't
> always a good idea, assuming your reader know those langs)

I agree, it's not ideal - but we should be careful about throwing stones 
here. The official docs are guilty of that too, they often refer to 
shell and C.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: Thu, 02 Dec 2004 22:19:27 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Perl Books
Message-Id: <x77jo0e429.fsf@mail.sysarch.com>

>>>>> "SP" == Sherm Pendley <spamtrap@dot-app.org> writes:

  SP> Uri Guttman wrote:

  >> he kept refering to other languages (which isn't
  >> always a good idea, assuming your reader know those langs)

  SP> I agree, it's not ideal - but we should be careful about throwing
  SP> stones here. The official docs are guilty of that too, they often
  SP> refer to shell and C.

but that is legit since perl derives much from those langs and it is
useful to point that out and such. but bringing c++ into it is silly as
perl has nothing from that (thankfully).

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: 2 Dec 2004 14:53:54 -0700
From: mfuhr@fuhr.org (Michael Fuhr)
Subject: Re: Problem parsing tcpdump tcp[13] output
Message-Id: <41af8ef2$1_1@omega.dimensional.com>

Romain <romain.lorenzini@laposte.net> writes:

> Here's my real script but I still have the same problem
>
> #!/usr/bin/perl
> $commande = "tcpdump -vvni eth1 tcp[13] == 18";
> print "$commande\n";
> ($pid = open(PIPE,"$commande |")) or die "Error: $!\n";
> while (defined($line = <PIPE>))
> {
>          print $line;
> }
>
> When I redirect the tcpdump command in a file and I do a cat file.log | 
> ./test.pl, it works fine.

Here's an example that should point you toward what's wrong:

#!/usr/bin/perl

use strict;
use warnings;

foreach my $i (1..5) {
    print "$i\n";
    sleep 1;
}

Run this script from the shell prompt, then run it again and pipe
the output into cat.  Notice a difference in behavior?  Think about
why that is.  Find out how to make this script behave the way you
want when its output is piped, then read the tcpdump manual page
and check if tcpdump has a way to do the same thing.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/


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

Date: 2 Dec 2004 16:28:32 -0800
From: swolf2@yahoo.com (Sven Wolf)
Subject: testing for existence of an inline file with Inline::Files
Message-Id: <919461e0.0412021628.759f5d40@posting.google.com>

Hello,

I'm using Inline::Files, which allows me to put data after __FOO__ in
a file and then to read it with "while (<FOO>) {...}" or @lines =
<FOO>;

This works fine as long as there is such a section defined.  However,
I haven't been able to figure out how to check whether such a section
exists in the first place.  Say I have the name of a possible section
in $sec, e.g.
   $sec = 'main::MYCANDIDATE';
If I just go ahead with
   @lines = <$sec>;
I get a read-from-unopened-filehandle error if there is no section
__MYCANDIDATE__ in the script.  This works fine if the section
appears.

Can someone suggest a test to apply before attempting to read?

Things I've tried:
1.
   open IN, "<$sec" or ...;
which doesn't work because $sec itself is the (indirect) filehandle.
2.
   open $sec or ...;
   open sec or ...;
both also didn't work.  Both fail even if the section appears.
3.
   no strict refs;
   my $cand = 'MYCANDIDATE';
   if (exists ${$sec}{file}) { ... } 
   # or: if (exists $main::{$cand}{file}) { ... } 
gives the mysterious "unknown error" at runtime, though the Perl
Cookbook says that there should be a hash %MYCANDIDATE with data about
the handle to the inline file, in particular a key "file".

I have a workaround which requires users in effect to declare the
sections first, but I'd like to understand this better.


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

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

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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.

#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 V10 Issue 7477
***************************************


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