[8168] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1786 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 2 09:19:23 1998

Date: Mon, 2 Feb 98 06:00:58 -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, 2 Feb 1998     Volume: 8 Number: 1786

Today's topics:
    Re: Can PERL test for a process? <spt@cstr.ed.ac.uk>
        Community My Butt (was: Internet Community needs cgi sc (Chris Nandor)
    Re: Decent Perl books (Dave O.)
        Embedded (depth) parseing as a regular expression in Pe <rstout@spry.com>
    Re: Generating the partitions of a string <vladimir@cs.ualberta.ca>
        HELP: Using FIND2PERL & symlinks (Ed.Q.Bridges)
    Re: How to write fixed format data? <ebohlman@netcom.com>
        I'ready to pay <meetserv@tin.it>
    Re: I'ready to pay <webmaster@fccj.cc.fl.us>
        LDAP: T.61 <-> ISO-8859-1 anyone? (Per Steinar Iversen)
    Re: LWP problem: Error: 500 Offset outside string <aas@sn.no>
        mod_perl 1.07 problem/question (Money Crushing Machine)
    Re: OLE doesn't work <mike@inforis.ru>
    Re: perl.. confusing.. <lav@huilu.hut.fi>
        Problem with TIE and DB_File (Bernd Patolla)
        random number generator? <prasad@stro5.vub.ac.be>
    Re: recursive regex? <spt@cstr.ed.ac.uk>
        solution for multiline comments??? <bjorn.w.nilsson@edt.ericsson.se>
    Re: solution for multiline comments??? <webmaster@fccj.cc.fl.us>
        Suggestions on my New Shopping Cart System <MetatonCSI@worldnet.att.net>
    Re: Survival Of perl <spt@cstr.ed.ac.uk>
    Re: Word -> HTML <camerond@mail.uca.edu>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 02 Feb 1998 13:01:01 +0000
From: Richard Caley <spt@cstr.ed.ac.uk>
Subject: Re: Can PERL test for a process?
Message-Id: <eyh4t2i17qq.fsf@liddell.cstr.ed.ac.uk>

In article <34D1FF49.96A99655@ms.com>, Shaun Ledford (sl) writes:

sl> Trying to write a script that will test whether a process exists.

(assuming unix) If you know the process ID, do 
	kill 0,$pid 
and check the return value.

You can make the process (or the thing which starts it) drop the pid
in a known file. That way you know the pid of th elast one started and
can use kill to see if it is still there.

If you know the process uses a particular resource, you can check for
conflicts. If you are writing the program you are testing for, you
could force it to, say, get a lock on a specific file for no reason
but to indicate it is running.

-- 
Mail me as rjc not spt@cstr.ed.ac.uk		_O_
						 |<



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

Date: Mon, 02 Feb 1998 08:15:38 -0500
From: pudge@pobox.com (Chris Nandor)
Subject: Community My Butt (was: Internet Community needs cgi scripts like it needs ...)
Message-Id: <pudge-0202980815390001@ppp-4.ts-1.kin.idt.net>

In article <34D4CB96.4744@ultranet.com>, Bob Trieger <corky@ultranet.com> wrote:

# PS. Why is sense of community such a bad idea?

In a small sense, it is not.  There is a true Perl Community, IMO.  But
there is no such thing as an Internet Community.  We are all on the
Internet; what else do we all have in common?  Nothing.  We need a sense
of community like people who watch TV or read books need a sense of
community.

We hold nothing in common.  No common objective or goals.  We have a
common tool, nothing more.  That is a poor foundation for a community.

A nation is different.  You have a common set of goals and objectives. 
Although, I must add, that in a nation like the USA, those goals and
objectives are blurred almost to the point of nonexistence and the sense
of community becomes lost or irrelevant.  That is a real danger to the
existence of the nation, which is founded on the idea of community.  Of
course, that is why there are 50 states, that supposedly can foster
internal community.  But when the states can't blow their noses without
losing federal funding for schools and highways, that severely damages the
states' power to foster such community.  But I digress.

Perl is different.  Perl is more than just a tool, it is a way of
thinking.  You and I may have things in common not because we use Perl,
but we use Perl because we have things in common.  But the Internet knows
no such thing.  I thoroughly reject the notion that there is such a thing
as an Internet Community, and even that such a thing is possible given the
numbers of people who use the Internet.

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==       New Book: MacPerl:  Programming for the Rest of Us       ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#


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

Date: Mon, 02 Feb 1998 08:52:24 GMT
From: sloop@mailcity.com (Dave O.)
Subject: Re: Decent Perl books
Message-Id: <34d5879d.139030870@news.xmission.com>

On Mon, 02 Feb 1998 01:24:04 -0500, Chris Heiden <cmheiden@mtu.edu>
wrote:

>Hello there,
>    I am new to the Perl community.  I was wondering if any of you could
>recommend any books as tutorials and reference to Perl.  I already have
>two from Learning Perl and Learning Perl on Win32 systems from O'reilly
>and Associates.  I just wanted to see what everyone out there with
>actual experience with some books had to say.
>

The standard texts are Learning Perl (the Llama book) and Programming
Perl (the Camel book) published by O'Reilly & Associates, Inc.
Depending on where your interests draw you other titles such as CGI
Programming, Mastering Regular Expressions, Learning the UNIX
Operating System, Windows NT in a Nutshell, etc..., all published by
O'Reilly & Assoc. Inc. are fantastic texts.  I give them an 'A'.

While I haven't specifically read "Perl for Dummies" I've had the
misfortune of browsing several other of the "<subject> for Dummies"
books and found them to be shallow, insulting, and poorly organized.
I'd give them an 'F' (or an 'E'; whichever means "fail").

Probably most of the other books would fall somewhere between.  But
keep in mind that the O'Reilly Perl books were written by the top
minds in the Perl world.  If you want to get it straight from the
horse's mouth (or camel or llama) those books are your source.

Dave


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

Date: Fri, 30 Jan 1998 10:32:26 -0800
From: "Richard E. Stout" <rstout@spry.com>
Subject: Embedded (depth) parseing as a regular expression in Perl??
Message-Id: <34D21B44.12A7@spry.com>

Below is a sample of a parser that I am currently using.
I have a few simple ( or maybe not so simple ) questions.

1) When useing a source string of:
   '#PERL:some_func(\'1\', \'2\')# . #PERL:some_other_func(\'me\',
\'you\')#'
   Parcer 1 works fine.  Matches correct pair of #PERL: and )#
   Parcer 2 fails.  Matches the first #PERL: and the last )#

   When useing a source string of:
   '#PERL:some_func(\'1\', #PERL:some_other_func(\'me\', \'you\')#)#'
   (Embeded parseing)
   Parcer 1 fails.  Matches First #PERL with fist )# .. incorrect match
   Parcer 2 works fine.

   When useing a source string of:
   '#PERL:some_func(\'1\', #PERL:some_other_func(\'me\', \'you\')#,
#PERL:my_func(\'some\')#)# .       #PERL:other_func()#'
   (Real embedded parseing)
   Parcer 1 fails.
   Parcer 2 fails.

   Any ideas on how to get embedded (depth) parseing to work correctly
as a regex?
   
   I have worked out a few other ways of doing this, but they all
involve the burt  
   force method.  Like creating a second string and re-tagging the start
and end tags
   with a depth level then recusivly expanding out. Or pushing the start
and end 
   tags on a stack (in order) then popping and compairing  two tags and
if they are 
   a start and end tag pair, expand them and push result back on stack
and contunue 
   till all are expanded.

   None of these ideas seem to be quite as elegant as the expression I
am currently
   useing.
   
2) I have noted that values returned from called functions must be
quoted if used 
   as arg values in the next outer level function.  Is there any way of
getting 
   around this.  It would be nice if I didn't have to write two versions
of the
   same function.  One to return the value in a plain form and another
to return
   the value in a quoted form so it could be used as an arg in the next
function.

=================================================================================
#!/usr/local/bin/perl

print("line=[$ARGV[0]]\n");
print("parse'd line=[", parse($ARGV[0]), "]\n");
exit(0);

###############################################################
# Prep Screen                                                 #
###############################################################
sub parse {
  my($str) = @_;
  my($cmd);

#  $str =~ s{ \043 PERL : \s* ( (\w+) .*? ) \043 } {   #  Parcer 1
  $str =~ s{ \043 PERL : \s* ( (\w+) .* ) \043 } {     #  Parcer 2
    $cmd = parse($1);
    eval($cmd);
  }gsex;

  return($str);
}  

sub AUTOLOAD {
  my(@args) = @_;

  return(join('_', @args));
}

=================================================================================


Any ideas would be most helpful,

Thanks,

Richard E. Stout

-- 
/==================================================================\
|     Richard E. Stout                        Phone 425.957.8000   |
|     rstout@spry.com                         Fax   425.957.6000   |
|     UNIX Software Engineer                                       |
|     Spry/Compuserve Internet Division                            |
\==================================================================/
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.2

mQBtAzRaFU8AAAEDAKoZr/W+7BqoSsMRUwvjOtZza+KaAZP0m22HszE86mSX1gZJ
kT3JmL0ANh4vJO8yl46PkPuQUWkAnUZY0/r2ynLUjMBa5yBFLqd3KtuPbsL7el++
wJbqZ88VN/SGGt5AAQAFE7QiUmljaGFyZCBFLiBTdG91dCA8cnN0b3V0QHNwcnku
Y29tPg==
=F78r
-----END PGP PUBLIC KEY BLOCK-----


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

Date: 02 Feb 1998 02:07:55 -0700
From: Vladimir Alexiev <vladimir@cs.ualberta.ca>
To: David Fetter <dfetter@shell4.ba.best.com>
Subject: Re: Generating the partitions of a string
Message-Id: <om90rucr2u.fsf@tees.cs.ualberta.ca>

In article <6b2oqc$spl$1@nntp1.ba.best.com> David Fetter <dfetter@shell4.ba.best.com> writes:

> Slup in a string, and generate all of its partitions, so 'word'
> generates the arrays:
> ['word'], ['wor','d'], ['wo','rd'], ['wo','r','d'], ['w','ord'],
> ['w','or','d'], ['w','o','rd'], ['w','o','r','d']

Well what you have here is a combinatorics problem since it only
depends on the length of the string. I rephrase the problem as
"For a given n, generate all sequences n1+..+nk=n". I'd look for a
solution in an algorithms book, or ask on comp.theory. I can think of
a recursive solution, but it's probably not optimal. One'd think
that a CS grad student would know this offhand, but I don't :(

The idea is: given P(n) (a list of the partitions of n), you can
generate all P(n+1) by 
a) inserting a '1' to the list in all possible places between two elems
b) adding a 1 to all possible numbers

Will there be duplicates in the lists thus generated?
- b) won't generate duplicate lists 
- a) will generate duplicate lists when one of the elements
  on either side of the insertion point is '1'. This can be eliminated
  easily by never inserting the new '1' after an existing 1.
- however, a) and b) can mix up; I don't know how to eliminate the
  duplicates quickly.

#!/usr/local/perl5/bin/perl -w

use strict;

sub partition ($) {  # return an array of array-refs of all
                     # unordered partitions n=n1+..+nk
  my $n = shift;
  return [1] if $n == 1;
  my @part = partition($n-1);
  my @result = ();
  for (my $i = 0; $i < @part; $i++) {
    for (my $j = 0; $j < @{$part[$i]}; $j++) {
      my @p = @{$part[$i]};
      $p[$j]++;
      push @result, [@p];
    }
    for (my $j = 0; $j <= @{$part[$i]}; $j++) {
      my @p = @{$part[$i]};
      if ($j == @p || $p[$j] != 1) { # insert 1 only before non-1
        splice @p, $j, 0, 1; 
        push @result, [@p];
      }
    }
  }
  @result
}

sub partition_word ($) {
  my $word = shift;
  map {
    my $pos = 0; 
    [map {
      my $s = substr($word, $pos, $_);
      $pos += $_;
      $s
    } @$_];
  }
  partition length $word
}

map {print @$_," "} partition(4); print "\n";
map {print @$_," "} partition(5); print "\n";

OUTPUT:

4 13 31 22 13 112 121 31 22 121 211 31 22 121 211 22 13 112 121 211
121 112 1111

5 14 41 23 14 113 131 41 32 131 311 32 23 122 212 221 23 14 113 131
212 122 113 1112 1121 221 131 122 1121 1211 41 32 131 311 32 23 122
212 221 221 131 122 1121 1211 311 221 212 1211 2111 41 32 131 311 32
23 122 212 221 221 131 122 1121 1211 311 221 212 1211 2111 32 23 122
212 221 23 14 113 131 212 122 113 1112 1121 221 131 122 1121 1211 311
221 212 1211 2111 221 131 122 1121 1211 212 122 113 1112 1121 2111
1211 1121 1112 11111

As you see the situation has gotten out of control for 5.

> My motivation here is a mnemonic system which can be used to
> remember numbers long term.  I have a dictionary lookupizer
> that gives back a list of words from a number, and want to
> extend the thing to bigger numbers, but still be quick.

Excuse me, but this paragraph doesn't make much sense to me. What list
of words is associated with a number? And how would partitions help
with this? Keep in mind that the number of partitions is exponential
if not worse. If you describe better what you want to do, perhaps I
can help with some Trie (sic) advice.



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

Date: Fri, 30 Jan 1998 17:28:53 GMT
From: eqbridges@cbs.com (Ed.Q.Bridges)
Subject: HELP: Using FIND2PERL & symlinks
Message-Id: <34d20c11.12345151@news.spry.com>

i have perl script (below) generated by find2perl, which scans a
directory looking for specific files, and then tars these files to
stdout.

unfortunately, i'm forced to use symbolic links in the search
directory, and the script is not dereferencing the links.  

could someone point me to the section of the code that doesn't
follow symlinks, or is there some switch in find2perl which will 
force dereferencing of links.

i need to get this script working asap, so any answers would be
especially appreciated if done quickly.  

i will chant for extra kharma
points for the extra help!

please email your response to eqbridges@cbs.com if not too much
trouble!

thanks  a  bunch!!!
--ed--
www.cbs.com

the script follows:

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

#!/opt/local/gnu/bin/perl
require "find.pl";

### findfiles.pl   begun 01.24.98   eqbridges@cbs.com
### * copies specific types of files into a tarfile
### * excludes contents of specific directories
### * deletes the copied files
###
### Usage:
### The path to the parent directory of the directory 
### tree to be searched is passed as an argument.
### The tarfile is written to STDOUT, and can be 
### redirected wherever.
###
### Extensions included:
###   * gif, jpg, jpeg, ht.*, class, swf
### Directories excluded:
###   * wch, temp
###
### sub wanted is called by the find subroutine,
### in find.pl.  $dir contains the current directory 
### name, and $_ the current filename within that directory.
### $name contains "$dir/$_".  You are cd'ed to $dir 
### when the function is called.  
###
### Caveats:
###   * does not exclude the directory entries of
###   excluded directories, only their contents.

CONFIG:
{
    $SearchDir = shift;
    chdir( $SearchDir );
}

MAIN:
{
    &find('.');
    &tflushall;

    if(scalar @Delete)
    {
      foreach(@Delete)
      {
##DEBUG##   print STDERR "Error Deleting $_: $!\n" unless (unlink);
          print STDERR "Deleting $_\n";
    }
    }

    exit;
}


sub wanted {
    (
     ### PRUNED DIRECTORIES
     /^wch$/  && ($prune = 1) 
     || 
     /^temp$/ && ($prune = 1) 
     || 
     ### INCLUDED FILES
     /^.*\.gif$/i   || 
     /^.*\.jpg$/i   || 
     /^.*\.jpeg$/i  || 
     /^.*\.htm.*$/i || 
     /^.*\.class$/i || 
     /^.*\.swf$/i   
     ) 
      && ($nlink || (($dev,$ino,$mode,$nlink,$uid,$gid) = stat($_)))
&& &tar(STDOUT
);

    push @Delete, $name unless (-d $& or !(-f $&));
}

sub tar {
    local($fh) = @_;
    local($linkname,$header,$l,$slop);
    local($linkflag) = "\0";

    ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
      $atime,$mtime,$ctime,$blksize,$blocks) = stat(_);
    $nm = $name;

    if ($nlink > 1) {
      if ($linkname = $linkseen{$fh,$dev,$ino}) {
          $linkflag = 1;
      }
      else {
          $linkseen{$fh,$dev,$ino} = $nm;
      }
    }
    if (-f _) {
    open(IN, "./$_\0") || do {
          warn "Couldn't open $name: $!\n";
          return;
      };
      $size = 0 if $linkflag ne "\0";
    }
    else {
      $linkname = readlink($_);
      $linkflag = 2 if defined $linkname;
      $nm .= '/' if -d _;
      $size = 0;
    }

    $header = pack("a100a8a8a8a12a12a8a1a100",
      $nm,
      sprintf("%6o ", $mode & 0777),
      sprintf("%6o ", $uid & 0777777),
      sprintf("%6o ", $gid & 0777777),
      sprintf("%11o ", $size),
      sprintf("%11o ", $mtime),
      "        ",
      $linkflag,
      $linkname);
    $l = length($header) % 512;
    substr($header, 148, 6) = sprintf("%6o", unpack("%16C*",
$header));
    substr($header, 154, 1) = "\0";  # blech
    $tarout{$fh} .= $header;
    $tarout{$fh} .= "\0" x (512 - $l) if $l;
    if ($size) {
      &tflush($fh) while ($l = length($tarout{$fh})) >= 10240;
      while (sysread(IN, $tarout{$fh}, 10240 - $l, $l)) {
          $slop = length($tarout{$fh}) % 512;
          $tarout{$fh} .= "\0" x (512 - $slop) if $slop;
          &tflush($fh);
          $l = length($tarout{$fh});
      }
    }
    close IN;
}

sub tflush {
    local($fh) = @_;

    while (length($tarout{$fh}) >= 10240) {
      syswrite($fh,$tarout{$fh},10240);
      ++$blocks{$fh};
    substr($tarout{$fh}, 0, 10240) = '';
    }
}

sub tflushall {
    local($len);

    foreach $fh (keys %tarout) {
      $len = 10240 - length($tarout{$fh});
      $len += 10240 if $len < 1024;
      $tarout{$fh} .= "\0" x $len;
      &tflush($fh);
    }
}



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

Date: Mon, 2 Feb 1998 09:50:20 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: How to write fixed format data?
Message-Id: <ebohlmanEnqwnw.KLo@netcom.com>

Jaime Metcher <metcher@spider.herston.uq.edu.au> wrote:
: Printf pops up again and again in the perl docs (must be a useful
: routine). However, Win32 users don't necessarily have documentation for
: printf formats.   There's nothing in the perl docs or the FAQs. 
: Searching the net for "+printf +formats" reveals an immense number of
: GAWK manuals, as well as the following printf man page:

The description of sprintf in perlfunc.pod contains a quite passable 
listing of all the format arguments available (and the entry for printf 
points to the one for sprintf).  Perlfunc.pod comes with at least one of 
the Win32 ports, and both of them definitely include an HTML version of 
the same thing.

It is true that the entries aren't a complete tutorial on how to use
printf, and one could make a good argument that they should be amplified a
little, rather than assuming that anyone writing Perl necessarily has a C
background.  On the other hand, the Camel book explains the functions in
pretty good detail (enough, IMHO, for someone with no C background to
understand them), and one could argue that perlfunc.pod is intended as a
reference, not a tutorial and that anyone needing more detailed
information should have a book. 

The only "Win32" issue here is that Win32 users are less likely to have a 
C compiler on their machines than Unix users.


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

Date: Mon, 2 Feb 1998 10:37:15 +0100
From: "Cristiano" <meetserv@tin.it>
Subject: I'ready to pay
Message-Id: <6b440i$oim@everest.vol.it>

I really need a cgi scpript wrote in perl lang.

Who is able to work ASAP for my need  come alive.........(please)






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

Date: Mon, 02 Feb 1998 08:29:27 -0500
From: "Bill Jones, FCCJ Webmaster" <webmaster@fccj.cc.fl.us>
To: Cristiano <meetserv@tin.it>
Subject: Re: I'ready to pay
Message-Id: <34D5CA37.BB91CCE3@fccj.cc.fl.us>

What do you want done.

Most things have already been done and are available for free.  You
would just need to download them and fix them to suite your needs.

HTH,
Bill


Cristiano wrote:
> 
> I really need a cgi scpript wrote in perl lang.
> 
> Who is able to work ASAP for my need  come alive.........(please)


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

Date: 2 Feb 1998 12:01:38 GMT
From: PerSteinar.Iversen@adm.hioslo.no (Per Steinar Iversen)
Subject: LDAP: T.61 <-> ISO-8859-1 anyone?
Message-Id: <slrn6dbdd1.f51.PerSteinar.Iversen@elbonia.p52.hioslo.no>

There is a Perl module Net::LDAPapi on CPAN,
it makes it possible to access LDAP servers
from Perl, it works very well in fact.

Unfortunately LDAP (v2.0 at least) uses a
strange character encoding called T.61 for
non-ASCII characters. This makes Net:LDAPapi
quite useless outside the English speaking
world! As an example, the Director of the
place where I work has his name encoded
as "{"/}sulv Fr{l/}ysnes" :-(

So, does anybody know where to find a
T.61 <-> ISO-8859-1 module or just Perl
routine?

-psi


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

Date: 02 Feb 1998 08:41:58 +0100
From: Gisle Aas <aas@sn.no>
Subject: Re: LWP problem: Error: 500 Offset outside string
Message-Id: <m3n2gajvw9.fsf@furu.g.aas.no>

Scott Walde <scott_hates_spam@saskatoon.com> writes:

> I'm getting this error message:
> 
> Error: 500 Offset outside string
> 
> When trying to execute this line:
> 
> my $res = $ua->request($req);
> ($ua is a LWP::UserAgent, $req is a HTTP::Request)
> 
> The funny thing is, this code runs on another machine just fine.
> 
> Old machine (where it works) is a Pentium 75, RH Linux 4.2 with Perl
> 5.003,  LWP 5.08.  The new machine is a Pentium 75 with RH5.0, Perl
> 5.004, LWP 5.19.  Is this a glibc issue?

I don't know.  This message is generated by Perl when sysread() (or
read()) is given a bad offset parameter.

  $ perl -le 'sysread(STDIN, $a, 5, -4)'
  Offset outside string at -e line 1.

I would think that all the calls to sysread in LWP/Protocol/http.pm
should be safe (length($buf) should never be an "offside outside
string"):

  $ grep sysread http.pm 
            my $n = $socket->sysread($buf, $size, length($buf));
                my $n = $socket->sysread($buf, $size, length($buf));
        my $n = $socket->sysread($buf, $size);

Does this happens for all URLs you try?

Perhaps you can debug it?  Start by finding out which of the sysreads
are failing and then investigating the $buf.  Perhaps an strace(1) on
the process reveals something of interest?

-- 
Gisle Aas


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

Date: 2 Feb 1998 07:53:17 GMT
From: mnanao@jeeves.ucsd.edu (Money Crushing Machine)
Subject: mod_perl 1.07 problem/question
Message-Id: <6b3u1d$p5h$1@sdcc12.ucsd.edu>

Has anyone come across the error (from the apache with mod_perl error log):

[Sun Feb  1 23:34:18 1998] Can't locate object method "request" via package "Apa
che" at /usr/local/lib/perl5/site_perl/Apache/Registry.pm line 22.

?

I've installed the newsest perl5 flavor, remade mod_perl 1.07 and had it
compile apache 1.2.3, both of which compiled without any warnings.
I've followed the instructions for how to embed CGI's in a mod_perl enabled
apache server, but I still get the afore mentioned error.  Any suggestions
would be greatly appreciated!  My apologies if this is somewhere in the
faq, but I couldnt find it after several dejanews and altavista searches.


Max



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

Date: Mon, 2 Feb 1998 13:54:14 +0300
From: "Michael Sazonov" <mike@inforis.ru>
Subject: Re: OLE doesn't work
Message-Id: <6b48pd$ma3@xpress.inforis.nnov.su>

Chip Salzenberg wrote in message ...

>OLE doesn't work the same way in Perl as in other
languages.
>Sample code would help.


Which sample code?
This sample code

use OLE;
$excel = CreateObject OLE 'Excel.Application'
 or warn "Couldn't create new instance of Excel App!!";
$excel->Workbooks->Open( 'test.xls' );
$excel->Workbooks(1)->Worksheets('Sheet1')->Cells(1,2)-
>{Value} = 'foo';
$excel->Workbooks(1)->Worksheets('Sheet1')->Cells(1,2)-
>{Value} = 'bar';
$excel->Save();
$excel->Quit();

is very simple and produces the same error:

Can't call method "Open" without a package or object
reference at oletest.pl line 4.

---
Michael Sazonov, mike@inforis.ru





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

Date: 02 Feb 1998 02:57:45 +0200
From: Lasse A Vartiainen <lav@huilu.hut.fi>
Subject: Re: perl.. confusing..
Message-Id: <i3opvl66cxi.fsf@huilu.hut.fi>

"mov" <mov@sci.fi> writes:

> I'm newbie with perl, and I wanted to know few things. 

As Marc noted this comp.lang.perl.expert.unix might not be the best
place for the question, but anyway:


> 	i have counter.pl ?? what should i do with it? i have done cgi-bin
> directory to my wwwhomeplace. And put chmod 755 with it.. and whats the
> problem now is that i dont know how to use this.. 

Assuming that you are using UNIX and the ISP allows running of CGI
from any directory (most don't allow CGIs at all).


> #!/opt/perl/bin/perl <- thats what my internet provider told me to
> use..

The first line with '#!' indicates the path of the program the file
should be feeded to. You can find the path of perl with command "which
perl" (should match with the line the ISP told).


> 	what are these??
[.pl .cgi .sh]

Apparently sci's webserver considers files ending with ".cgi" as
executable cgi-scripts (mostly the endings are just name tags without
deeper meaning to the operating system).


So, to make the counter work you might:
	-Make sure the counter-program has the correct '#!/path..' as
	 the first line.
	-Add ".cgi" to the program name (mv counter.pl counter.cgi)
	-Just refer to the program from your html page (like <img
	src="http://www.sci.fi/~../.../counter.cgi alt="">)


If doesn't work...time to consult the ISP again...so much depends on
the system.


			Lasse




p.s. to langually challenged, 'SCI' maps quite well to 'AOL'


-- 
lav@iki.fi : Not for ourselves but for the world we have born into. 


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

Date: 2 Feb 1998 12:30:17 GMT
From: tzdpab@procats1.afibs.ch (Bernd Patolla)
Subject: Problem with TIE and DB_File
Message-Id: <6b4e8p$ghp$1@promail1.bs.ch>

Hi,
i want to use the tie-function accessing a db-file.
When I create the tied variable I always get the following error:

Can't locate object method "TIEHASH" via package "DB_FILE" at ./db1.pl line 5

Here comes my little code:

#!/usr/local/bin/perl -w

use DB_File ;

tie ( %Aliases, "DB_FILE", "/var/adm/sendmail/aliases", 1, 0 ) ;

while ( ($key, $value) = each %Aliases ) {
        print $key, "\t= ", $value ;
}

untie (%Aliases) ;

Can you help me ? 
Whats going wrong ?

--
      \\|//
      (o o)
---ooO-(-)-Ooo----------------------------------------------------------
Email : Bernd.Patolla@afibs.ch		Bernd Patolla
Phone : (++41) 61 267 6536		Zentrale Informatik Basel-Stadt	
Fax   : (++41) 61 267 6545		Postfach	  CH 4003 Basel
X400  : c=ch;a=400net;p=adminbs;o=fd;ou1=zid;cn=Bernd Patolla


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

Date: Mon, 02 Feb 1998 12:06:15 +0100
From: Prasad Alavilli <prasad@stro5.vub.ac.be>
Subject: random number generator?
Message-Id: <34D5A8A6.7EE169F7@stro5.vub.ac.be>

Hello,

I am looking for a reasonable/good random number generator
for use with Perl.
Please send me any information on this.

Thanks
Prasad



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

Date: 02 Feb 1998 12:56:30 +0000
From: Richard Caley <spt@cstr.ed.ac.uk>
Subject: Re: recursive regex?
Message-Id: <eyh67my17y9.fsf@liddell.cstr.ed.ac.uk>

In article <6b1o86$mt61@zinc.imation.com>, Mark Rostron (mr) writes:

mr> am writing a parser and would like to use regex to easily decode nested
mr> funcion calls - any ideas?

Can't be done (at least generally). Regular expressions recognise
regular languages and regular languages don't include recursive
structures. Wouldn't put it past `them' to provide non-regular regular
expressions in some future perl though :-).

Meanwhile, the best thing to do is to split the input into tokens with
a regular expression and then do the parse with a loop, a stack and a
state variable.

One o fthings I'd really like ot see would be a non-language specific
parser generator which could spit out perl, Java, scheme and all the
other languages I end up coding little parsers in. Perhaps it exists
and everyone else knows all about it but me.

-- 
Mail me as rjc not spt@cstr.ed.ac.uk		_O_
						 |<



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

Date: Mon, 02 Feb 1998 12:14:18 +0100
From: "Bjvrn Nilsson" <bjorn.w.nilsson@edt.ericsson.se>
Subject: solution for multiline comments???
Message-Id: <34D5AA8A.7165D7A5@edt.ericsson.se>

Hi all!

Has anyone figured out how to in a convienient way do mulitline comments
a la C, Java etc.
OK, I know that one solution is to write a perl snippet that looks for
some special tags (e.g. startcomm and endcomm) and than comment
everything out in between those lines.

But is there some kind of simpler solution, where I don't have to
process a script with a script?

Bjvrn



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

Date: Mon, 02 Feb 1998 08:31:30 -0500
From: "Bill Jones, FCCJ Webmaster" <webmaster@fccj.cc.fl.us>
To: "Bjvrn Nilsson" <bjorn.w.nilsson@edt.ericsson.se>
Subject: Re: solution for multiline comments???
Message-Id: <34D5CAB2.24BD78E2@fccj.cc.fl.us>

Are you trying to ADD comments or REMOVE comments?

??? Bill



Bjvrn Nilsson wrote:
> 
> Hi all!
> 
> Has anyone figured out how to in a convienient way do mulitline comments
> a la C, Java etc.
> OK, I know that one solution is to write a perl snippet that looks for
> some special tags (e.g. startcomm and endcomm) and than comment
> everything out in between those lines.
> 
> But is there some kind of simpler solution, where I don't have to
> process a script with a script?
> 
> Bjvrn


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

Date: 2 Feb 1998 13:27:55 GMT
From: "William Lapides" <MetatonCSI@worldnet.att.net>
Subject: Suggestions on my New Shopping Cart System
Message-Id: <6b4hkr$o0p@bgtnsc02.worldnet.att.net>

Please check out, if you will, http://jimgraygalley.com
It is my latest version of my shopping cart script, and Id love suggestions
and comments on it.
It is the first Full CGI I have ever written, and would love to have it
cartiqued!, Thanks!
Other places where older versions of the script are:
http://gatlinburlier.com
http://young-again.com


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

Date: 02 Feb 1998 12:12:46 +0000
From: Richard Caley <spt@cstr.ed.ac.uk>
Subject: Re: Survival Of perl
Message-Id: <eyh90ru19z5.fsf@liddell.cstr.ed.ac.uk>

In article <34D37BE2.77B4@earthling.net>, Rich Grise (rg) writes:

rg> And as an "end-user", the only computer I could find with web (or
rg> "net") access for less than $20,000.00 came with w95.

Comes with Win95 doesn't mean can only run Win95. Thank god.

BTW, a Sun Ultra5 is listed at $4400.00, so god knows what you are
imagining you need.

rg> Cyrix 6x86 with w95, and VB. (I'm not a high-buck consultant who
rg> can afford to plunk down another $500.00 for VC++, which I'd have
rg> to plunk down another grand or two for school to learn how to use
rg> all that object crap.)

The object `crap' is easier than the non object crap. Pick up a book,
read it, do some, it's not rocket science. Anyway, you don't need to
use it. You can write C under a C++ environment.

And, as for price, pick up the cygnus gnuwin32 package. Free, good
compiler, access to the Windows APIs and to a good aproximation to the
unix APIs.

-- 
Mail me as rjc not spt@cstr.ed.ac.uk		_O_
						 |<



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

Date: Mon, 02 Feb 1998 07:50:47 -0600
From: Cameron Dorey <camerond@mail.uca.edu>
To: scott@softbase.com
Subject: Re: Word -> HTML
Message-Id: <34D5CF37.288E8C7F@mail.uca.edu>

scott@softbase.com wrote:
> 
> Patrick Husi (patrick@husi.ch) wrote:
> 
> > I'm looking for a converter from Word format (i.e. .doc files) to
> HTML, preferably for Perl or Java.  Anyone ??
> 
> I almost hate to say this, but ...
> 
> IT IS BUILT INTO WORD! All you do is File/Save As HTML!
> 

Not Word 95, it isn't. You're thinking of Word 97 (which I, for one,
haven't seen the need to shell out *more* bucks for).

What I do (swing around elbow, approach ear) is to use Corel WP 8 to
open the Word 95 doc, then print as HTML. Corel's translation program is
generally very good. I'm working on automating it, but haven't gotten
too far, yet.

Cameron Dorey
camerond@mail.uca.edu


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

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

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