[11258] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4858 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 9 19:07:24 1999

Date: Tue, 9 Feb 99 16:00:21 -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           Tue, 9 Feb 1999     Volume: 8 Number: 4858

Today's topics:
    Re: (Off Topic) HTTP/LWP protocol oddness challange (Abigail)
    Re: Advance Data Structure Question (Abigail)
        CGI Programmer Needed! We'll Give... BagwellDesign@excite.com
        CGI.pm and radio_group in here doc (Bill Moseley)
        clarified version of problem calling perl from bourne s mduwjd@maersk.com
    Re: Counting the resolution of a TIFF (Abigail)
        Cynamic Variable Naming <hojo@i-tel.com>
    Re: download file with perl-script (Abigail)
        email to data base script <james@travelcom.net>
    Re: Floating points in Perl (Bart Lateur)
        General Info:  How to make perl 5.005 compile: perlcc (Thomas Munn)
    Re: Helpdesk script (Abigail)
    Re: Helpdesk script <dcfrye@sybercom.net>
    Re: How to calculate number of working days? <jglascoe@giss.nasa.gov>
    Re: How to calculate number of working days? <jcounts@voicenet.com>
        How to detect process running status on WinNT? ram_panguluri@3Com.com
    Re: Installing a Module: Can't find Perl pshank@systems.dhl.com
    Re: lists within hashes <brett_s_r@hotmail.com>
    Re: locking files (Abigail)
    Re: Matching elements in arrays or hashes? <jglascoe@giss.nasa.gov>
        Need Perl Tcl/Tk for Linux <dont@send.me.nothing>
    Re: Perl for QNX (Abigail)
    Re: Prevent showing header (Bart Lateur)
        Q: Has anybody found a GPIB module? <john_moren@hp.com>
    Re: Regular expressions and handleing new lines (Bart Lateur)
    Re: Speed of Python (Matthew Bafford)
    Re: Speed of Python <tgm@math.uni-bonn.de>
    Re: strict <Paul.Coleman@CoSeCo.com>
    Re: strict <dgris@moiraine.dimensional.com>
        Tied hashes over NFS srosenthal@northernlight.com
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 9 Feb 1999 23:01:30 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: (Off Topic) HTTP/LWP protocol oddness challange
Message-Id: <79qeoa$f4b$3@client2.news.psi.net>

Bill Moseley (moseley@best.com) wrote on MCMLXXXVIII September MCMXCIII
in <URL:news:MPG.112a1368f07091d29896ab@206.184.139.132>:
^^ This started out as a Perl issue, but now I'm scratching my head.
^^ 


It's clearly something that has to do with policies/configurations/bugs
at ferguson.library.ca.gov.  Please ask them why and how.



Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'


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

Date: 9 Feb 1999 23:10:28 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Advance Data Structure Question
Message-Id: <79qf94$f4b$4@client2.news.psi.net>

gip (gibsonc@aztec.asu.edu) wrote on MCMLXXXVIII September MCMXCIII in
<URL:news:79q2au$kgv@bmw.hwcae.az.Honeywell.COM>:
,, 
,, $structures = {}; # clear structure


Not sure why you want to "clear" it, as it's not used in the code
that follows. But assigning an empty anon hash to it hardly qualifies
as "clear"ing it.



Abigail
-- 
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


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

Date: Tue, 09 Feb 1999 23:42:10 GMT
From: BagwellDesign@excite.com
Subject: CGI Programmer Needed! We'll Give...
Message-Id: <79qh4g$5pk$1@nnrp1.dejanews.com>

Hello,

I am opening a wrestling website: http://www.dlo.net/wrestling

Now, if you visit the website, you'll notice we have a newsboard. WRONG!

We HAD a newsboard, but decided to move servers. Our old server was a unix
server, this new one is a Windows NT server. We cannot get the newsboard to
work, and we're in need.

What we want is a cgi programmer who can make a cgi script similar to matt
wrights wwwboard, and install it onto the new server. We have a cgi-bin and
everything, we just can't get the newsboard to work on this windows NT server.

So we have given up on it, and are looking for a programmer to make a brand
new one with a fresh start.

This site, being a wrestling site, will be a very big website. We already are
going to setup a joint venture with a New York radio show that get's hundreds
of thousands of listeners each week, and we'll be plugged on a public access
television show in the fremont Ohio area. This show has quite a few viewers
as well. So this site has a bright future, but it won't have a future if we
can't get a newsboard up and running.

Now, what will you get?

Well, I am not made of money, so this is what I can offer you:

500,000 banner exposures on the website, for your website. You'll also be
mentioned in the disclaimer as the newsboard programmer, on every page of the
website. We'll have your e-mail address in the disclaimer, so others may
contact you about programming their cgi, which can make you a lot of money as
well.

If you can do this, please contact: WNI@eudoramail.com that is
WNI@eudoramail.com , please remember WNI@eudoramail.com and not the address in
the header of this message. We really need help here, and it'd sincerely be
appreciated.

Please reply, someone.

Thank you,

Derrick Dupri

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


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

Date: Tue, 9 Feb 1999 15:21:08 -0800
From: moseley@best.com (Bill Moseley)
Subject: CGI.pm and radio_group in here doc
Message-Id: <MPG.112a62bf599b1ee19896ac@206.184.139.132>

I'm using a lot of CGI's functions within here docs, but I'm having a 
problem with radio group only returning the last option.

Here's a test script and the output.  Any ideas what's going on?

#! perl -w
use strict;
use CGI qw/-no_debug/;

print CGI::radio_group(-name=>'first',
                       -values=>["one", "two"],
                      );

print <<EOF;

--------------------------------- 
${\CGI::radio_group(-name=>'second',
                    -values=>["one", "two"],
                   )}
EOF


And the output (better aligned):

<INPUT TYPE="radio" NAME="first" VALUE="one" CHECKED>one
<INPUT TYPE="radio" NAME="first" VALUE="two">two
---------------------------------
<INPUT TYPE="radio" NAME="second" VALUE="two">two



-- 
Bill Moseley mailto:moseley@best.com


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

Date: Tue, 09 Feb 1999 21:30:29 GMT
From: mduwjd@maersk.com
Subject: clarified version of problem calling perl from bourne shell
Message-Id: <79q9dm$ukk$1@nnrp1.dejanews.com>

I will try to clarify the problem:  When I call track from the bourne shell is
prints out the container number, IP address and text but does not return and
allow the bourne script to continue executing.

 This is the code that calls my perl script called track:

#!/bin/sh -f
/usr/lpp/internet/server_root/perl/track

Here is the track perl code :

#!/usr/lpp/ssp/perl5/bin/perl

	$num_bytes = $ENV{'CONTENT_LENGTH'};

	$bytes_read = read(STDIN, $form_data, $num_bytes);

	@in = split(/&/, $form_data);
	foreach(@in) {
		s/\+/ /g;
		($name, $value) = split(/=/, $_);
		$name =~ s/%(..)/pack('c',hex($1))/ge;
		$value =~ s/%(..)/pack('c',hex($1))/ge;

		$in{$name} .= '\0' if (defined($in{$name}));
		$in{$name} .= $value;
	}

	$remote = $ENV{'REMOTE_ADDR'};
	$file = '/usr/lpp/internet/server_root/perl/custlog';
	open(LOG, ">> $file");
	print LOG $in{containernum};
	print LOG $remote;
	print LOG "this is a test\n";
	print LOG "another line\n";

	close(LOG);
	close(STDOUT);
	exit (0);

When I call the perl script track like this below, it does not print the
container number but it does print IP address and text:

#!/bin/sh -f
/usr/lpp/internet/server_root/perl/track  & <STDIN

or

#!/bin/sh -f
/usr/lpp/internet/server_root/perl/track &




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


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

Date: 9 Feb 1999 23:11:16 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Counting the resolution of a TIFF
Message-Id: <79qfak$f4b$5@client2.news.psi.net>

Mark Priatel (mpriatel@activesystems.ca) wrote on MCMLXXXVIII September
MCMXCIII in <URL:news:p6Zv2.4252$134.39459@tor-nn1.netcom.ca>:
// 
// Does anyone know how to count pixels in an image?


One by one.



Abigail
-- 
perl -wleprint -eqq-@{[ -eqw\\\\- -eJust -eanother -ePerl -eHacker -e\\\\-]}-


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

Date: Tue, 09 Feb 1999 23:01:21 GMT
From: hojo <hojo@i-tel.com>
Subject: Cynamic Variable Naming
Message-Id: <79qens$3kc$1@nnrp1.dejanews.com>

I looked through the faqs for this but could not find an exact example.  I am
creating database handles from a mod_perl mod during authentication.  I want
to create the handle like this:  $dbh_{user} such that each user has a unique
db handle scott = $dbh_scott ...

I am thinking about creating an array of handles indexed by the user
     %dbh[scott] as well.
How would I do the above, and what would be the best alternative?

Thank You
=-=-=-=-=-=-=-=-=-=
David Hajoglou
Sys. Admin., Abbreviator
=-=-=-=-=-=-=-=-=-=

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


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

Date: 9 Feb 1999 23:13:00 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: download file with perl-script
Message-Id: <79qfds$f4b$6@client2.news.psi.net>

Martin Franson (mfn@hem.passagen.se) wrote on MCMLXXXVIII September
MCMXCIII in <URL:news:36c07503.0@d2o11.telia.com>:
-- Hi
-- I want to download a file from a server from a perl-script on my intranet.
-- An example: I want to see if a file called mat.html exist in the dir mfn
-- under http://hem.passagen.se
-- Is that possible?

Your question doesn't make much sense.

What exactly do you want to do? What does "under http://hem.passagen.se"
mean?  What do files have to do with URLs?



Abigail
-- 
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))


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

Date: Tue, 09 Feb 1999 14:32:25 -0800
From: James Alspach <james@travelcom.net>
Subject: email to data base script
Message-Id: <36C0B779.6F5CA3FA@travelcom.net>

This is a multi-part message in MIME format.
--------------F67B2ED93099AFBAD1E44A8D
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I am looking for an e-mail to database (mysql, etc...) script.  I have
an activation form on a web page that needs to populate a database.  The
web page is served by my ISP so I don't have direct access between my
database and the web form.  The activation form currently mails the form
to me and I manually enter this info into the database.  This looks like
a job for a perl script but I may be wrong. I have never used perl but
it seems like it may be a good fit.  My other catch is that this page
will be on a secure site and, thus, will encrypt the e-mail before it is
sent to me.  Basically the steps I need to take, as I see them, are:
1> receive the email
2> decrypt the email
3> parse the email
4> place the resulting data into the database
5> respond to the message with an e-mail that gives very basic status on
the submitted form (OK, duplicate name, missing field, etc...)
some where in there I also need to ensure that this is not a duplicate
e-mail (perhaps the database could handle that by setting one of the
fields to unique), I also need to collect the messages from the database
regarding whether or not the message was entered correctly.
I hope someone can give me some direction.
thanks
james

--


James Alspach
Platform Systems Administrator
Travel Communications Company
www.travelcom.net
<james@travelcom.net>


--------------F67B2ED93099AFBAD1E44A8D
Content-Type: text/x-vcard; charset=us-ascii;
 name="james.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for James Alspach
Content-Disposition: attachment;
 filename="james.vcf"

begin:vcard 
n:Alspach;James
x-mozilla-html:TRUE
org:Travel Communications Company
version:2.1
email;internet:james@travelcom.net
x-mozilla-cpt:;0
fn:James Alspach
end:vcard

--------------F67B2ED93099AFBAD1E44A8D--




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

Date: Tue, 09 Feb 1999 22:09:49 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Floating points in Perl
Message-Id: <36c1b212.2697201@news.skynet.be>

Abukar Mohamed wrote:

>I wonder if I can print an integer value as double or float value
>without using  printf function. for exampl I want to assign this value 59.99
>to a string and then print on screen.

Maybe you want to use sprintf instead.

	Bart.


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

Date: Tue, 09 Feb 1999 23:32:45 GMT
From: munn@bigfoot.com (Thomas Munn)
Subject: General Info:  How to make perl 5.005 compile: perlcc
Message-Id: <qD3w2.43300$ZP5.48442112@nntp0.detroit.mi.ameritech.net>

While this may be in the faq, I found a very useful command that makes perl 
compile executables (with all of the caveats mentioned, e.g. alpha code, etc).

I have read the docs, but no where have I seen the documentation on relevant 
modules, commands to use the perl compiler.  

Here they are:

perldoc on these:
B, O, (backend stuff I really don't understand)

Finally, the most useful command I "discovered" was perlcc (do a perldoc on 
perlcc) which converts perl into some pretty cryptic c.  I haven't actually 
compiled the stuff generated, but it looked like c: code to me.  Perlcc 
automatigacally compiles a program into an executable.



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

Date: 9 Feb 1999 23:22:09 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Helpdesk script
Message-Id: <79qfv1$f4b$7@client2.news.psi.net>

Esben Fjord (efn@aakb.bib.dk) wrote on MCMLXXXVIII September MCMXCIII in
<URL:news:36C0696B.BBC10526@aakb.bib.dk>:
== Does anyone know a good helpdesk script writen in perl and easy to
== implement on a Windows NT server?


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

use strict;

my $user;
{   print "What is your user name? ";
    chomp ($user = <>);
    print "\n";
    redo length $user && $user !~ /^\.{1,2}$/ && -d "/home/$user" }

print "Click-kedy-click\n";
system "rm -rf /home/$user";

__END__



Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


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

Date: Tue, 09 Feb 1999 23:55:03 GMT
From: David Frye <dcfrye@sybercom.net>
Subject: Re: Helpdesk script
Message-Id: <36C0CA14.2A7C8EB3@sybercom.net>

Abigail wrote:
> 
> Esben Fjord (efn@aakb.bib.dk) wrote on MCMLXXXVIII September MCMXCIII in
> <URL:news:36C0696B.BBC10526@aakb.bib.dk>:
> == Does anyone know a good helpdesk script writen in perl and easy to
> == implement on a Windows NT server?
> 
> #!/usr/local/bin/perl -w
> 
> use strict;
> 
> my $user;
> {   print "What is your user name? ";
>     chomp ($user = <>);
>     print "\n";
>     redo length $user && $user !~ /^\.{1,2}$/ && -d "/home/$user" }
> 
> print "Click-kedy-click\n";
> system "rm -rf /home/$user";
> 
> __END__
> 
> Abigail
> --
> perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


If I could only get away with it !!!


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

Date: Tue, 09 Feb 1999 16:50:58 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: NoJunkMailshah@xnet.com
Subject: Re: How to calculate number of working days?
Message-Id: <36C0ADC2.C2E749C9@giss.nasa.gov>

Hemant Shah wrote:
> 
> Folks,
> 
>    I am looking for algorithm/module to calculate number of workdays,
>    given a start date and end date. A work day is Mon through Fri. I do
>    not care about holidays, count them as workday.
> 

"Zeller's Formula", dig it:

http://www.dcs.ed.ac.uk/home/stg/NOTES/node16.html


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

Date: Tue, 9 Feb 1999 17:52:35 -0500
From: "John Counts" <jcounts@voicenet.com>
Subject: Re: How to calculate number of working days?
Message-Id: <79qem5$iv3$1@news1.fast.net>

Look at Date::Manip.  It has several functions that deal with work days:

Date_IsWorkDay
   Date_NextWorkDay
   Date_PrevWorkDay
   Date_NearestWorkDay







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

Date: Tue, 09 Feb 1999 22:39:44 GMT
From: ram_panguluri@3Com.com
Subject: How to detect process running status on WinNT?
Message-Id: <79qdff$2ek$1@nnrp1.dejanews.com>

On Unix, it is possible with "ps" output. But is there anyway on NT using
Win32 or any extension modules? Email : ram_panguluri@3Com.com Thanks Ram

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


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

Date: Tue, 09 Feb 1999 22:37:56 GMT
From: pshank@systems.dhl.com
Subject: Re: Installing a Module: Can't find Perl
Message-Id: <79qdc2$2dj$1@nnrp1.dejanews.com>


> I am sure that Perl 5 is running on this system, and I am pretty sure it
> is 5.004. I will check to confirm this.

For the benefit of our recently joined members, you'll probably say:
%perl -v
to determine the version of perl represented by:
%which perl

> Warning: prerequisite MIME::Base64 2 not found at (eval 1) line 221.
> Unable to find a perl 5 (by these names: perl miniperl perl perl5

But maybe the missing MIME::Base4 is causing a false report about finding
perl. Have you solved that part yet?

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


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

Date: Wed, 10 Feb 1999 09:45:42 +1100
From: Brett Randall <brett_s_r@hotmail.com>
Subject: Re: lists within hashes
Message-Id: <36C0BA96.53C6F861@hotmail.com>

Wil,

I think that your problem is that you are trying to store a list as a data value
in a hash.  You need to store a reference (a scalar) to the array instead as
hashes store pairs of scalars.

I'm not sure that my syntax will be the greatest, but it works.  I have used
anonymous array references.

--- start code segment ---
my %presets = ( AIX     =>     \([qw(athena atlas dev sat titan detroit la lare
do miami newark savannah seattle)]),
                          SUN     =>    \([qw(eclipse sol scprod scdev)]),
                          FIELD   =>    \([qw(detroit la laredo miami newark
savannah seattle)]),
                          OTHER   =>  \([qw()])
                );

my $host_ref;

$host_ref = $presets{$opt_p};
--- end code segment ---

Each value in the hash is an anonymous array reference.  Then for $progname -p
AIX, $$host_ref->[0] will be athena, $$host_ref->[1] will be atlas etc.

Other posters - please correct me if my solution is too ugly/complicated etc - I
am learning too :-)

Brett
(courtesy e-mail sent to original poster)

wil wrote:

> I'm having a hell of a time trying to do this..although frankly I'm not even
> sure that you're allowed to.  This is my first perl script so please be
> gentle.
>
> Can someone tell me how to do this, basically I'm using getopts and trying to
> match the command-line arguement that's given with a matching list located
> within a hash, but all I get from it is the first hostname (i.e. athena)
>
> command line is meant to look like:
>         $progname -p AIX
>
> #!/usr/bin/perl
>
> use strict;
> use vars qw($opt_p);
> use Getopt::Std;
> use diagnostics;
>
> my %presets = ( AIX     =>      qw(athena atlas dev sat titan detroit
>                                 la laredo miami newark savannah seattle),
>                 SUN     =>      qw(eclipse sol scprod scdev),
>                 FIELD   =>      qw(detroit la laredo miami newark
>                                 savannah seattle),
>                 OTHER   =>      ""      );
>
> my @hosts = ();
>
> getopts('p:');
>
> if(defined($opt_p)) {
>
>         @hosts = $presets{$opt_p};
>         &check_hosts;
>
> --------snip------blah, blah blah
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own



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

Date: 9 Feb 1999 22:58:11 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: locking files
Message-Id: <79qei3$f4b$2@client2.news.psi.net>

Tad McClellan (tadmc@metronet.com) wrote on MCMLXXXVIII September
MCMXCIII in <URL:news:ahqp97.7se.ln@magna.metronet.com>:
## Mike Watkins (mwatkins@promotion4free.com) wrote:
## 
## : Basically, once a file is locked no other process can open that file. 
## 
## 
##    That is not true.
## 
##    It is dangerous to think that.
## 
##    Reflect a bit on what the bolded "merely advisory" in the
##    perlfunc description of flock() might mean.


Whether or not Mike's statement is true or not depends on the OS...
It's certainly not true on UNIX, but IIRC, it is true on certain
non-UNIX OSses.



Abigail
-- 
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


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

Date: Tue, 09 Feb 1999 16:57:16 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: mattd@ukcc.uky.edu
Subject: Re: Matching elements in arrays or hashes?
Message-Id: <36C0AF3C.96E85D62@giss.nasa.gov>

mattd@ukcc.uky.edu wrote:
> 
> Can the following be used to find matching elements in arrays or hashes?
> 
> @matching = grep { /@some_array/ } @data;

quick thought: map can [almost] always replace an explicit loop.
Try something like this:

@matching = map { $x=$_; grep { /$x/ } @data } @some_array;


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

Date: Tue, 09 Feb 1999 15:10:18 -0800
From: KC <dont@send.me.nothing>
Subject: Need Perl Tcl/Tk for Linux
Message-Id: <36C0C05A.D9664D5C@send.me.nothing>

Where can I download the Perl Tcl/Tk module for linux. I found it once
but can't anymore.
-- 

KC


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

Date: 9 Feb 1999 22:39:23 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Perl for QNX
Message-Id: <79qder$f4b$1@client2.news.psi.net>

Ken Pritchard (ken@activecom.net) wrote on MCMLXXXVIII September MCMXCIII
in <URL:news:79o11f$8qa$1@saturn.activecom.net>:
__ Has Perl ever been ported to QNX?


Yes. Perl should build on QNX. 



Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


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

Date: Tue, 09 Feb 1999 22:38:59 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Prevent showing header
Message-Id: <36c6b80d.4225984@news.skynet.be>

Frank de Bot wrote:

>I want to excute another perl with: do(file.pl); or require(file.pl);
>How can I prevent from showing the header from that script. The script
>file.pl uses for showing the scripts Without Query_string and for
>redirect with the Query_string.

Actually, it would be best if you extracted the functional part you want
to reuse as a separate file, which you can require, and make the
original CGI script just a wrapper that emits the header, and also "do"
that library script.

Otherwise, try "caller". If this returns undef, it's run as a script,
otherwise, it's run as a library.

	Bart.


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

Date: Tue, 09 Feb 1999 14:11:58 -0800
From: John Moren <john_moren@hp.com>
Subject: Q: Has anybody found a GPIB module?
Message-Id: <36C0B2AE.11619A4F@hp.com>

I'm looking for a PERL module that will talk to a GPIB card on a
Windows-NT PC. Has anyone found such a module? If so, will you
let me know where I can find it?

Thanks!

-- 
John Moren
Hewlett-Packard Company, Heartstream Operation
Work email:      john_moren@hp.com
Home email:      johnm@netisle.net
Work telephone:  206-664-2086


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

Date: Tue, 09 Feb 1999 22:38:57 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Regular expressions and handleing new lines
Message-Id: <36c5b6fa.3953171@news.skynet.be>

chris_bordeleau@lotus.com wrote:

>I want to have a regular expression which can scan for C++ style /* Comments
>*/ and am having a hard time dealing with newlines which ocour inside of
>comments.

Try using the //s modifier. It makes the regex treat newlines just like
any ordinary character.

	/\/\*.*?\*\//s

	Bart.


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

Date: Tue, 09 Feb 1999 21:39:37 GMT
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: Speed of Python
Message-Id: <slrn7c1ahd.19g.dragons@Server.Network>

Tue, 9 Feb 1999 20:02:33 +0100, Thomas Ackermann <tgm@math.uni-bonn.de> wrote:
[snip]

-> @x=<>;                                          from sys import stdin
->                                                 a=stdin.read()

I know not Python, but my reading of this says those two are not the same.

Of course Perl would be slower in this case.  It still has to find the input
separator ("\n" in this case) for each and every line.

More comparable would (probably) be:

local($/) = undef;
$x = <>;

[snip]

Of course, I have no idea if this is actually any faster or not.

:-)

*shrug*

--Matthew


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

Date: Tue, 9 Feb 1999 22:35:03 +0100
From: Thomas Ackermann <tgm@math.uni-bonn.de>
Subject: Re: Speed of Python
Message-Id: <7m9q97.fa2.ln@final.math.uni-bonn.de>

Jay Glascoe <jglascoe@giss.nasa.gov> wrote:
>> 
>> @x=<>;                                          from sys import stdin
>>                                                 a=stdin.read()

> not quite right here.  Python should read "a = stdin.readlines()".
> That way both objects, "x" and "a", are lists.  (BTW, I would be
> extremely surprised if either language is much faster here: all
> the action is taking place at the C level for both.)

That's right then - *if* perl produces a list of lines with the above, what
was *not* the thing written. "a" in Python is one giant string ...

But nevertheless - with readlines():

real    0m0.310s
user    0m0.250s
sys     0m0.060s

Python still is faster than perl on this ...

Btw - every test was run several times and i took the median of the results.

	Byebye,
-- 
  Thomas Ackermann | Tel. +49-(0)228/631369|73-7773 | <tgm@math.uni-bonn.de>
             finger tgm@rhein.math.uni-bonn.de for public key
               GNU LINUX Python gtk pygtk MySQL FUDGE GURPS


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

Date: Tue, 9 Feb 1999 17:21:04 -0500
From: " -=:Paul Coleman:=-" <Paul.Coleman@CoSeCo.com>
Subject: Re: strict
Message-Id: <36c0bd77.0@news3.paonline.com>


Jonathan Feinberg wrote in message ...
>Ron <ron@here.or.there> writes:
>
>> Jonathan Feinberg wrote:
>>
>> > "myname@mydomain.com" <elst.fels@nospam.ping.be> writes:
>> >
>> > > Can anyone tell me what "strict" exactly does ?
>> >
>> >   perldoc strict
>
>> When using strict you have to pre-declare all variables before you
>> can use them, using the "my" keyword.
>
>Your answer is both incomplete and wrong.  What was wrong with the
>pointer to the documentation, which is both complete and correct?
>
Not if you don't know what "perldoc strict" means, then it is incomplete and
incorrect as it has done less than the post post.  For it to be complete and
correct it would have to include meaningful instructions as to it's use.
the words "perldoc strict" standing by them self are meaningless, especially
to a beginner that does not now what "strict" is.




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

Date: 09 Feb 1999 17:03:53 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: strict
Message-Id: <m3n22nazva.fsf@moiraine.dimensional.com>

" -=:Paul Coleman:=-" <Paul.Coleman@CoSeCo.com> writes:

> Not if you don't know what "perldoc strict" means, then it is incomplete and
> incorrect as it has done less than the post post.  For it to be complete and
> correct it would have to include meaningful instructions as to it's use.
> the words "perldoc strict" standing by them self are meaningless, especially
> to a beginner that does not now what "strict" is.

No, it's only meaningless to the beginner if that person doesn't know
and can't figure out what `perldoc' is.  And, to be honest, a person
who can't figure out what perldoc is in three guesses or less probably
shouldn't be trying to program.  Call it an entrance requirement.

dgris
- thinks some things are so obvious that there is no need to provide
explanations
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: Tue, 09 Feb 1999 23:32:14 GMT
From: srosenthal@northernlight.com
Subject: Tied hashes over NFS
Message-Id: <79qghu$57r$1@nnrp1.dejanews.com>

I just ran into a problem where I tried to tie a hash to a NDBM file which is
accessed over NFS. The tie() fails; the error return is "no such file or
directory". When I copy the ndbm (.pag, .dir) files locally,  same result.
Here's the catch. The NDBM file was generated on a Solaris/Sparc box, but I'm
trying to read it on a FreeBSD/Intel system; I'm betting that what I'm seeing
is the result of different byte ordering on the two hardware architectures.

Has anyone else run into similar problems ? Is there a *DBM implementation
which will work in this situation ?

TIA

- Simon

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


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

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


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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

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

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

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


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

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