[11958] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5558 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 4 08:08:48 1999

Date: Tue, 4 May 99 05:00:21 -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           Tue, 4 May 1999     Volume: 8 Number: 5558

Today's topics:
        ==> Dynamic Hash Naming <== <Andreas.Fischer@germany.Sun.COM>
    Re: ==> Dynamic Hash Naming <== <tchrist@mox.perl.com>
    Re: A public apology based on private thoughts :-) <sb@sdm.de>
        APACS credit card authorisation <clint@drtech.co.uk>
    Re: Declaration Help Please!! (Bob Trieger)
    Re: GETting a Web-Site with IO::Socket::INET <keitgen@keitgen.de>
    Re: How do i print something using perl? <nospam.newton@gmx.net>
    Re: How to distinguish between cron-startup and command (Sam Holden)
    Re: How to flush CGI output? (I.J. Garlick)
    Re: inserting "|" and " ' " to Access???? jckchan@hotmail.com
    Re: inserting "|" and " ' " to Access???? <nospam.newton@gmx.net>
    Re: ISPs that offer cgi space?? <webmaster@chatbase.com>
    Re: JavaScript/PERL for dynamic form generation <rhardicr@hotmail.com>
        must be better way christine@techresource.org
    Re: must be better way <cschmitz@stud.informatik.uni-trier.de>
    Re: must be better way <rhardicr@hotmail.com>
    Re: New posters to comp.lang.perl.misc <nospam.newton@gmx.net>
        Perl and Password <fmee@lfi.uni-hannover.de>
        Perl calling C++?? cathalgallagher@my-dejanews.com
    Re: Perl on a 386 with 2 MB RAM??? (David Cantrell)
    Re: Perl on a 386 with 2 MB RAM??? <fmee@lfi.uni-hannover.de>
    Re: Problem in calling subroutine inside another routin (Bob Trieger)
        problems substituting \' with ' (ignore if you hate ama <hauk@forumnett.no>
    Re: sending email <nospam.newton@gmx.net>
    Re: Simple question (Bob Trieger)
    Re: Using 'Require' in ASP <matt-news@sergeant.org>
    Re: Using 'Require' in ASP <gellyfish@gellyfish.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Tue, 04 May 1999 12:03:07 +0200
From: Andreas Fischer <Andreas.Fischer@germany.Sun.COM>
Subject: ==> Dynamic Hash Naming <==
Message-Id: <372EC5DB.87B78A7A@germany.Sun.COM>

I post this for al College...

Hi Chaps,

I created a peace of code that opens a file and reads in 72 lines into
an array 
of a hash. Each hash name is dynamicly crated ($hostn) in line 28.
The varibale $hostn is used in row 37 as a hash reference. In this case
it is 
statet as a uninitialized value.
In line 38 and 39 I used value $host with a number between 10 and 71 and
that 
works.

But why ??????

Please see Input, Code and Output of the program.

Cheers

   ...Alex



Input :
=======

ASCII Text file with 72 lines and 10 clumns.

Code :
======

 1 #!/usr/local/bin/perl -w
      2 # Read ASCII Table and parse in memory table
      3 # Memorytable used with hashes of array
      4 # Editor: Alexander Rockstroh
      5 # Date : 03-Mai-99
      6 # Version : 1.0
      7 # decalaration area
      8 $i=0;
      9 $main_path="../DB/main.txt";
     10 open (MAINTAB, $main_path);
     11 
     12 
     13 
     14 #read the contents of main table
     15 while (<MAINTAB>)
     16 {
     17 if ($i==0)
     18   {
     19   #read the headerline of the main.txt table
     20   @header=split /\t+/,$_;
     21   print "@header \n";
     22   $i++;
     23   $i_header=scalar(@header);
     24   print "Header length: $i_header \n";
     25   }
     26 $i++;
     27 
     28 $hostn="host".$i;
     29 
     30 @row=split /\t+/,$_;
     31 print "$row[0]";
     32 %$hostn=($header[0]=>[$row[0]], $header[1]=>["a", "b","c"]);
     33 }
     34 print "\n";
     35 print "1.keys=",keys %$hostn," \n";
     36 print "2.Hostname=$hostn \n";
     37 print "3.Index=@{$hostn{$header[0]}} \n";
     38 print "4.Index=@{$host10{$header[0]}} \n";
     39 print "5.Index=$host71{$header[0]}[0] \n";
     40 
     41 


Output:
=======

Header length: 10 
indexm1-0m2-0m3-0m3-1m3-2m3-3m3-4m3-5m3-6m3-7m4-0m4-1m4-2m4-3m4-4m4-5m5-0m5-1m5-
2m5-3m6-0m6-1m6-2m6-3m6-4m6-5m6-6m6-7m7-0m8-0m9-0m9-1m9-2m9-3m9-4m9-5m10-0m10-1m
10-2m10-3m11-0m11-1m11-2m11-3m11-4m11-5m11-6m11-7m12-0m12-1m12-2m12-3m12-4m12-5m
13-0m13-1m13-2m13-3m13-4m13-5m14-0m14-1m14-2m14-3m15-0m15-1m15-2m15-3m15-4
1.keys=serialindex 
2.Hostname=host72 
Use of uninitialized value at main3.pl line 37, <MAINTAB> chunk 71.
3.Index= 
4.Index=m3-5 
5.Index=m15-4 

-- 
***************************************************************

Andreas Fischer
Technical Account Manager (Finance Team)

SUN Microsystems GmbH		Tel: (++49) 6103 752 196
Amperestr. 6			Fax: (++49) 6103 752 161
D-63225 Langen			Andreas.Fischer@germany.sun.com

***************************************************************


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

Date: 4 May 1999 05:01:54 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: ==> Dynamic Hash Naming <==
Message-Id: <372ed3a2@cs.colorado.edu>

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

Using Mozilla 4.5 [en] (X11; U; SunOS 5.6 sun4u) Andreas Fischer
<Andreas.Fischer@germany.Sun.COM> writes in comp.lang.perl.misc:

:I created a peace of code that opens a file and reads in 72 lines into
:an array  [BAD WRAP DUE TO BROKEN EXCUSE FOR A NEWSREADER]
:of a hash. Each hash name is dynamicly crated ($hostn) in line 28.
:The varibale $hostn is used in row 37 as a hash reference. In this case
:it is [BAD WRAP DUE TO BROKEN EXCUSE FOR A NEWSREADER]
:statet as a uninitialized value.
:In line 38 and 39 I used value $host with a number between 10 and 71 and
:that [BAD WRAP DUE TO BROKEN EXCUSE FOR A NEWSREADER]
:works.

Sigh.  Another variable-name-in-variable bug.  Please use
a multi-level hash.  Here's the FAQ you didn't read.

--tom

=head2 How can I use a variable as a variable name?

Beginners often think they want to have a variable contain the name
of a variable.

    $fred    = 23;
    $varname = "fred";
    ++$$varname;         # $fred now 24

This works I<sometimes>, but it is a very bad idea for two reasons.

The first reason is that they I<only work on global variables>.
That means above that if $fred is a lexical variable created with my(),
that the code won't work at all: you'll accidentally access the global
and skip right over the private lexical altogether.  Global variables
are bad because they can easily collide accidentally and in general make
for non-scalable and confusing code.

Symbolic references are forbidden under the C<use strict> pragma.
They are not true references and consequently are not reference counted
or garbage collected.

The other reason why using a variable to hold the name of another
variable a bad idea is that the question often stems from a lack of
understanding of Perl data structures, particularly hashes.  By using
symbolic references, you are just using the package's symbol-table hash
(like C<%main::>) instead of a user-defined hash.  The solution is to
use your own hash or a real reference instead.

    $fred    = 23;
    $varname = "fred";
    $USER_VARS{$varname}++;  # not $$varname++

There we're using the %USER_VARS hash instead of symbolic references.
Sometimes this comes up in reading strings from the user with variable
references and wanting to expand them to the values of your perl
program's variables.  This is also a bad idea because it conflates the
program-addressable namespace and the user-addressable one.  Instead of
reading a string and expanding it to the actual contents of your program's
own variables:

    $str = 'this has a $fred and $barney in it';
    $str =~ s/(\$\w+)/$1/eeg;		  # need double eval

Instead, it would be better to keep a hash around like %USER_VARS and have
variable references actually refer to entries in that hash:

    $str =~ s/\$(\w+)/$USER_VARS{$1}/g;   # no /e here at all

That's faster, cleaner, and safer than the previous approach.  Of course,
you don't need to use a dollar sign.  You could use your own scheme to
make it less confusing, like bracketed percent symbols, etc.

    $str = 'this has a %fred% and %barney% in it';
    $str =~ s/%(\w+)%/$USER_VARS{$1}/g;   # no /e here at all

Another reason that folks sometimes think they want a variable to contain
the name of a variable is because they don't know how to build proper
data structures using hashes.  For example, let's say they wanted two
hashes in their program: %fred and %barney, and to use another scalar
variable to refer to those by name.

    $name = "fred";
    $$name{WIFE} = "wilma";     # set %fred

    $name = "barney";           
    $$name{WIFE} = "betty";	# set %barney

This is still a symbolic reference, and is still saddled with the
problems enumerated above.  It would be far better to write:

    $folks{"fred"}{WIFE}   = "wilma";
    $folks{"barney"}{WIFE} = "betty";

And just use a multilevel hash to start with.

The only times that you absolutely I<must> use symbolic references are
when you really must refer to the symbol table.  This may be because it's
something that can't take a real reference to, such as a format name.
Doing so may also be important for method calls, since these always go
through the symbol table for resolution.

In those cases, you would turn off C<strict 'refs'> temporarily so you
can play around with the symbol table.  For example:

    @colors = qw(red blue green yellow orange purple violet);
    for my $name (@colors) {
        no strict 'refs';  # renege for the block
        *$name = sub { "<FONT COLOR='$name'>@_</FONT>" };
    } 

All those functions (red(), blue(), green(), etc.) appear to be separate,
but the real code in the closure actually was compiled only once.

So, sometimes you might want to use symbolic references to directly
manipulate the symbol table.  This doesn't matter for formats, handles, and
subroutines, because they are always global -- you can't use my() on them.
But for scalars, arrays, and hashes -- and usually for subroutines --
you probably want to use hard references only.
-- 
    No, I'm not going to explain it.  If you can't figure it out, you didn't
    want to know anyway...  :-)
            --Larry Wall in <1991Aug7.180856.2854@netlabs.com>


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

Date: 4 May 1999 09:46:16 GMT
From: Steffen Beyer <sb@sdm.de>
Subject: Re: A public apology based on private thoughts :-)
Message-Id: <7gmfl8$3gi$1@solti3.sdm.de>

In article <x7btg133be.fsf@home.sysarch.com>,
Uri Guttman <uri@sysarch.com> wrote:

> i would like perl to have a faq quiz before it unlocks itself to run,
> like drunks passing a automatic sobriety test before the ignition works!

Excellent idea! Any takers? (I'm not joking!)
This would be a nice feature indeed!

Maybe with an option which defaults to "on", and some way (which is
documented in the README file) of switching it "off"?

Yours,
-- 
    Steffen Beyer <sb@engelschall.com>
    http://www.engelschall.com/u/sb/whoami/
    http://www.engelschall.com/u/sb/download/
    http://www.perl.com/CPAN/authors/id/STBEY/
    http://www.oreilly.de/catalog/perlmodger/bnp/


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

Date: Tue, 4 May 1999 10:22:06 +0100
From: "Clinton Gormley" <clint@drtech.co.uk>
Subject: APACS credit card authorisation
Message-Id: <7gmdom$eoj$1@taliesin.netcom.net.uk>

Would you know if any Perl modules exist for online authorisation of credit
cards for the APACS system (as used by UK banks).

I've found nothing on CPAN.

I would like to implement this functionality on a Redhat Linux box but there
seems to be little in the way of software out there.

Many thanks

Clint





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

Date: Tue, 04 May 1999 10:57:57 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Declaration Help Please!!
Message-Id: <7gmj3u$t9f$1@fir.prod.itd.earthlink.net>

[ courtesy cc sent by mail if address not munged ]
     
CNE_Morti <morti_cne@my-dejanews.com> wrote:
>$department = "$FORM{'dept')";
>if ( $department eq 'Information' ) {
>   $recipient = 'someone@host.com';
>}
>elsif ( $department eq 'Technical Support' ) {
>   $recipient = 'another@host.com';
>}
>
>I know this is simple, but it's late and my brain isn't working.. keep banging
>my head against the wall..

use the -w switch in your shebang line and the answer will hit you in 
the head.




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

Date: Tue, 4 May 1999 13:04:27 +0200
From: "Joe" <keitgen@keitgen.de>
Subject: Re: GETting a Web-Site with IO::Socket::INET
Message-Id: <7gmkdr$6rv$1@usenet48.supernews.com>

My server is connected to 8 Major Backbones like AOL, MAE EAST, etc. and
with 155 MBit/s connections each... so I shouldn't have too much of a
bottleneck problem with major sites...

Thanks
Joe


Daniel Grisinger <dgris@moiraine.dimensional.com> schrieb in im Newsbeitrag:
m3hfpucj7b.fsf@moiraine.dimensional.com...
> "Joe" <keitgen@keitgen.de> writes:
>
> <referring to LWP::Simple, although that isn't apparent due to
>  misplaced quotations>
>
> > This is too slow for me... It takes for ever on my server....
>
> You aren't going to find a much faster way to fetch other web
> documents.
>
> Specifically, unless you are sitting on top of a huge pipe and are
> also very close (from a network topology perspective) to your target
> site you aren't going to see any perceptible difference in methods to
> fetch remote resources via http.  You are much more constrained by
> bandwidth than anything else the vast majority of time.
>
> Perhaps you should look into some sore of caching solution.
>
> dgris
> --
> Daniel Grisinger          dgris@moiraine.dimensional.com
> perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
> m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'




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

Date: Tue, 04 May 1999 11:19:39 +0200
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
Subject: Re: How do i print something using perl?
Message-Id: <372EBBAB.B3D9A4C5@gmx.net>

Stephen Warren wrote:
> 
> I just wish you could've got Perl for CP/M:-)

Well, I had a little C compiler for CP/M -- and since Perl is so
amazingly portable, it shouldn't have been a problem to port it to the
Joyce :). (Whaddaya mean, "out of memory"?!)

Cheers,
Philip


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

Date: 4 May 1999 09:39:09 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: How to distinguish between cron-startup and command-line startup
Message-Id: <slrn7itg1t.g7s.sholden@pgrad.cs.usyd.edu.au>

On 04 May 1999 10:46:26 +0200, Joakim Hove <hove@ido.phys.ntnu.no> wrote:
>
>Hence what I would like is a way to find out from within the script
>wether it has been started from cron or from the command-line. 

You mean like in perlfaq8 :

How do I find out if I'm running interactively or not?

-- 
Sam

So I did some research. On the Web, of course. Big mistake...
	--Larry Wall


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

Date: Tue, 4 May 1999 08:27:34 GMT
From: ijg@csc.liv.ac.uk (I.J. Garlick)
Subject: Re: How to flush CGI output?
Message-Id: <FB78ty.K99@csc.liv.ac.uk>

In article <7gev8n$2o7$1@gellyfish.btinternet.com>,
Jonathan Stowe <gellyfish@gellyfish.com> writes:
> On Fri, 30 Apr 1999 13:20:38 +0300 Juho Cederstrom wrote:
> 
> Great :
> 
> -r--r--r--   1 root     root        12113 Oct  7  1998 IO/Handle.pm
> 
> 
> All for 
> 
> $| = 1;
> 
> Thats about a 1:2000 ratio of redundancy or am I missing something ?

Yep you are. It doesn't work like that (let me qualify that, according to
the camel it should but it doesn't in a CGI environment). I think I am
begining to realise that David Efflandt is correct something is cacheing
the output. I have tried $| = 1 just about everywhere in my CGI scripts
and it deosn't cause the browser to display as I call print.

And yes I do understand HTML, all of my tables and images are sized
finished etc... so theoretically accoriding to all percieved wisdom it
should display as it's creating the page but it doesn't. In fact I can get
it to work if I save the page and covert to a static HTML page.

I have accepted the fact and given up on it until someone proves otherwise
:-(

-- 
Ian J. Garlick
ijg@csc.liv.ac.uk

A computer scientist is someone who fixes things that aren't broken.



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

Date: Tue, 04 May 1999 09:03:30 GMT
From: jckchan@hotmail.com
Subject: Re: inserting "|" and " ' " to Access????
Message-Id: <7gmd51$p0u$1@nnrp1.dejanews.com>

Dear scott

Think for your help, but I don't understand it.
Would you please explain more.

When user fill the FORM (a text box). The value is stored
in a variable say $FORM{$TEXTBOX}. How to locate the "|" and
" ' "?????

Cheers


In article <372d9423.0@news.new-era.net>,
  scott@aravis.softbase.com (Scott McMahan) wrote:
> jckchan@hotmail.com wrote:
> > Dear all
>
> > I and trying to write a Form with Perl and pass the data to MS Access.
> > I am using WIN32::ODBC.
> > I have problem passing characters such as "|" and " ' ".
>
> > Is it possible to pass those characters???
>
> My company ran into this once. You can double your ' to get a quote passed
> through. It took me weeks to discover this; it is not documented. I
> did not know there was a problem with |, and have no idea how to pass
> it through.
>
> Scott
>

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


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

Date: Tue, 04 May 1999 11:34:23 +0200
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
Subject: Re: inserting "|" and " ' " to Access????
Message-Id: <372EBF1F.AF537B89@gmx.net>

jckchan@hotmail.com wrote:
> 
> When user fill the FORM (a text box). The value is stored
> in a variable say $FORM{$TEXTBOX}. How to locate the "|" and
> " ' "?????

With pattern matching?

(And next time, don't multipost to clp.misc and clp.modules -- instead,
crosspost.)

Cheers,
Philip


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

Date: Tue, 04 May 1999 00:27:14 -0700
From: TRG Software : Tim Greer <webmaster@chatbase.com>
Subject: Re: ISPs that offer cgi space??
Message-Id: <372EA152.D8B1FCA6@chatbase.com>

Mike Flaherty wrote:
> 
> I haven't looked yet but this seems like to best place to start.

Well, it's actually not the best place to start, being this NG is
dedicated and geared towards Perl. Which your question has nothing to do
with. I'm sorry I can't think of the proper NG you should be posting
this in instead or I'd point you there.

> 
> I am looking to start a web site for public use.  I know there are plenty
> of ISPs that offer web space - even for free.  However, I want to use CGI
> scripts and I will need access to a command line in order to develop/debug
> them.

You mean telnet/shell access.

> This is a non issue for the stuff I write at work but do commercial
> ISPs allow that kind of access?

I don't know about shell access, but there might be one or two,
somewhere.

> 
> Sorry if this is a no brainer.

Well, again, this isn't the NG for this question. So I won't go into
detail about it, so please consider where you post your questions. This
is very off topic and posting in the proper NG will get your question
answered faster anyway.
-- 
Regards,
Tim Greer:  chatmaster@chatbase.com / software@linkworm.com   
The Chat Base:  http://www.chatbase.com | 250,000+ hits daily Worldwide!
TRG Software & The Link Worm:  http://www.linkworm.com
Custom chat server scripts, CGI scripting in Perl/C, Trouble shooting,
Security, Modify & Debug, Freelance Scripting and more!


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

Date: Tue, 04 May 1999 08:31:22 +0100
From: Richard H <rhardicr@hotmail.com>
Subject: Re: JavaScript/PERL for dynamic form generation
Message-Id: <372EA24A.D090A32A@hotmail.com>

David Marshall wrote:
> 
> I am using a PERL script to generate a form.  This makes calls to a SQL
> database to generate a dynamic SELECTion list (L1) and executes a
> JavaScript "onChange=" event if the user wishes to add an additional
> option to that list.  This part is working fine.

Keep using the perl to retrieve the values and store them hidden in the
HTML. but dynamic selection lists are pretty much in the province of
Javascript, sorry if i could remember the url for the tutorial id tell
you.try www.hotwired.com or www.webreview.com
or the comp.lang.javascript

Richard H


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

Date: Tue, 04 May 1999 10:36:57 GMT
From: christine@techresource.org
Subject: must be better way
Message-Id: <7gmik9$te9$1@nnrp1.dejanews.com>

	I have an array like such, returned from postgres query.

@array

$array[0] is "what_i_want_a            "
$array[1] is "what_i_want_b            "
$array[2] is "what_i_want_c            "

	I want to copy the array into another and have that
array look like this.

$new_array[0] is "what_i_want_a"
$new_array[1] is "what_i_want_b"
$new_array[2] is "what_i_want_c"

	I have tried using split with code like this.

         for($i=0; @tmp_row = $result->fetchrow; $i++) {
		@top_level_cats = split /" *"/,@tmp_row;
         }

	And i get

	$top_level_cats[0] = "what_i_want_a what_i_want_b what_i_want_c"

	instead of looking like new_array as i want.

	I have also tried

        for($i=0; @tmp_row = $result->fetchrow; $i++) {
	   @top_level_cats = split / /,@tmp_row;
        }

	and many variations.


	In order to make it work  and move on i am using this
	ugly code.

         for($i=0; @tmp_row = $result->fetchrow; $i++) {
             @top_level_cats = @tmp_row;
             foreach $cat (@top_level_cats) {
                ($cat) = split / /, $cat;
             }
         }

	Can someone help?

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


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

Date: 4 May 1999 11:19:36 GMT
From: Christoph Schmitz <cschmitz@stud.informatik.uni-trier.de>
Subject: Re: must be better way
Message-Id: <7gml48$k57$1@fu-berlin.de>

christine@techresource.org wrote:
: 	I have an array like such, returned from postgres query.

: @array

: $array[0] is "what_i_want_a            "
: $array[1] is "what_i_want_b            "
: $array[2] is "what_i_want_c            "

: 	I want to copy the array into another and have that
: array look like this.

: $new_array[0] is "what_i_want_a"
: $new_array[1] is "what_i_want_b"
: $new_array[2] is "what_i_want_c"

What exactly do you want to accomplish? If you just want
to strip the trailing spaces, you can use

	@new_array = @array;

	foreach ( @new_array ) {
		s/\ +$//g;
	}

Christoph

-- 
-- Christoph Schmitz <cschmitz(at)stud.informatik.uni-trier.de> --
Trying is the first step to failure.
		-- Homer Simpson


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

Date: Tue, 04 May 1999 12:21:01 +0100
From: Richard H <rhardicr@hotmail.com>
Subject: Re: must be better way
Message-Id: <372ED81D.39A15590@hotmail.com>

christine@techresource.org wrote:
> 
>         I have an array like such, returned from postgres query.
> 
> @array
> 
> $array[0] is "what_i_want_a            "
> $array[1] is "what_i_want_b            "
> $array[2] is "what_i_want_c            "
> 
>         I want to copy the array into another and have that
> array look like this.
> 
> $new_array[0] is "what_i_want_a"
> $new_array[1] is "what_i_want_b"
> $new_array[2] is "what_i_want_c"
> 
The better way is to look up the use of map (or maybe grep), then you
can map the contents of array1 to array2 whilst doing any kind of
formatting inbetween.

Richard H


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

Date: Tue, 04 May 1999 11:38:51 +0200
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
Subject: Re: New posters to comp.lang.perl.misc
Message-Id: <372EC02B.DEE6245F@gmx.net>

Greg Bacon wrote:
> 
> Top 10 Posters by Number of Posts
> =================================
[...]
>     5    11.5 (  5.1/  4.7/  4.6)  abigail@delanet.com

Is this the "Abigail" Abigail? Did Abigail get a new account, then?

Cheers,
Philip "avoiding use of personal pronoun on purpose" Newton


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

Date: Tue, 04 May 1999 11:46:49 +0200
From: Folkert Meeuw <fmee@lfi.uni-hannover.de>
Subject: Perl and Password
Message-Id: <372EC209.62026873@lfi.uni-hannover.de>

Hi Dear Friendly Readers,
Perl isn't yet the language I program usually, usually I write in
C-Language.
But today my job is going on to perl.
I 'm working here for engenieers and they asked me 'bout actually
possibles to use
passwords and cryption in perl and known security problems.
They needed it for a Apache-Webserver ?!? What's going on there ?
Where users can select over forms, advance document data.
Maybe this sounded in the moment such little confuse, but it must going
on.
For all advices, and strongly suggests you get my thanks.

MfG Folkert Meeuw



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

Date: Tue, 04 May 1999 09:46:22 GMT
From: cathalgallagher@my-dejanews.com
Subject: Perl calling C++??
Message-Id: <7gmfle$r6s$1@nnrp1.dejanews.com>



I am looking at using Perl to test various C++ modules (stored in libraries).

 My knowledge of Perl is limited and I am currently going through the
"Learning Perl" book and reading lots of Perl info.

However based on the FAQs, discussions etc. Am I correct in concluding there
is no obvious way of instaniating a C++ object and accessing its methods from
Perl.

Therefore current proposal is that I will have to build a "C" wrapper around
the "C++" and then call this from Perl.

Is this the best solution? Has anyone done something similar? Does anyone have
alternative suggestions.

Finally if this has appeared in some FAQ somewhere I am sorry for wasting your
time. Just point me in the right direction and I will go on my way.

Cathal

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


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

Date: Tue, 04 May 1999 09:03:24 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: Perl on a 386 with 2 MB RAM???
Message-Id: <3730b7b8.1788922@news.insnet.net>

On Fri, 30 Apr 1999 18:21:13 +0200, "Ronald van der Lingen"
<166959rl@student.eur.nl> enlightened us thusly:

>Linux is not an option I think. My laptop has a harddisk of 60 MB, so there
>isn't enough space for linux.

Then please explain how I can run Linux with a single floppy disc and
no hard disk in the machine at all.

[Copying newsgroup posts to me by mail is considered rude]

-- 
David Cantrell, part-time Unix/perl/SQL/java techie
                full-time chef/musician/homebrewer
                http://www.ThePentagon.com/NukeEmUp


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

Date: Tue, 04 May 1999 11:55:24 +0200
From: Folkert Meeuw <fmee@lfi.uni-hannover.de>
Subject: Re: Perl on a 386 with 2 MB RAM???
Message-Id: <372EC40C.805D2FDB@lfi.uni-hannover.de>

Hallo David,
was it yours you ask by yourself question  ?

David Cantrell wrote:

> Then please explain how I can run Linux with a single floppy disc and
> no hard disk in the machine at all.
> --
> David Cantrell, part-time Unix/perl/SQL/java techie
>                 full-time chef/musician/homebrewer
>                 http://www.ThePentagon.com/NukeEmUp

I suggest you the follow:
if you have a networkcard for your laptop you can
build an eprom aand a boot-disk for a X-Client.
Call it X-Terminal.
But what has it done with perl ???

MfG Folkert Meeuw



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

Date: Tue, 04 May 1999 11:18:09 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Problem in calling subroutine inside another routine
Message-Id: <7gmk9t$1kc$1@fir.prod.itd.earthlink.net>

[ courtesy cc sent by mail if address not munged ]
     
shaominchi@my-dejanews.com wrote:
>When I call func1() inside func2(), PERL complained.
>Can any one tell me why I got the following errors ?
>
>Thanks,
>
>shaomin
>#==========    Error message when try to run the program    ==========
>
>#   Prototype mismatch: sub main::func1 ($$) vs () at t2.pl line 19.
>#   Too many arguments for main::func1 at t2.pl line 27, near "$type )"
>#   Execution of t2.pl aborted due to compilation errors.
>
>#!/usr/local/bin/perl -w
>
>$p1 = 1;
>$p2 = 2;
>$aa = func1($p1, $p2);
>print $aa;
>func2();
>
>sub func1() {
>   local (@f1)=@_;
>
>   foreach $x (@f1) {
>     print $x, ", ";
>   }
>   print "\n";
>   return 1;
>}
>
>sub func2() {
>    my ($ff, $type, $name);
>
>    $ff = 200;
>    $type = 20;
>
>   $ret = func1( $ff, $type );  ###  this is the complained line
>    print "<2>\n";
>}

When you get "prototype" error mesages, it has to do with the 
parentheses at the end of your function name when you declare it.

Your script works fine with: 

sub func1 {

for more info on the prototype and subroutines, do:

perldoc perlsub



Good luck

drop the parentheses at the 



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

Date: Tue, 04 May 1999 13:35:47 +0200
From: Hauk Langlo <hauk@forumnett.no>
Subject: problems substituting \' with ' (ignore if you hate amateur questions)
Message-Id: <372EDB93.D06F8EC2@forumnett.no>

I'm adding a backslash to all the ' characters in a scalar to let it
enter an SQL database. When retreaving the scalar I want to remove the
backslash but it seems like I can't make it work no matter what I do.

-----
$foo="Hauk's problem";

$foo=~s/'/\\'/g;

$foo=~s/\\//g:
----

$foo is now still "Hauk\'s problem" and that IS a problem

I'm afraid I have missed a very basic point somewhere, but I have kind
of faced the wall here and I cant see what I'm doing wrong even after
reading all kinds of documentation. I would apreciate any helpfull
comments. Thanks.

Regards Hauk Langlo

-- 

----------------------------------
 Hauk Langlo

 Hauk@forumnett.no
 http://www.forumnett.no/~hauk
 (+047) 93438940
----------------------------------


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

Date: Tue, 04 May 1999 11:44:33 +0200
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
Subject: Re: sending email
Message-Id: <372EC181.5C0FBD73@gmx.net>

David Cassell wrote:
> 
> Terra Landry wrote:
> >
> > I want to send out an email to multiple recipients.. I have my emails.. but
> > I'm not sure how to send the email.. if you could reply ASAP I'd greatly
> > appreciat it!!
> 
> Try this:
>   perldoc -q mail
> 
> Lo and behild, in perlfaq9 there's a host [pardon the pun] of useful
> info on this.  Short version: use sendmail [or a win32 analogue], as
> per the code in the FAQ.. or else use one of the Mail::* modules at
> CPAN.

 ...but don't even think of spamming. That's not nice. Your mother will
find out, and then you'll get sent to your room *without* any dinner.

Cheers,
Philip


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

Date: Tue, 04 May 1999 11:25:27 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Simple question
Message-Id: <7gmkng$1kc$2@fir.prod.itd.earthlink.net>

[ courtesy cc sent by mail if address not munged ]
     
Netguy <netguy@homemail.com> wrote:
>How to get something like LWP::Simple get() or like that work in
>(uh) Windows95?


I do it like I do any module: 

-  I read the documntation that comes with it. 
-  After researching everything about how it is suppose to work and how 
that differs from my results, I may go as far as to post a very detailed 
message to c.l.p.m containing the snippet of code that isn't doing as it 
should, what the results are and what I expected.


Good luck



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

Date: Tue, 04 May 1999 11:02:31 +0100
From: Matt Sergeant <matt-news@sergeant.org>
Subject: Re: Using 'Require' in ASP
Message-Id: <372EC5B7.7BD1E74A@sergeant.org>

Jalil Feghhi wrote:
> 
> Lennart,
> 
> I would appreciate it if you could help me here.
> 
> I am using a function in my ASP page that is defined in another perl file I
> am including in my program using 'require' but ASP interpreter complains
> that it can't find the function. I think the interpreter looks for the
> function w/o knowing what 'require' means.
> 
> How would one do this in ASP?

That depends where you "other" file is. The current directory may not be
what you think it is. Either specify a full path (yucky) or put the file
somewhere in @INC (e.g. c:/perl/site/lib).

-- 
<Matt email="msergeant@ndirect.co.uk" />

| Fastnet Software Ltd              |   Perl in Active Server Pages   |
| Perl Consultancy, Web Development |   Database Design   |    XML    |
| http://come.to/fastnet            |    Information Consolidation    |


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

Date: 4 May 1999 11:31:28 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Using 'Require' in ASP
Message-Id: <372ecc80@newsread3.dircon.co.uk>

Jalil Feghhi <jalil@corp.home.net> wrote:
> Lennart,
> 

The last time anyone called 'Lennart' posted here was 23 March 1998 as
far as I can determine.

> I would appreciate it if you could help me here.
> 
> I am using a function in my ASP page that is defined in another perl file I
> am including in my program using 'require' but ASP interpreter complains
> that it can't find the function. I think the interpreter looks for the
> function w/o knowing what 'require' means.
> 

If it doesnt understand 'require' then it aint Perl - What is the error
you are getting ?  Doris reckons that you are trying to use the default
language - which is not Perl and thus is not really a Perl question.

/J\

-- 
Jonathan Stowe <jns@gellyfish.com>



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

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

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