[13981] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1391 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 16 00:08:49 1999

Date: Mon, 15 Nov 1999 21:05:11 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <942728710-v9-i1391@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 15 Nov 1999     Volume: 9 Number: 1391

Today's topics:
    Re: /o in regexp lee.lindley@bigfoot.com
    Re: ? Joining the associative array to the database. Wh <lhauta@koti.tpo.fi>
    Re: ? Joining the associative array to the database. Wh (Martien Verbruggen)
    Re: cron filehandle <rootbeer@redcat.com>
    Re: developer required for advanced Perl work <rootbeer@redcat.com>
    Re: gd.pm <rootbeer@redcat.com>
    Re: Generating pi <skilchen@swissonline.ch>
    Re: Help with Win32::Service <anti_spam@aspam101.com>
        How to install DBI module in Win98 <lhengc1@pd.jaring.my>
    Re: Multiple scripts <rootbeer@redcat.com>
    Re: Multiple scripts (Brett W. McCoy)
    Re: my ... if -- strange behavior <johnlin@chttl.com.tw>
    Re: my ... if -- strange behavior <johnlin@chttl.com.tw>
        NEED HELP: perl on solaris execution problem <r42317@email.sps.mot.com>
    Re: NEED HELP: perl on solaris execution problem <devilish9@hotmail.com>
    Re: Netscape messenger or other mail client accessable, <rootbeer@redcat.com>
    Re: Perl interface to SSH? <rootbeer@redcat.com>
    Re: PERL script with JScript embedded <rootbeer@redcat.com>
        SDBM File Limit . . . . <no@spam.com>
    Re: Slurping output form system(runme.exe) <hattons@cpkwebser5.ncr.disa.mil>
    Re: something like Text::Wrap::wrap() that's HTML aware <rootbeer@redcat.com>
        this pareser won't do 4 visual hebrew <reembar@netvision.net.il>
    Re: this pareser won't do 4 visual hebrew <uri@sysarch.com>
    Re: Unexpected error in array <rootbeer@redcat.com>
    Re: unwanted refresh with Apache server <reembar@netvision.net.il>
    Re: Where can i find more information on Schwartzian tr <makkulka@cisco.com>
    Re: Where can i find more information on Schwartzian tr <rootbeer@redcat.com>
    Re: Why perl won't print to STDOUT? lee.lindley@bigfoot.com
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 16 Nov 1999 02:47:51 GMT
From: lee.lindley@bigfoot.com
Subject: Re: /o in regexp
Message-Id: <80qgkn$c2f$1@rguxd.viasystems.com>

Bill Moseley <moseley@best.com> wrote:
:>> Bill Moseley <moseley@best.com> wrote:
:>> :>I converted a CGI script to a mod_perl script and had to remove some /o 
:>> :>from regexps.
:>> 
:>> :>The regexps only need to get built once per execution, so it was good to 
:>> :>use them in CGI where the script runs and exits.  The expressions are 
:>> :>based on data from that request and changes with each request to the CGI 
:>> :>script.  Thus, in mod_perl the script doesn't exit, so I can't use /o.
:>> 
:>> :>Short of eval'ing the entire script, is there a way I could tell perl to 
:>> :>recompile all the /o expressions?
:>> 

:>lee.lindley@bigfoot.com (lee.lindley@bigfoot.com) suggests...
:>> Use qr{} to build the regexp outside the loop.

:>Well, that's what I'm doing.  But of course, there's no 'outside the 
:>loop' in mod_perl.

:>> Is there ever a time when /o would have a meaning for a regexp
:>> built with the qr operator?  I can't see one.

:>Maybe if I explain:

:>Each 'request' to my CGI script I build one or more regular expressions 
:>using qr{} that are used over and over during that request in m// and 
:>s///.

:>   $match{ $field } = qr/^($terms)/;

Assuming that %match is not a file scoped lexical (which are
problematic for mod_perl) and/or you are clearing out %match at the
beginning of each execution, then this should work just fine.  The
regexp is recompiled only during the assignment.  You don't need /o.

:>This is used to hightlight words returned in a search engine search. 
:>$field describes where the expression applies (e.g. title, body, 
:>subject, urls), and $terms is a | joined list of search terms.

Are you sure that $terms is clean when you use it in qr?  Again,
the normal mod_perl rules to look out for those incidental closures
are important.

:>Then $match{ $field } is later used while parsing and printing results 
:>to search the search results for words that match and thus need to be 
:>highlighted.  m/$match{ $field }/ is used many, many times so it would 
:>be nice to have that precompiled by saying instead:

:>   $match{ $field } = qr/^($terms)/o;

I can't think of any reason that you would ever put a /o here!  I'm
assuming that you *want* to recompile the regexp every time that
this assignment is made.  But realize that qr is a quoteing operator.
$terms is expanded into a string that is then compiled into the regexp.
The value of $terms has no effect on the regexp if it is changed
after this line is executed regardless of whether you use /o or not.
When you use $match{$field} it does not get recompiled.  It is
only compiled once when it is assigned to $match{$field} (well,
once per execution of that statement which could be several times
during the life of the program under mod_perl).

:>This works great under CGI where the program is called once per search 
:>request, but in mod_perl, the program doesn't exit after a request.  So 
:>if I use /o the highlighting works for the first search, but subsequent 
:>searches for different terms still highlight the the words from the 
:>first search.

Only if you use /o on the qr.  You don't want to do that.

I still can't think of any situation where I would want to do that.

/o does not save you anything on qr.  There are no variables left
when the quoted string evaluation  is finished.  The only effect is
to prevent recompilation the next time you execute that line of code
(as near as I can tell from looking at "use re 'debug'" output).  I
can't see any case where that would really be useful.

while some_loop_construct {
   if (/$some_string/o) ... # Yes, makes sense for efficiency.
}


$hash{qr} = qr{$some_string}; # Only compiled once when line is executed!
while some_loop_construct {
	if (/$hash{qr}/)	# Not recompiled!
}

if ($string =~ $hash{qr})..  # Not recompiled!

$hash{qr} = qr{$another_string}; # Recompiled 

Put "use re 'debug'" in your program and examine the results.  You may
want to redirect STDERR to a file.

-- 
// Lee.Lindley   /// I used to think that being right was everything.
// @bigfoot.com  ///  Then I matured into the realization that getting
////////////////////   along was more important.  Except on usenet.


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

Date: Tue, 16 Nov 1999 05:43:19 -0000
From: "Lassi Hautakangas" <lhauta@koti.tpo.fi>
Subject: Re: ? Joining the associative array to the database. What happens ?
Message-Id: <80qjtf$hlo$1@news.koti.tpo.fi>



> >  Example
> >  "dbmopen(%assosiative_array,"database");"

> perldoc -f dbmopen

The document does not answer my question. Is the huge database in the
central memory? If this is the case, the database like this cannot for
example be used in the CGI programme. The memory will become full if there
are a lot of users.




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

Date: Tue, 16 Nov 1999 04:56:50 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: ? Joining the associative array to the database. What happens ?
Message-Id: <mu5Y3.276$Va.8148@nsw.nnrp.telstra.net>

[You should fix your newsreader. You are following up to an article,
but your newsreader has not set any references]

On Tue, 16 Nov 1999 05:43:19 -0000,
	Lassi Hautakangas <lhauta@koti.tpo.fi> wrote:
> 
> 
> > >  Example
> > >  "dbmopen(%assosiative_array,"database");"
> 
> > perldoc -f dbmopen
> 
> The document does not answer my question. Is the huge database in the
> central memory? If this is the case, the database like this cannot for
> example be used in the CGI programme. The memory will become full if there
> are a lot of users.

Euhmmm.. dbm files do not live in memory (apart from file system
caching). hashes live in memory. That's one reason why tied hashes
exist, to be able to use hash-like storage solutions, like dbm files,
as if they're hashes.

dbm files tied to a hash act like a real hash, but they're stored on
disk. They are therefore also much slower.

Since your article doesn't contain a References header, I can't tell
exactly how this all started out.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | +++ Out of Cheese Error +++ Reinstall
Commercial Dynamics Pty. Ltd.   | Universe and Reboot +++
NSW, Australia                  | 


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

Date: Mon, 15 Nov 1999 18:17:18 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: cron filehandle
Message-Id: <Pine.GSO.4.10.9911151814450.15797-100000@user2.teleport.com>

On Mon, 15 Nov 1999 palenaka@my-deja.com wrote:

> However when the cron daemon runs the scripts,

Running under cron, your program will typically have a different
environment than it does in the shell. The current working directory, the
environment variables, and the lack of a human being attached to the
standard I/O streams are often the most noticeable changes.

> 	The other problem I notice has to do with the cron reporting.
> Normally when I run a unix cron job, unix will send me an email with
> the results of the cron job, if anything was printed to <STDOUT>. I
> don't get these mailing from the server.

Sounds as if your cron daemon isn't doing what you want. Check with your
local expert or sysadmin about how your cron daemon works.

Cheers!

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



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

Date: Mon, 15 Nov 1999 18:30:45 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: developer required for advanced Perl work
Message-Id: <Pine.GSO.4.10.9911151828140.15797-100000@user2.teleport.com>

[ Follow-ups set, in case there's any Perl-related follow-up. ]

On Mon, 15 Nov 1999, Bretto wrote:

> Newsgroups: comp.lang.perl.misc
> Subject: developer required for advanced Perl work
> 
> I have a project which requires the skills of someone with advanced
> knowledge of Perl5.

Does the applicant need to know the difference between a newsgroup with
the word 'jobs' in the name and one without? 

We're all better off if we keep things where they belong. Thanks!

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



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

Date: Mon, 15 Nov 1999 18:35:17 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: gd.pm
Message-Id: <Pine.GSO.4.10.9911151834330.15797-100000@user2.teleport.com>

On Tue, 16 Nov 1999, SpewMuffin wrote:

> I have already installed gd v1.22, but the script's not recognizing
> that gd is installed when I use the 'use gd;' line.

Maybe you need to install GD instead of gd. :-)

Cheers!

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



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

Date: Tue, 16 Nov 1999 03:05:21 +0100
From: "Samuel Kilchenmann" <skilchen@swissonline.ch>
Subject: Re: Generating pi
Message-Id: <80qebl$15f93$1@fu-berlin.de>

revjack <revjack@radix.net> wrote in message
news:80flkp$p4p$1@news1.Radix.Net...
> Anybody ever tool up an algorithm in perl to generate the
> digits of pi? I've been searching the web for an hour and no
> dice. Don't see a Math::Pi on CPAN either. Hm.
>
Here are two almost literal translations to Perl of algorithms found
in the SCM scheme distribution from Aubrey Jaffer (available here:
http://swissnet.ai.mit.edu/~jaffer/SCM.html)

#!/wherever/perl -w
#
# comment taken from pi.scm in the Scheme distribution mentioned
# above:
#
# pi(<n>, <d>) prints out <n> digits of pi in groups of <d> digits.
#
# 'Spigot' algorithm originally due to Stanly Rabinowitz.
# This algorithm takes time proportional to the square of <n>/<d>.
# This fact can make comparisons of computational speed between
# systems of vastly differring performances quicker and more
# accurate.
#
# Try pi(100, 5)
# The digit group size <d> will have to be reduced for larger <n> or
# an overflow error will occur (on systems lacking bignums).
#
use strict;

my $number_of_digits = $ARGV[0];
my $size_of_groups   = $ARGV[1];

pi($number_of_digits, $size_of_groups);

sub pi {
  my $n = shift;
  $n ||= 100;
  my $d = shift;
  $d ||= 5;

  my $b = 2;
  my $j = 0;
  my $k = 0;
  my $m = 0;
  my $q = 0;
  my $r = 1;
  my $t = 0;
  my @a = ();

  while($k++ < $d) {
    $r = $r * 10;
  }

  $n = int($n / $d) + 1;
  $k = $m = int(3.322 * $n * $d);
  while($k) {
    $a[--$k] = 2;
  }

  for ($a[$m] = 4; $j < $n; $b = $q % $r) {
    $q = 0;
    for ($k = $m; $k;) {
      $q += $a[$k] * $r;
      $t = int(2 * $k) + 1;
      $a[$k] = $q % $t;
      $q = int($q / $t);
      $q *= $k--;
    }
    printf("%0*d%s", $d, $b + int($q / $r), (++$j % 10) ? " ": "\n");
  }
  printf("\n");
}

__END__


And another one using Math::BigInt, the comment is again taken from
the original pi.scm:

#!wherever/perl -w
#
# bigpi(<n>) prints out <n> digits of pi.
#
# 'Spigot' algorithm originally due to Stanly Rabinowitz:
#
# PI = 2+(1/3)*(2+(2/5)*(2+(3/7)*(2+ ... *(2+(k/(2k+1))*(4)) ... )))
#
# where 'k' is approximately equal to the desired precision of 'n'
# places times 'log2(10)'.
#
# This version takes advantage of "bignums" to compute all
# of the requested digits in one pass!  Basically, it calculates
# the truncated portion of (PI * 10^n), and then displays it in a
# nice format.
#
use strict;
use Math::BigInt;


sub bigpi {
  my $digits = shift;;
  my $n = 10 * int(($digits + 9) / 10);

  my $z = int(($n * log(10)) / log(2));

  my $x = Math::BigInt->new('2');
  my $i = int($n / 10);
  my $c = Math::BigInt->new('10000000000');
  for (;$i > 0; $i--) {
    $x = $x * $c;
  }

  my $k = $z + $z + 1;
  my $p = $x + $x;

  while($z > 0) {
    $p = $x + ($p * $z) / $k;
    $k -= 2;
    $z -= 1;
  }

  print "3.\n";
  $p = substr($p,2);
  for ($i = 0; $i < $n; $i += 10) {
    print substr($p, $i, 10);
    if (($i + 10) % 50) {
      print " ";
    } else {
      print "\n";
    }
  }
}

bigpi($ARGV[0]);

__END__




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

Date: Mon, 15 Nov 1999 21:13:03 -0500
From: "Tex" <anti_spam@aspam101.com>
Subject: Re: Help with Win32::Service
Message-Id: <I43Y3.2174$dq4.117850@ndnws01.ne.mediaone.net>

post ur problem so everyone can benefit.

Tex ---

<michaelh@erols.com> wrote in message
news:3828ef69.2805984@news.erols.com...
> If anyone has experience with this module, could you please email me?





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

Date: Tue, 16 Nov 1999 10:59:54 +0800
From: "Ong" <lhengc1@pd.jaring.my>
Subject: How to install DBI module in Win98
Message-Id: <80qgsu$ol0$1@news4.jaring.my>

How to install DBI module and make it run in Windows 98?

Kindly guide. Thank You.






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

Date: Mon, 15 Nov 1999 18:26:29 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Multiple scripts
Message-Id: <Pine.GSO.4.10.9911151825350.15797-100000@user2.teleport.com>

On Sun, 14 Nov 1999, Alexei Novikov wrote:

> I have a multiple perl scripts within my program. All of them share some
> information, like the path to the files to process, passwords to access
> db, etc. I was wondering if there is a tool that will be able to read
> this information from one file and then write it to all script files ?

It sounds as if you want to have one configuration file which all the
others would read. That file could be a Perl library or module; see the
docs for details. Cheers!

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



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

Date: Tue, 16 Nov 1999 04:39:29 GMT
From: bmccoy@news.lan2wan.com (Brett W. McCoy)
Subject: Re: Multiple scripts
Message-Id: <slrn831ofv.qpn.bmccoy@dragosani.lan2wan.com>

Also sprach Alexei Novikov <anovikov@heron.itep.ru>:

>I have a multiple perl scripts within my program. All of them share some
>information, like the path to the files to process, passwords to access
>db, etc. I was wondering if there is a tool that will be able to read
>this information from one file and then write it to all script files ? I
>think that MakeMaker can do this but I have no clue how. Any
>suggestions, pointers ?

You'll want to look up the documentation on modules and packages. They
enable you to share common functions, data, etc. across several scripts.
Try 'perldoc -q module' and read on.

-- 
Brett W. McCoy           
                                        http://www.lan2wan.com/~bmccoy/
-----------------------------------------------------------------------
"I'm a mean green mother from outer space"
 -- Audrey II, The Little Shop of Horrors


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

Date: Tue, 16 Nov 1999 10:13:43 +0800
From: "John Lin" <johnlin@chttl.com.tw>
Subject: Re: my ... if -- strange behavior
Message-Id: <80qghk$4d3@netnews.hinet.net>

Rick Delaney wrote

> This is a result of a feature that allows you to have
> static vars in your subs.

> This "allows" you to write subs like
>
>     sub foo {
>         my $static if 0;
>         return ++$static;
>     }
>
> and then each invocation of foo will always access the same $static.
> Since the condition is false, there is no runtime effect of C<my> (that
> would create a new variable) so expressions using $static always refer
> to the same variable.
>
> Of course, that's a pretty obscure way of writing
>
>     {
>         my $static;
>         sub foo { return ++$static }
>     }
>
> and IMHO should draw a warning.

I think we need to discuss whether it is a Perl's intended feature
or a Perl's bug which need correcting.
Only when I am sure it is a feature, I will use it in my programs.

IMHO, this kind of static variable is confusing and hard to initialize.

    sub countdown {  my $static=9 if 0;  print $static--  }
    for(1..9) { countdown }

------------------------------------------- run it
Warning: Use of uninitialized value
-1-2-3-4-5-6-7-8        # not 987654321

On the contrary,

    {  my $static=9;  sub countdown { print $static-- }  }

is easy to understand and clear in both scoping and initialization.

Furthermore, current versions of Perl treat

    my $static=3 if $condition;
as
    my $static= $condition? 3: undef;

and none of the documents mention about this static feature.

IMHO, I think the problem of the code I posted previously
has something to do with Perl's internal optimization.
It doesn't seem to be intended for static variables.
It might be a bug of Perl.

John Lin




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

Date: Tue, 16 Nov 1999 12:32:27 +0800
From: "John Lin" <johnlin@chttl.com.tw>
Subject: Re: my ... if -- strange behavior
Message-Id: <80qmol$csj@netnews.hinet.net>

John Lin wrote

> IMHO, this kind of static variable is confusing and hard to initialize.
>
>     sub countdown {  my $static=9 if 0;  print $static--  }
>     for(1..9) { countdown }

Hmm... I think of a way to initialize it.

    sub countdown {  my $static=9 unless defined $static;  print
static--  }

John Lin

P.S.  Of course, the above code won't work in current versions of Perl.

If we 'use strict', we get
    Fatal: Global symbol "$static" requires explicit package name

If we use '-w' with 'no strict', we get
    Warning: Name "main::static" used only once: possible typo
and the result is
    999999999





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

Date: Tue, 16 Nov 1999 10:00:02 +0800
From: Noira Hadi <r42317@email.sps.mot.com>
Subject: NEED HELP: perl on solaris execution problem
Message-Id: <3830BAA2.7082F0E1@email.sps.mot.com>

Hello,

I have a problem to exeute my perl script on . Here's the scenario:

- My perl script is located in a Sun machine shared by all my client
machines (thru NFS).
- All the environment settings are common (shared) which is located in
the server.
- Some of the clients are able to run the script by typing the
'filename' but some of them
    needs perl typed followed by filename ('perl filename').

appreciate any feedback.

Regards,
hadi



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

Date: Mon, 15 Nov 1999 23:32:37 -0500
From: "Gene Dupler" <devilish9@hotmail.com>
Subject: Re: NEED HELP: perl on solaris execution problem
Message-Id: <80qmju$vd$1@fir.prod.itd.earthlink.net>

It sounds to me that this might be a file/NFS permission problem.

Make sure that the executable location of perl is the same on the NFS
clients as it is on the server.  Check the first line of the program and
make sure that file exists on each machine in your environment.

Also, check the permissions of both perl and the script.  Make sure that you
have execute and read permissions from the client, with the UID which you
are operating as.  Remember, root is not always considered UID 0 under NFS.
The NFS access permissions may be those of "nobody" unless you are sharing
out the filesystem with the "root=" option properly set (at least under
Solaris 2.x).

The quick way to change your permissions, unless your security requirements
dictate otherwise, would be to do something like this from the NFS server
where the files reside:

# chmod 755 <perl-executable> <perl-script>

I hope this helps ...

Noira Hadi <r42317@email.sps.mot.com> wrote in message
news:3830BAA2.7082F0E1@email.sps.mot.com...
> Hello,
>
> I have a problem to exeute my perl script on . Here's the scenario:
>
> - My perl script is located in a Sun machine shared by all my client
> machines (thru NFS).
> - All the environment settings are common (shared) which is located in
> the server.
> - Some of the clients are able to run the script by typing the
> 'filename' but some of them
>     needs perl typed followed by filename ('perl filename').
>
> appreciate any feedback.
>
> Regards,
> hadi
>





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

Date: Mon, 15 Nov 1999 18:10:32 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Netscape messenger or other mail client accessable, Win 32?
Message-Id: <Pine.GSO.4.10.9911151810130.15797-100000@user2.teleport.com>

On Mon, 15 Nov 1999, Tim Richardson wrote:

> Is there a module that allows Perl to access the Netscape mail database?

If there's a module which does what you want, it should be listed in
the module list on CPAN. If you don't find one to your liking, you're
welcome and encouraged to submit one! :-)  Hope this helps!

    http://www.cpan.org/

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



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

Date: Mon, 15 Nov 1999 18:06:50 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Perl interface to SSH?
Message-Id: <Pine.GSO.4.10.9911151806380.15797-100000@user2.teleport.com>

On Mon, 15 Nov 1999, Neil Cherry wrote:

> Is there a Perl interface/module which permits access to the SSH
> protocols?

If there's a module which does what you want, it should be listed in
the module list on CPAN. If you don't find one to your liking, you're
welcome and encouraged to submit one! :-)  Hope this helps!

    http://www.cpan.org/

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



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

Date: Mon, 15 Nov 1999 18:33:37 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: PERL script with JScript embedded
Message-Id: <Pine.GSO.4.10.9911151832250.15797-100000@user2.teleport.com>

On Mon, 15 Nov 1999, Mark Henderson wrote:

> I tried something like
> 
> <SCRIPT LANGUAGE = "JAVASCRIPT">
>    alert("You left a field blank");
> </SCRIPT>
> 
> in place of the $Msg line below, but the server spit up on it.

If you're having trouble getting your server to do what you want, perhaps
you need to search for the docs, FAQs, and newsgroups about servers. (This
newsgroup is about Perl, not servers.)

Cheers!

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



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

Date: Tue, 16 Nov 1999 02:16:01 -0000
From: "Simon Brook" <no@spam.com>
Subject: SDBM File Limit . . . .
Message-Id: <80qeai$12c$1@supernews.com>

Short query that I honestly didn't find in the FAQ or perldoc . . . . (if
it's there then my humble apologies)

I am using 'SDBM_File' for storing user names, so that people can log back
into a huge form (9 forms actually) which is controlled by a wrapper, should
they get bored (which yes they most likely will!) and want to come back
later.

I have been alerted that there is a file size limit to such files and would
really like to know if this claim is substantiated. If so (eek!) what should
I do?

I'm afraid I haven't been able to get NDBM_File to work, and yes I did look
at the tie function page, but I still wasn't able to do it.

Help greatly appreciated.




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

Date: Mon, 15 Nov 1999 21:31:58 -0500
From: "Steven T. Hatton" <hattons@cpkwebser5.ncr.disa.mil>
Subject: Re: Slurping output form system(runme.exe)
Message-Id: <3830C21E.652A0780@cpkwebser5.ncr.disa.mil>

Scott,

I can do that.  That isn't what I want.  I don't want to create the temporary
files at all.  I want to do something like Open2 does.  I can't figure out
exactly what it does, but I think it is close.  Here's what I want:

Query a database and put results into a variable:

Stream the contents of the variable to a command line tool that processes the
value of the variable.

Put the results of the command line into another variable.

I don't want to create the temporary files.

Thanks,

Steve

Scott Lanning wrote:

> "Steven T. Hatton" <hattons@cpkwebser5.ncr.disa.mil> writes:
> > $result=`commandname.exe`;
> >
> > I still need to send the contents of $variable to the command.  Suppose
> > I dump the contents of $variable to an output file called dump.txt.  I
> > can do the following at the command line:
> >
> > type dump.txt | commandneame.exe
>
> If you can do that, surely could just
>
>     $result = `commandname.exe < dump.txt`;
>
> --
> qualification: I'm a dimwit according to someone who emailed me




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

Date: Mon, 15 Nov 1999 18:06:12 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: something like Text::Wrap::wrap() that's HTML aware?
Message-Id: <Pine.GSO.4.10.9911151805120.15797-100000@user2.teleport.com>

On 15 Nov 1999, Jed Parsons wrote:

> Is there anything like Text::Wrap::wrap() out there that knows how to
> overlook HTML markup (not count it as text, not break lines in the
> middle of attribute lists, etc.)?

Most (but not all) HTML doesn't need to be wrapped. But if you need to
wrap some text, maybe you could do what you want with the help of
HTML::Parser from CPAN. Good luck!

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



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

Date: Tue, 16 Nov 1999 05:11:45 +0200
From: Re'em Bar <reembar@netvision.net.il>
Subject: this pareser won't do 4 visual hebrew
Message-Id: <3830CB71.587F0575@netvision.net.il>

since the HTML file I work on is in Visual Hebrew, I can't use the
standard HTML::Parser.
all I want is to know how the hell do I exclude --> from my regexp
search, which is the only problem with my Hebrew parser.
but since this group is more interested in insults then in Perl, I'll
try my luck elsewere.
have a nice life.
-- 
Re'em
http://snark.co.il


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

Date: 15 Nov 1999 23:42:13 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: this pareser won't do 4 visual hebrew
Message-Id: <x7r9hrujx6.fsf@home.sysarch.com>

>>>>> "RB" == Re'em Bar <reembar@netvision.net.il> writes:

  RB> since the HTML file I work on is in Visual Hebrew, I can't use the
  RB> standard HTML::Parser.

as for hebrew vs. english, i assume the html tags are in english as the
specs say that so it should not be a problem for the modules to parse
your files.  what you want is not simple, hence the modules to parse
html. have you tried them?

  RB> all I want is to know how the hell do I exclude --> from my regexp
  RB> search, which is the only problem with my Hebrew parser.
  RB> but since this group is more interested in insults then in Perl, I'll
  RB> try my luck elsewere.

well, good luck. your regex problem will be the same in any language you
choose. you have to learn about regexes to properly use them. all the
posters here have been telling you to do that. you are showing a
fundamental lack of understanding of what [] means in a regex. you have
been told that and you ignore it. so you choose to ignore us, and we
won't be able to help you in the future.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Mon, 15 Nov 1999 18:13:09 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Unexpected error in array
Message-Id: <Pine.GSO.4.10.9911151811370.15797-100000@user2.teleport.com>

On Mon, 15 Nov 1999, Martin Foster wrote:

> I was rather thrilled when I discovered that someone had taken the time
> to write a module for Perl that would allow interaction with GPG.

You seem to mean 'PGP'.

> Unfortunately, things comes to a standstill, when I
> attempt to use it with Apache as a CGI script. 

When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.

   http://www.perl.com/CPAN/
   http://www.cpan.org/
   http://www.cpan.org/doc/FAQs/cgi/idiots-guide.html
   http://www.cpan.org/doc/manual/html/pod/

Hope this helps!

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



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

Date: Tue, 16 Nov 1999 05:17:11 +0200
From: Re'em Bar <reembar@netvision.net.il>
Subject: Re: unwanted refresh with Apache server
Message-Id: <3830CCB7.58170DB1@netvision.net.il>

since I am a lettuce expert, you should have tried...
too late now. I have walked away.
-- 
Re'em
http://snark.co.il


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

Date: Mon, 15 Nov 1999 18:16:52 -0800
From: Makarand Kulkarni <makkulka@cisco.com>
Subject: Re: Where can i find more information on Schwartzian transform!
Message-Id: <3830BE94.8912CBA0@cisco.com>



Benjamin Gu wrote:

> Dear all, would like to show me
> where i can find more information on
> Schwartzian transform?
>

follow this URL
http://www.effectiveperl.com/recipes/sorting.html

--



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

Date: Mon, 15 Nov 1999 19:06:07 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Where can i find more information on Schwartzian transform!
Message-Id: <Pine.GSO.4.10.9911151904151.15797-100000@user2.teleport.com>

On Tue, 16 Nov 1999, Benjamin Gu wrote:

> Dear all, would like to show me
> where i can find more information on
> Schwartzian transform?

Have you tried typing the magic words "schwartzian transform" into any of
the major web search engines?

    http://www.5sigma.com/perl/schwtr.html

Cheers!

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



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

Date: 16 Nov 1999 03:31:20 GMT
From: lee.lindley@bigfoot.com
Subject: Re: Why perl won't print to STDOUT?
Message-Id: <80qj68$cqe$1@rguxd.viasystems.com>

Joe Kline <jkline@one.net> wrote:
:>[ posted and mailed to poster ]

:>avivA Starkman wrote:
:>> 
:>> Here's the situation:
:>> A csh script (dpc_script) invokes a second csh script (bist_core_flow)
:>> with a tee:
:>>         bist_core_flow |& tee $DPC_SCRIPT_LOG
:>> 
:>> Then the bist_core_flow script invokes a perl script:
:>>         perl .rulea.pl ${DESIGN}
:>> 
:><SNIP>
:>> Two weird things:
:>> 1. Everything happens exactly the way I want it to if I remove the "|&
:>> tee
:>>    $DPC_SCRIPT_LOG" from the dpc_script script.

:>Not being a shell guru, I'll take a stab at it:

A bold move in c.l.p.misc

:>The '&' puts the process in the background so the '...|&' goes into
:>the background and the 'tee' is just hanging out waiting for something
:>to happen.

Crash and burn baby.  :-)  It doesn't do that.  It just redirects
stdout and stderr together as stdin to the tee command.  Not a bad
stab at the problem and an explanation that almost, but not
quite works.  Of course a simple search  of the manual page for csh
would have found this.  I would be remiss if I didn't offer some
scolding for posting wrong answers on c.l.p.misc.  Whether or
not "off topic" or "wrong" questions are OK is debatable (and too
often debated).  But there is a consensus that wrong answers are not
left to stand.

:>> 2. When I comment out the line of perl that opens my input file, the
:>> prints
:>>    happen without needing a carriage return.

:>Don't know about this bit.

But this is the important part.  You can find a hint about the answer
with

perldoc -q buffer

When your process is writing to the terminal, it is by convention
unbuffered or line buffered.  When it writes to the pipeline it is by
convention buffered for efficiency. Perl follows this convention (in
its own fashion).  The explanation in the FAQ is pretty good.

-- 
// Lee.Lindley   /// I used to think that being right was everything.
// @bigfoot.com  ///  Then I matured into the realization that getting
////////////////////   along was more important.  Except on usenet.


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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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

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

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


------------------------------
End of Perl-Users Digest V9 Issue 1391
**************************************


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