[8593] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2210 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 30 15:17:23 1998

Date: Mon, 30 Mar 98 12:00:34 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 30 Mar 1998     Volume: 8 Number: 2210

Today's topics:
    Re: Anon Scalar Expression (was: Evaluate expression in <jdporter@min.net>
    Re: Calling all Newbies lvirden@cas.org
    Re: CGI - Multiple values in an associative array <jdporter@min.net>
        executing Perl programs under BSD Unix mbl@cast-us.com
        file trees  (Robs hols)
    Re: File::Find <jdporter@min.net>
    Re: free disk space <peredina@progress.com>
    Re: How to conditionally put 'use OLE' in script which  <rootbeer@teleport.com>
    Re: How to conditionally put 'use OLE' in script which  (Andrew M. Langmead)
    Re: How to conditionally put 'use OLE' in script which  <barnett@houston.Geco-Prakla.slb.com>
    Re: How to generate a Cartesian product of a varying nu <jdporter@min.net>
    Re: HTML::Parse Won't pull data out of tables <keithmur@mindspring.com>
        index of string <fez@post6.tele.dk>
        math: random numbers.. well, sorta-kinda.. <ptrainor@bbn.com>
        MSEXCHANGE / OUTLOOK <pascal_amram@ml.com>
    Re: Need sorting routine in Perl <jdporter@min.net>
        Net::FTP $ftp->pwd() undef?? (Stephen J. Tremblett)
    Re: newbie question:how to embed perl in html <ludlow@us.ibm.com>
        Parens in list assignment (was: Re: Question) <rootbeer@teleport.com>
        Perl BNF/Perl parser <mike@unival.com>
    Re: Perl Libraries y2k compliance <Russell_Schulz@locutus.ofB.ORG>
    Re: Perl to read  spreadsheet files <Russell_Schulz@locutus.ofB.ORG>
    Re: Question <ebohlman@netcom.com>
    Re: Question (Jason Gloudon)
    Re: Question (Andrew M. Langmead)
    Re: request HELP setting ISAPI Perl's @INC array <jkry3025@comenius.ms.mff.cuni.cz>
    Re: Scalar Variable as an array name (Andrew M. Langmead)
        Send S-MIME using Perl ( still looking for help) <ntungdaj@Oleen.com>
        Sendmail in Perl32/NT <ntungdaj@Oleen.com>
    Re: Sendmail in Perl32/NT (Andy Lester)
    Re: Serial IO (Matthew H. Gerlach)
    Re: The "Y2k-bugs-are-not-just-a-legacy-problem" FAQ <keithmur@mindspring.com>
    Re: URGENT PROBLEM!  Who cares? <dolske@cis.ohio-state.edu>
    Re: URGENT PROBLEM!  Who cares? scott@softbase.com
    Re: What is a JAPH <birgitt@order.booktraders.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 30 Mar 1998 13:40:13 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Anon Scalar Expression (was: Evaluate expression inside print "")
Message-Id: <351FE70D.614@min.net>

Jim Stern wrote:
> 
> print "@{[$var+1]}\n";          # Evaluates in an array context
> print "${my $v=$var+1;\$v}\n";  # Evaluates in a scalar context

So my question is, Why doesn't perl have an operator to
generate ref-to-anon-scalar the way it does for arrays
and hashes?

In other words -- if < and > were the special delimiters --
we could have said:

print "${<$var+1>}\n";

Why?  Or [optimistically] When?

John Porter


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

Date: 30 Mar 1998 18:03:24 GMT
From: lvirden@cas.org
Subject: Re: Calling all Newbies
Message-Id: <6fompc$rjl$1@srv38s4u.cas.org>


:>I would like to propose, that we "Newbies" set up a mail list, designed to
:>help each other. I am "all the way up" to p. 25, of Learning Perl on Win32

I guess I am not sure how this is going to work.  I thought a "Newbie"
was someone who basically was in search of answers.  Certainly that's
the way it comes across here on the newsgroup.  So some how all the
newbies by theirself on this mailing list will no longer be coming to
this newsgroup to get answers?  Instead they will discover them on
their own - apparently without reading the existing doc (since that's
what is going on now on this newsgroup)?  Sounds like a fascinating
experiment.

Perhaps what could be done is that all first time posters to the
newsgroup could be punted to that mailing list.  That way the folk who
complain about the noise here would get some relief...

-- 
<URL:mailto:lvirden@cas.org> Quote: In heaven, there is no panic,
<*> O- <URL:http://www.teraform.com/%7Elvirden/> only planning.
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.


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

Date: Mon, 30 Mar 1998 13:32:24 -0500
From: John Porter <jdporter@min.net>
Subject: Re: CGI - Multiple values in an associative array
Message-Id: <351FE538.23F7@min.net>

Tom Phoenix wrote:
> 
> On Sun, 29 Mar 1998, Tom Mornini wrote:
> 
> > Tom Phoenix (rootbeer@teleport.com) wrote:
> 
> > : > - but what kind of strain does that put on the server?
> >
> > : Perl doesn't care. :-) But you could ask in a newsgroup about servers, if
> > : that's what you need.
> >
> > This is a really assinine response to this question.
> 
> No, it's not. This newsgroup is about Perl, not about servers.

The question was about perl, Tom, not about servers.
Asking whether a certain class of perl constructions
incur a significant performance penalty is entirely 
germane to this newsgroup.

John Porter


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

Date: Mon, 30 Mar 1998 13:51:06 -0600
From: mbl@cast-us.com
Subject: executing Perl programs under BSD Unix
Message-Id: <6fosu9$u9h$1@nnrp1.dejanews.com>

I have an easy question that I, a novice, am stumped on:

My Perl program will only execute when I type

perl program.pl

It will not execute when I type

program.pl

If this is a path problem, how do I fix it?  The "whereis Perl5" command
gives me both /usr/bin/perl5 and /usr/contrib/bin/perl5 as paths.  I cannot
be root because I am using an ISP--so how do I change my path? (My ISP has
non-existent tech support, by the way)


In addition, how can I execute a Perl program that writes to a file (when
executed from my website, embedded in HTML), if my ISP won't allow global
write permission?  I can't use the exact path because they truncate it (e.g.,
instead of

http://www.myISP.com/usr/home/mydirectory

i have to type, instead

http://www.myISP.com/~mydirectory

since this is the case, what path do I write in my Perl program in order that
its output can write to a file?

thanks for your help.

Maureen

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 30 Mar 1998 19:23:44 GMT
From: robshols@aol.com (Robs hols)
Subject: file trees 
Message-Id: <1998033019234401.OAA23452@ladder03.news.aol.com>

Hi,

Can anyone suggest some perl code that would allow me to, given a particular
directory, list all files in that directory AND in all directories below it
(and all
directories below them etc. etc.) and put the results in an array such that
each
item in the array contains the name of the file and in the case of files in 
directories below, the path name of the file relative to the given directory
eg:

file1
file2
dir1/file3
dir1/dir2/dir3/file9

etc. The order in which they are indexed in the array is not important.

Thanks.

Rob 
(RobsHols@aol.com)


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

Date: Mon, 30 Mar 1998 13:42:14 -0500
From: John Porter <jdporter@min.net>
Subject: Re: File::Find
Message-Id: <351FE786.4AD2@min.net>

Ed Avis wrote:
> 
> On Fri, 27 Mar 1998 21:09:42 GMT, aml@world.std.com (Andrew M.
> Langmead) wrote:
> 
> >They didn't strip out the documentation out of Find.pm, did they?
> 
> I read the documentation at the beginning, before the actual Perl code
> starts, but I didn't read the whole file.

In other words, you read File/Find.pm, rather than
	perldoc File::Find

John Porter


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

Date: Mon, 30 Mar 1998 13:53:53 -0500
From: CP <peredina@progress.com>
To: Stephen Mubita <smubit1@gl.umbc.edu>
Subject: Re: free disk space
Message-Id: <351FEA41.AE978F14@progress.com>

Try the File module:

use File::Df;

I believe it will tell you all you need to know....

-Curt

Stephen Mubita wrote:

> Dumb question, I fear. How can a perl script discover how much disk space
> is free on a drive / filesystem ?
>
> Thank you,
> Stephen
>
>  Stephen Mubita                                      smubit1@umbc.edu
> ======================================================================
> 'God opposes the proud, but gives grace to the humble.'
>                                                           James 3 : 6b
> ----------------------------------------------------------------------
>  |      UCS is not responsible for any opinions contained here      |
> ====================******************************====================





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

Date: Mon, 30 Mar 1998 10:24:04 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Wing Choy <whc@mink.att.com>
Subject: Re: How to conditionally put 'use OLE' in script which can run either in Unix or Win?
Message-Id: <Pine.GSO.3.96.980330102212.13978J-100000@user2.teleport.com>

On 30 Mar 1998, Wing Choy wrote:

> Is there a way to put 'use OLE' conditionally inside a script?

Sure. use is implemented using BEGIN and require. Re-write your use to
have the require inside an if clause. You can test $^O to find out what
machine you're on.

Alternatively, just put the require into an eval{} block inside the BEGIN.

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 30 Mar 1998 18:48:15 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: How to conditionally put 'use OLE' in script which can run either in Unix or Win?
Message-Id: <EqnAwG.Gu1@world.std.com>

whc@mink.att.com (Wing Choy) writes:

>Is there a way to put 'use OLE' conditionally inside a script?
>In Unix the OLE module does not exist, but even though that
>potion of the code is not executed, the compiler stills look
>for the module and won't even compile.

If you take a look at "use" in the perlfunc man page, it shows its
implementation based on BEGIN, require, and calling a modules import()
method.

You could perform these steps yourself and add an eval {} to trap the
errors.

BEGIN {
  eval {
    require OLE;
    OLE->import();
  }
};

Or you cuse use eval "" and avoid at least some of the ugliness.

BEGIN {eval "use OLE"}

Since this will only be called once, you don't get the same
recompilation overhead that you usually do with eval STRING.

-- 
Andrew Langmead


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

Date: Mon, 30 Mar 1998 13:12:42 -0600
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Re: How to conditionally put 'use OLE' in script which can run either in Unix or Win?
Message-Id: <351FEEAA.D98B5BB0@houston.Geco-Prakla.slb.com>

Wing Choy wrote:
> 
> I have a perl script which can I would like to run on both
> Unix and PC.  If I am running on a PC, I need to use the OLE
> module.
> 
> Is there a way to put 'use OLE' conditionally inside a script?
> In Unix the OLE module does not exist, but even though that
> potion of the code is not executed, the compiler stills look
> for the module and won't even compile.
> 
> I am sure there is a way to conditionally ask perl to use
> certain modules.  But I couldn't find it in the FAQ.
> 
> Thanks for any pointer.
> 
>         Wing
Look into eval.

It allows you to do things like this:
#!/usr/local/bin/perl -w
#
eval 'use File::Dave;';
if ($@) {
    print "Failed\n";
} else {
    print "Success\n";
}
__END__

That should issue the message "Failed".

Change the eval line to 'use File::Find;', and rerun it, it should print
Success (assuming you have File::Find installed on your machine.

I believe BEGIN is another way to do this, but I am unfamiliar with it. 
(And may be all wet on this point.)

HTH.

Dave

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

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


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

Date: Mon, 30 Mar 1998 14:14:46 -0500
From: John Porter <jdporter@min.net>
Subject: Re: How to generate a Cartesian product of a varying number of sets?
Message-Id: <351FEF26.15CC@min.net>

Steven Tolkin wrote:
> 
> 1. How can I handle a variable number of nested loops?
> 2. It also bothers me that I need to have a hard coded variable at
>    each level...

I would use recursion.


> 3. The syntax @{$i[0]} seems ungainly to get the list back from the list
> ref

Them's the breaks.


> 5. I suppose I could dynamically generate the code,
> but I have never done that in Perl (yet).
> If that is the "right" way to approach this I'd appreciate if someone
> could provide a code snippet.

That would be one way.  But There's More Than One Way To Do It.


# data, in five dimensions.  Can be any number of dimensions.
@i = (
    [ qw( prod iob ff ) ],
    [ qw( foo bar baz ) ],
    [ qw( larry moe curly ) ],
    [ qw( rags tags wags ) ],
    [ qw( mon qtr yr ) ]
);

ccp( \@i, 
    sub {
        my @vec = @_;
        # find product
        while ( @vec > 1 ) { push( @vec, (shift @vec)*(shift @vec) ); }
        print "product of @_ is $vec[0]\n";
    }
);


sub ccp { # cartesian cross product
    my( $dims, $subref, @vector ) = @_;
    my @remaining = @$dims;

    if ( @remaining ) {
        # not at end yet
        my $dim = shift @remaining;
        my $x;
        for $x ( @$dim ) {
            # recurse, appending $x to vector:
            ccp( \@remaining, $subref, @vector, $x );
        }
    }
    else {
        # at leaf (got all dims)
        $subref->( @vector );
    }
}


Of course, this can be optimized; for example, if you know you're only
going to want the product of the vector, you can keep a running
product down through the recursion.

hth,
John Porter


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

Date: Mon, 30 Mar 1998 14:01:20 -0600
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: HTML::Parse Won't pull data out of tables
Message-Id: <351FFA10.87456B57@mindspring.com>

Jerry Pank wrote:
> 
> In <comp.lang.perl.misc>
> Keith G. Murphy <keithmur@mindspring.com>, writes:
> 
> >Are you sure?  Care to post some code?  Seems to be working for me.  Are
> >you using TreeBuilder and traversing the whole document?
> >
> >>
> >> I'm Using HTML::Parse to strip tags out so I can build plain text
> >> versions of web pages to ``feed'' search engines but it ignores text
> >> within tables.
> <snip>
> 
> #!/usr/bin/perl -w
> 
> use HTML::Parse;
> 
> undef $/;
> $data=(<DATA>);
> 
> $h = parse_html($data);
> print $h->format;
> $h->delete;
> 
> # produces:
> 
> #    Hello World
> #    ===========
> #
> #   [TABLE NOT SHOWN]
> #
> #    Fine Thanks!
> #
> 
> __DATA__
> <HTML>
>   <HEAD>
>    <TITLE>Hello World</TITLE>
>   </HEAD>
>  <BODY>
>   <H1>Hello World</H1>
>   <TABLE BORDER="BORDER">
>    <TR><TD>how</TD><TD>are</TD></TR><TR><TD>you</TD><TD>today?</TD></TR>
>   </TABLE>
>   <P>Fine Thanks!</P>
>  </BODY>
> </HTML>
> 
> I guess I'm using the wrong routine from HTML.  I am having problems
> getting to grips with the OO side of things.  Slowly but Slowly :-(

Oh, OK, I never have used format.  The documentation within FormatText,
which it uses by default, mentions that it doesn't handle the contents
of tables.

Doesn't seem to me that format is what you'd want to use for your
purposes...
Look at inheriting from TreeBuilder, and superseding the text
function...  Off the top of my head, that seems the easiest way.  Others
may have better...


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

Date: Mon, 30 Mar 1998 21:40:00 +0200
From: "N. Nielsen" <fez@post6.tele.dk>
Subject: index of string
Message-Id: <6fosgs$40j$1@dalen.get2net.dk>

Hello and greetings to all you perl-wizards.
I'm new to perl and i'm looking for a function to return the position of a
searchstring in another string...
I know that in javascript the syntax is:
string.indexOf(searchstring)
but i don't know how to translate it into perl...
help me please.
--
Nezar - Denmark





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

Date: Mon, 30 Mar 1998 14:20:00 -0500
From: Pat Trainor <ptrainor@bbn.com>
Subject: math: random numbers.. well, sorta-kinda..
Message-Id: <Pine.LNX.3.95.980330140354.458C-100000@aura>


Quasi-Random Number Generation with Perl - a "seedy" business..

	I have found that to generate a random image is easy. The hard
part is to control how un-random a random number can be. What?

	If I want to display help messages randomly, and already know the
most common, I need a way to mathmatically display certain files more
often than others, preferrably under very calculated means. 

	Example:

	How to display files based on, say an integer from 1 to 9 to
indicate priority, and then "fairly" randomize the result so that a file
with say a "3" is showm 3 times as often as a file with a "1" for
priority. Likewise a file with a priority of "6" should be expected to be
seen 6/5 ( or 1.2 ) times as much as a "5". 
	This should be possible without keeping track of the displays, but
I would naturally want to keep track of that. For all the book-keeping
mSQL or another SQL backend would be used, so no filehandles required.

	I think this can be best summed (oops!) up as a quasi-rando
selection based on a pre-determined priority.

	Question:

	What would the math look like with perl?

TIA!

pat 	
:)

Pat Trainor
________________________________________________________________________
     ptrainor@bbnplanet.com ptrainor@bbn.com ptrainor@bbnplanet.net
                         will program for boat 



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

Date: Mon, 30 Mar 1998 20:15:20 +0200
From: Pascal AMRAM <pascal_amram@ml.com>
Subject: MSEXCHANGE / OUTLOOK
Message-Id: <351FE138.E582024C@ml.com>

Where can i can any samples / modules / etc to interface Perl and Ms
Exchange (via a MAPI or something else) ?




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

Date: Mon, 30 Mar 1998 14:25:23 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Need sorting routine in Perl
Message-Id: <351FF1A3.19F0@min.net>

Kevin Reid wrote:
> 
>       Macintosh.
>   Think different.

Think Again.



John Porter


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

Date: 30 Mar 1998 17:48:12 GMT
From: sjt@cs.mun.ca (Stephen J. Tremblett)
Subject: Net::FTP $ftp->pwd() undef??
Message-Id: <6folss$s3t$1@coranto.ucs.mun.ca>

$ftp->pwd constantly returns undef for some reason.  Do I have to parse
$ftp->message after a cwd to glean the present directory??

Here's a snip of code:

my $dir = $ftp->pwd();
my $prompt = "ftpBrowse: $dir> ";

print $prompt;

while (<STDIN>) {
	last if (/^close/);
	if ((/^dir/) || (/^ls/)) {
		# $list = $ftp->dir;
		my $x;
		foreach $x (@{$ftp->dir}) { print "$x\n"; }
		next;
	}
	elsif ((/^cd/) || (/^chdir/)) {
		my @cmdline = split;
		#debugging print "chdir to $cmdline[1]\n";
		if ($ftp->cwd($cmdline[1])) {
			my $dir = $ftp->pwd();
			# debugging my $str = $ftp->message;
			# debugging print "$str\n";
			if (defined($dir)) {
				print "in here\n";
			}
			$prompt = "ftpBrowse: $dir> ";
		}
		else {
			print "invalid directory\n";
		}
		next;
	}
} continue {
	print $prompt;
}

$ftp->quit;
print "Connection closed\n";
--
-=> Steve Tremblett    	  
-=> Memorial University Computer Science   	
-=> sjt@cs.mun.ca; www.cs.mun.ca/~sjt 


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

Date: Mon, 30 Mar 1998 12:01:57 -0600
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: newbie question:how to embed perl in html
Message-Id: <351FDE15.CCFA5610@us.ibm.com>

M1 wrote:
> I have a perl script for a discussion group that outputs html. if I type:
> perl script.pl it gives the desired html output in my shell account.
> 
> Question: How do i call this script from a html page?

The acronym you're looking for is "CGI".  Start at http://www.perl.com
and go to the CGI link listed on the left column.  There's a lot of
information available from there.

Also, if you have questions that pertain to CGI in general, but not
really Perl, there are newsgroups devoted to nothing but CGI.

--
James Ludlow (ludlow@us.ibm.com)
This isn't tech support and all opinions are my own.


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

Date: Mon, 30 Mar 1998 10:30:01 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Greg <gking@no-spam.c-com.net>
Subject: Parens in list assignment (was: Re: Question)
Message-Id: <Pine.GSO.3.96.980330102452.13978K-100000@user2.teleport.com>

On Mon, 30 Mar 1998, Greg wrote:

> Subject: Question

Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.

    http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post

> What is the result of
> 
> ($a,$b) = ((1,2), 3);
> print "$a  $b";
> 
> well, it actually gives you:
> 1  2
> 
> But,
> The way I read it, $a should be = (1,2) and $b = 3
> The $a=2 and $b= 3

You're reading it wrong. :-)  (How could $a be (1,2)? A scalar
can't be a list.) Sub-lists inside lists are always expanded in an
assignment. 

Imagine that that sub-list had been from a variable:

    ($fred, $barney) = ( @list, 3 );

That's a list assignment, so @list has to be expanded first. Then the
elements of the resulting list are assigned to the list on the left. 

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 30 Mar 1998 11:52:37 -0800
From: Mike Hitchcock <mike@unival.com>
Subject: Perl BNF/Perl parser
Message-Id: <351FF805.83E5071F@unival.com>

>From perlfaq7:

  Can I get a BNF/yacc/RE for the Perl language?

  No, in the words of Chaim Frenkel: "Perl's grammar can not
  be reduced to BNF.  The work of parsing perl is distributed
  between yacc, the lexer, smoke and mirrors."

Is this still true? I can imagine that some parts of Perl
would be hard to fit into BNF, but if it is a small percentage,
maybe those could be treated as "unkown" or "ambiguous" tokens...
Is there available a "partial" BNF?

Is there any work going on out there in Perl-land on a
Perl parser? Maybe as part of 5.00[567]? What would be involved?
My knowledge of C is minimal, so I recoil with great fear
at the prospect of perlusing [i.e, perusing Perl source code].
But I do know enough to play with lex/flex and yacc/bison
(at least, as long as I am armed with the O'Reilly book!)
-- 
Mike Hitchcock
mike@unival.com
hitchcock@earthling.net


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

Date: Mon, 30 Mar 1998 17:35:29 +0100
From: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: Re: Perl Libraries y2k compliance
Message-Id: <19980330.173529.7m4.rnr.w164w@locutus.ofB.ORG>

tchrist@mox.perl.com (Tom Christiansen) writes:

> All mumbles about Year 2000 compliance are just someone looking for
> a lawsuit.

or a working computer, give or take a few years.
-- 
Russell_Schulz@locutus.ofB.ORG  Shad 86c


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

Date: Mon, 30 Mar 1998 16:12:45 +0100
From: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: Re: Perl to read  spreadsheet files
Message-Id: <19980330.161245.7f3.rnr.w164w@locutus.ofB.ORG>

scott@softbase.com writes:

> Russell Schulz (Russell_Schulz@locutus.ofB.ORG) wrote:
>
>> (and yes, I see the OLE module, but that seems particular to
>> Microsoft Excel files, and I haven't tried it.)
>
> There's nothing particular to any specific program with OLE Automation,

that's not the module I'm talking about; I'm talking about Herbert.
-- 
Russell_Schulz@locutus.ofB.ORG  Shad 86c


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

Date: Mon, 30 Mar 1998 18:31:38 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Question
Message-Id: <ebohlmanEqnA4q.BL6@netcom.com>

Greg <gking@no-spam.c-com.net> wrote:
: What is the result of

: ($a,$b) = ((1,2), 3);
: print "$a  $b";

: well, it actually gives you:
: 1  2

: But,
: The way I read it, $a should be = (1,2) and $b = 3

Nope.  The elements of a list are scalars.  (1,2) isn't a scalar.  A
comma-separated sequence inside a list that's being evaluated in list
context (whew!) gets "flattened" just as if it were an array being
interpolated into the list; it's not treated as a comma expression (which 
happens only in scalar context).

: The $a=2 and $b= 3

Remember that Perl doesn't have true nested lists.  Of course, a list can 
contain a reference to another list, but you have no references here.




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

Date: Mon, 30 Mar 1998 19:09:21 GMT
From: jgloudon@manitoba.bbn.com (Jason Gloudon)
Subject: Re: Question
Message-Id: <slrn6hvrcd.ff5.jgloudon@manitoba.bbn.com>

Greg <gking@no-spam.c-com.net> wrote:
 .
 . 
>What is the result of
>
>($a,$b) = ((1,2), 3);

A Perl list consists only of scalars, which could be references to another
list perhaps, like list ([1,2], 3). Lists within lists are simply expanded
into their constituents elements, so (((1,2),3), 4 ,5) becomes (1,2,3,4,5).

The elements after the second element ie 3, get dropped by the assignment.

-- 
Jason Gloudon


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

Date: Mon, 30 Mar 1998 18:53:50 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Question
Message-Id: <EqnB5q.KJw@world.std.com>

"Greg" <gking@no-spam.c-com.net> writes:

>($a,$b) = ((1,2), 3);
>print "$a  $b";

Perl's lists are one dimentional, and lists inside lists flatten
themselves into a single list. When perl sees:

((1,2), 3)

It turns it into:

(1, 2, 3)

The what are generally considered multidimensional lists in perl are
really lists that contain references to other lists.

($a, $b) = ([1,2], 3);
print "@$a, $b\n";
-- 
Andrew Langmead


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

Date: Mon, 30 Mar 1998 20:32:58 -0800
From: Jan Krynicky <jkry3025@comenius.ms.mff.cuni.cz>
To: benton <benton@panix.com>
Subject: Re: request HELP setting ISAPI Perl's @INC array
Message-Id: <352071FA.60EC@comenius.ms.mff.cuni.cz>

benton wrote:
> 
> Hello, all.
> 
> I am trying to load some libraries into the Win32 ActiveState ISAPI Perl
> (build 315).  Specifically, I'm trying to
> write a script that retrieves a webpage, via the HTTP::request module.
> 
> The Difficulty is getting ISAPI Perl to load the correct @INC array.
<snipped>
> 
> (it can't find the module).  Running the script from the command-line,
> WHILE IN THE "C:\program files\perl\bin"
> 
> DIRECTORY, instead of through the web server seems to load the library
> OK.
> 
> This appears to be because the @INC path is set to ("..\lib",
> "..\lib\i386-win32", ".")

Start regedit, open HKEY_LOCAL_MACHINE\Software\Activeware\Perl5
 and fix the paths (value LIB). They MUST be absolute, not relative!

> I have
> tried to include the line
> use lib "C:\progra~1\perl\lib";
> in my script, but of course it can't find the "lib" library either!

> - benton

1. Use long names
2. Never ever use spaces in directories!
   I don't think you will ever be able to use perl properly once you
have
   placed it in "c:\Program files". Move it somewhere else,
   rerun the instalation script and check the paths by regedit as 
   described above. I'm pretty sure you will not have to change them.

Jenda


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

Date: Mon, 30 Mar 1998 18:38:15 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Scalar Variable as an array name
Message-Id: <EqnAFr.8wK@world.std.com>
Keywords: Scalar Variable Array Name Perl

ingrjml@bnr.ca (Mitch Lyman) writes:

>I'm performing a push command.

>push(@{$var},$temp);

Which version of perl are you using? I created the following script
based on your article:

@Question2_Comments;
$var = 'Question2_Comments';
$temp = "P is a good tool which has improved";
push(@{$var},$temp);
print(@{$var},"\n");
print "@Question2_Comments\n";

and ran it under perl version 4.036, 5.001, 5.003, and 5.00401. The
only version that ran incorrectly was 4.036 (which doesn't have the
symbolic reference feature that you are using) and that version of the
debugger doesn't have the "x" command that you use in your
demonstration. (Also, interestingly enough, perl4 does print out the
first line correctly, it push()es on the array with the literal four
characters "$var")

>@Question2_Comments = (Patchit is a good tool which has improved);

>How do I do this using variables?

You also might look into using multidimensional data structures as
shown in the perllol and perldsc man pages, rather than using symbolic
references.

push @{$hash{$var}}, $temp;

-- 
Andrew Langmead


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

Date: Mon, 30 Mar 1998 12:45:56 -0500
From: Nuttapong Tungdajahirun <ntungdaj@Oleen.com>
Subject: Send S-MIME using Perl ( still looking for help)
Message-Id: <E630C877D67BD111B87F00A0C99D934C06550D@SSPRING01>

How can I change perl script (formmail.pl)  to automatically send email
in S-MIME format?


In our website, we are using perl script that after submit a form it
automatically sends a client's fill-out form info (text format) to our
supplier email address directly. (using simple formmail.pl)

We would like to send this info in encrypt format.

Note: Our web is in NT w/ IIS 4.0 and having public key.

Thank you in advance

Jeen





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

Date: Mon, 30 Mar 1998 12:50:23 -0500
From: Nuttapong Tungdajahirun <ntungdaj@Oleen.com>
Subject: Sendmail in Perl32/NT
Message-Id: <E630C877D67BD111B87F00A0C99D934C0655A1@SSPRING01>

I 'm just changing to Perl32.

What can I use instead of sendmail in UNIX in my perl script for Perl
32?
Please give me some example.

I'm using NT w/ IIS 4.0.
Thanks

Jeen





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

Date: 30 Mar 1998 19:46:17 GMT
From: petdance@maxx.mc.net (Andy Lester)
Subject: Re: Sendmail in Perl32/NT
Message-Id: <6fosq9$1qe$1@usenet76.supernews.com>

: What can I use instead of sendmail in UNIX in my perl script for Perl
: 32?
: Please give me some example.

I don't suppose you looked around at www.perl.com, eh?  Or did a quick
AltaVista search for "Windows NT sendmail"?

Those might be a good place to start.

xoxo,
Andy


--
--
Andy Lester:        <andy@petdance.com>       http://tezcat.com/~andy/
Chicago Shows List: <shows@ChicagoMusic.com>  http://ChicagoMusic.com/



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

Date: Mon, 30 Mar 1998 18:02:36 GMT
From: gerlach@netcom.com (Matthew H. Gerlach)
Subject: Re: Serial IO
Message-Id: <gerlachEqn8sC.M2y@netcom.com>


Hi,

I've had good luck with perl and serial ports under UNIX.  I did it
using the expect feature of Comm.pl, but one should probably use Expect.pm
instead.  What I did was have my perl script "talk" to a serial program,
kermit from columbia.edu.  One could write a kermit script directly for
what you are trying to do as well.

You might want to look at some of sample code:
ftp://www.smallplanetbrewery.com/users/coralie/perl_serial_example

Matthew


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

Date: Mon, 30 Mar 1998 14:14:02 -0600
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: The "Y2k-bugs-are-not-just-a-legacy-problem" FAQ
Message-Id: <351FFD09.B3889B31@mindspring.com>

Craig Berry wrote:
> 
> Theran Cochran (theranc@geocities.com) wrote:
> : Lets see
> :
> :       60           seconds in a minute
> :       60           minutes in an hour
> :       24           hours in a day
> : *    365           days in a year
> : --------
> : 31536000           seconds in a year (well, approximately.
> 
> One of the more useful factoids I've encountered is "pi seconds is a
> nanocentury."  It's easy to remember, accurate to well within 1%, and
> makes long-interval time calculations in seconds easier to do in your
> head.
> 
> : Didn't account for leap years, leap seconds, or
> : relativistic distortion
> 
> For shame!  Some of us out here are running webservers travelling at high
> fractions of c!
> 
Well, yes, but *relative to what*?  :-)


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

Date: Mon, 30 Mar 1998 12:46:23 -0500
From: Justin Dolske <dolske@cis.ohio-state.edu>
Subject: Re: URGENT PROBLEM!  Who cares?
Message-Id: <Pine.SUN.3.95.980330124524.7785A-100000@snoopy.cis.ohio-state.edu>

On 30 Mar 1998, Andy Lester wrote:

> Why do people think I give Shit One about whether their problem is
> "urgent" or not?

Perhaps because "urgent" and synonyms are excellent keywords to
filter/killfile? :-)

Justin Dolske                    <URL:http://www.cis.ohio-state.edu/~dolske/>
(dolske@cis.ohio-state.edu)



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

Date: 30 Mar 1998 19:00:57 GMT
From: scott@softbase.com
Subject: Re: URGENT PROBLEM!  Who cares?
Message-Id: <6foq59$sd8$2@scully.new-era.net>

Andy Lester (petdance@maxx.mc.net) wrote:
> Why do people think I give Shit One about whether their problem is
> "urgent" or not?

> Why do they think that we'll be happier to answer their dumbass questions
> because they tag it "URGENT!"?

More importantly, Usenet being what it is, where answers to 
questions generally show up before the original posts and
often the originals never show up at all, why do these
people use Usenet for urgent questions in the first place?
It may be urgent to them at the time, but by the time
anyone sees it, it's probably a moot point.

Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more. 


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

Date: Mon, 30 Mar 1998 14:47:49 -0500
From: Birgitt Funk <birgitt@order.booktraders.com>
Subject: Re: What is a JAPH
Message-Id: <351FF6E5.C5EB30D@order.booktraders.com>

Randal Schwartz wrote:
> 
> >>>>> "Steven" == Steven John Cook <csscook@mailbox.uq.edu.au> writes:
> 
> Steven> I am trying to move from a User to Expert in the 'Seven Levels
> Steven> of Perl Mastery' and one of the only things left for me to do
> Steven> is write a JAPH. The only problem is I don't even know what
> Steven> JAPH stands for, so I can't write one. Can a current Perl
> Steven> expert or higher enlighten me.
> 
> Those who know, don't tell.
> 
> Those who tell, don't know.
> 
> :-)
> 

How about the FAQs ?  The first time I hear that they don't know what
they
are telling... 8-).

Birgitt Funk


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 2210
**************************************

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